WebKit-https.git
4 years agoTry to force a rebuild.
weinig@apple.com [Wed, 27 Jan 2016 06:27:03 +0000 (06:27 +0000)]
Try to force a rebuild.

* page/DOMWindow.idl:

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

4 years ago[JSC] When lowering B3 to Air, preferRightForResult() should prefer values from the...
benjamin@webkit.org [Wed, 27 Jan 2016 06:10:15 +0000 (06:10 +0000)]
[JSC] When lowering B3 to Air, preferRightForResult() should prefer values from the same block
https://bugs.webkit.org/show_bug.cgi?id=153477

Reviewed by Filip Pizlo.

In cases like this:

Block #0
    @1 = something
    @2 = Jump #1
Block #1
    @3 = something else
    @4 = Add(@3, @1)
    ...
    @42 = Branch(@x, #1, #2)

B3LowerToAir would pick @1 for the argument copied
for what goes into the UseDef side of Add.

This created a bunch of moves that could never be coalesced.
In Kraken's imaging-desaturate, there were enough Moves to slow
down the hot loop.

Ideally, we should not use UseCount for lowering. We should use
the real liveness for preferRightForResult(), and a loop-weighted
use-count for effective addresses. The problem is keeping the cost
low for those simple helpers.

In this patch, I went with a simple heuristic: prioritize the value
defined in the same block for UseDef.

There is one other way that would be cheap but a bit invasive:
-Get rid of UseDef.
-Make every ops, 3 operands.
-Tell the register allocator to attempt aliasing of the 2 uses
 with the def.
-If the allocator fails, just add a move as needed.

For now, the simple heuristic seems okay for the cases have.

* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::preferRightForResult):

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

4 years agoTail duplication should break critical edges first
fpizlo@apple.com [Wed, 27 Jan 2016 03:49:35 +0000 (03:49 +0000)]
Tail duplication should break critical edges first
https://bugs.webkit.org/show_bug.cgi?id=153530

Reviewed by Benjamin Poulain.

This speeds up Octane/boyer.

* b3/B3DuplicateTails.cpp:

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

4 years agofast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes
cdumez@apple.com [Wed, 27 Jan 2016 03:45:09 +0000 (03:45 +0000)]
fast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes
https://bugs.webkit.org/show_bug.cgi?id=153525

Reviewed by Andreas Kling.

Source/WebCore:

The test was crashing because DatabaseThread::hasPendingDatabaseActivity()
was accessing m_openDatabaseSet from the main thread without any locking
mechanism. This is an issue because m_openDatabaseSet is altered by the
database thread.

No new tests, already covered by fast/history/page-cache-webdatabase-no-transaction-db.html.

* Modules/webdatabase/DatabaseThread.cpp:
(WebCore::DatabaseThread::databaseThread):
(WebCore::DatabaseThread::recordDatabaseOpen):
(WebCore::DatabaseThread::recordDatabaseClosed):
(WebCore::DatabaseThread::hasPendingDatabaseActivity):
* Modules/webdatabase/DatabaseThread.h:

LayoutTests:

Unskip fast/history/page-cache-webdatabase-no-transaction-db.html now
that it no longer crashes.

* TestExpectations:

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

4 years agoREGRESSION (r194557): Keyboard shortcuts stop working after the WKWebView is unparent...
timothy_horton@apple.com [Wed, 27 Jan 2016 03:16:06 +0000 (03:16 +0000)]
REGRESSION (r194557): Keyboard shortcuts stop working after the WKWebView is unparented and reparented
https://bugs.webkit.org/show_bug.cgi?id=153492
<rdar://problem/24138989>

Reviewed by Dan Bernstein.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canBecomeFirstResponder]):
(-[WKContentView becomeFirstResponder]):
(-[WKContentView resignFirstResponder]):
When WKWebView is unparented, WKContentView will attempt to resignFirstResponder upwards,
first asking WKWebView. After r194557, WKWebView will accept first responder and forward
it on to the WKContentView, which will happily accept it again, despite being the view
that's trying to resign. This will cause us to completely lose first responder,
where it was actually supposed to propagate up above WKWebView to the client.

Keep track of when WKContentView is resigning first responder, and don't
let it become first responder while it is doing so, breaking the cycle.

* UIProcess/ios/WKContentView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canBecomeFirstResponder]):
If the WKContentView is currently in the process of resigning first responder status,
we shouldn't accept it, because clients expect to receive it.

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

4 years agoSource/WebKit2:
commit-queue@webkit.org [Wed, 27 Jan 2016 03:05:49 +0000 (03:05 +0000)]
Source/WebKit2:
Implement wildcard matching for plug-in policy host.
https://bugs.webkit.org/show_bug.cgi?id=153090

Patch by I-Ting Liu <iting_liu@apple.com> on 2016-01-26
Reviewed by Darin Adler.

WebPlatformStrategies decides the plug-in load policy for a host by looking
for a matched hostname in the list of plug-in policies sent by Safari. This
patch adds support for wildcard matching -- if there's a policy with hostname
"*.example.com," the policy for "foo.example.com" would be replaced with that
of "*.example.com" if there's no policy for this hostname. If there is more
than one wildcard hostname, the host with the longest wildcard hostname will
be used.

This patch adds a helper function in StringUtilites that matches a string to
another string, which may contain wildcard ('*') characters.

* Platform/mac/StringUtilities.h:
- Add WebKit::stringMatchesWildcardString.
- Remove #if ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC) flag so that
the compiler allows exposing StringUtilities.h.
- Add #if __OBJC__ to allow the file to be included in WebPltformStrategies.cpp

* Platform/mac/StringUtilities.mm:
(WebKit::stringMatchesWildcardString):
Return true if the entire first given String matches the second. The second string
may contain wildcard characters.
(WebKit::wildcardRegexPatternString):
Return the regex expression from a wildcard string by replacing the wildcard
character ('*') with (".*") and escaping regular expression metacharacters.
(WebKit::formattedPhoneNumberString):
To expose StringUtilities.h for tests, we removed #if ENABLE(TELEPHONE_NUMBER_DETECTION)
&& PLATFORM(MAC) flag in the header. Add a function that returns nil for
#if !(ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC)) to fix the removal
of the flag in the header file.

* WebKit2.xcodeproj/project.pbxproj:
Change the file attribute of StringUtilities.h from Project to Private for
testing in TestWebKitAPI.

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
Return the wildcard hostname whose matched substring with the host is the longest.
(WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
Replace the look-up host with a matched wildcard host if there is a match and that
the matched wildcard host's plug-in identifier is the same as that of the host.
(WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
Try to replace the look-up host with the wildcard host if there's no policy for
the host. Restructure the function to reduce hashmap lookup.

* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
Declare the methods.

Source/WTF:
Implement wildcard matching for plug-in policy host.
https://bugs.webkit.org/show_bug.cgi?id=153090

Patch by I-Ting Liu <iting_liu@apple.com> on 2016-01-26
Reviewed by Darin Adler.

* wtf/text/AtomicString.h:
(WTF::AtomicString::AtomicString):
Add __bridge to allow compilation.

Tools:
Add a test for WebKit::stringMatchesWildcardString.
https://bugs.webkit.org/show_bug.cgi?id=153090

Patch by I-Ting Liu <iting_liu@apple.com> on 2016-01-26
Reviewed by Darin Adler.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
Add the file to the project.

* TestWebKitAPI/Tests/WebKit2/mac/StringUtilities.mm: Added.
(TestWebKitAPI::TEST):
Test that a string matches another string that may contain wildcard characters.

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

4 years agoUnreviewed CMake build fix after r195644.
joepeck@webkit.org [Wed, 27 Jan 2016 02:41:55 +0000 (02:41 +0000)]
Unreviewed CMake build fix after r195644.

* PlatformMac.cmake:

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

4 years agoModern IDB: Key generator support for SQLite backend.
beidson@apple.com [Wed, 27 Jan 2016 02:25:58 +0000 (02:25 +0000)]
Modern IDB: Key generator support for SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=153427

Reviewed by Alex Christensen.

Source/WebCore:

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

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

4 years agoRemove -d flag from make invocation.
andersca@apple.com [Wed, 27 Jan 2016 02:16:57 +0000 (02:16 +0000)]
Remove -d flag from make invocation.

* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoAllow canvas to use display-list drawing for testing
simon.fraser@apple.com [Wed, 27 Jan 2016 01:53:18 +0000 (01:53 +0000)]
Allow canvas to use display-list drawing for testing
https://bugs.webkit.org/show_bug.cgi?id=153475

Reviewed by Dean Jackson.

Source/WebCore:

Optionally have 2D <canvas> use display-list drawing, which is only enabled
via Internals for now.

Support displayListAsText() and replayDisplayListAsText() on canvas, so we can
use it to test playback optimizations. [Note that displayListAsText() always
returns an empty string currently, because the display list is cleared when the
canvas is painted to the page.]

Display list rendering is implemented by giving CanvasRenderingContext2D an
optional DisplayListDrawingContext, which packages up a display list, recorder
and recording context. The existing paintRenderingResultsToCanvas() is overridden
to replay the recorded display list into the primary canvas context.

Tracked replay display lists are stored in a static map, keyed by the CanvasRenderingContext2D.

Test: displaylists/canvas-display-list.html

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::HTMLCanvasElement):
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::setUsesDisplayListDrawing):
(WebCore::HTMLCanvasElement::setTracksDisplayListReplay):
(WebCore::HTMLCanvasElement::displayListAsText):
(WebCore::HTMLCanvasElement::replayDisplayListAsText):
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
(WebCore::contextDisplayListMap):
(WebCore::CanvasRenderingContext2D::~CanvasRenderingContext2D):
(WebCore::CanvasRenderingContext2D::setTracksDisplayListReplay):
(WebCore::CanvasRenderingContext2D::displayListAsText):
(WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
(WebCore::CanvasRenderingContext2D::paintRenderingResultsToCanvas):
(WebCore::CanvasRenderingContext2D::drawingContext):
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): Deleted.
* html/canvas/CanvasRenderingContext2D.h:
* testing/Internals.cpp:
(WebCore::Internals::setElementUsesDisplayListDrawing):
(WebCore::Internals::setElementTracksDisplayListReplay):
(WebCore::Internals::displayListForElement):
(WebCore::Internals::replayDisplayListForElement):

LayoutTests:

Simple canvas-based display list test.

* displaylists/canvas-display-list-expected.txt: Added.
* displaylists/canvas-display-list.html: Added.

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

4 years agoWeb Inspector: Remove unused FramesLarge.png variants, only the smaller Frames icon...
commit-queue@webkit.org [Wed, 27 Jan 2016 01:31:36 +0000 (01:31 +0000)]
Web Inspector: Remove unused FramesLarge.png variants, only the smaller Frames icon is used for the Rendering Frames timeline
https://bugs.webkit.org/show_bug.cgi?id=153523

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

* UserInterface/Images/FramesLarge.png: Removed.
* UserInterface/Images/FramesLarge@2x.png: Removed.
* UserInterface/Images/gtk/FramesLarge.png: Removed.
* UserInterface/Images/gtk/FramesLarge@2x.png: Removed.
* UserInterface/Views/TimelineIcons.css:
(.rendering-frame-icon.large .icon): Deleted.

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

4 years agoGeneralize ResourceUsageData gathering to be used outside of ResourceUsageOverlay
joepeck@webkit.org [Wed, 27 Jan 2016 01:29:25 +0000 (01:29 +0000)]
Generalize ResourceUsageData gathering to be used outside of ResourceUsageOverlay
https://bugs.webkit.org/show_bug.cgi?id=153509
<rdar://problem/24354291>

Reviewed by Andreas Kling.

Source/JavaScriptCore:

* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::didAllocateBlock):
(JSC::Heap::didFreeBlock):
Rename the ENABLE flag.

Source/WebCore:

* CMakeLists.txt:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* page/Page.cpp:
* page/Page.h:
* page/Settings.cpp:
* page/Settings.h:
* page/ResourceUsageOverlay.cpp:
* page/ResourceUsageOverlay.h:
Add new files to the build and updated ENABLE flag name.

* page/ResourceUsageData.cpp: Added.
(WebCore::ResourceUsageData::ResourceUsageData):
* page/ResourceUsageData.h: Added.
(WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
Platform agnostic resource data that may be used by multiple clients,
such as the ResourceUsageOverlay and later the Inspector.

* page/ResourceUsageThread.h: Added.
* page/ResourceUsageThread.cpp: Added.
(WebCore::ResourceUsageThread::ResourceUsageThread):
(WebCore::ResourceUsageThread::singleton):
(WebCore::ResourceUsageThread::addObserver):
(WebCore::ResourceUsageThread::removeObserver):
(WebCore::ResourceUsageThread::waitUntilObservers):
(WebCore::ResourceUsageThread::notifyObservers):
(WebCore::ResourceUsageThread::createThreadIfNeeded):
(WebCore::ResourceUsageThread::threadCallback):
(WebCore::ResourceUsageThread::threadBody):
Platform agnostic resource usage thread that can be used to gather data
into a ResourceUsageData struct on a background thread and notify observers
on the main thread. Platforms need only implement ResourceUsageThread::platformThreadBody
to populate the ResourceUsageData struct with data.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo):
(WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
(WebCore::historicUsageData):
(WebCore::appendDataToHistory):
(WebCore::ResourceUsageOverlay::platformInitialize):
(WebCore::ResourceUsageOverlay::platformDestroy):
(WebCore::drawMemHistory):
(WebCore::drawMemoryPie):
(WebCore::ResourceUsageOverlay::platformDraw):
Move CPU and memory resource usage calculations to ResourceUsageThread.
The overlay adds itself as an observer, and builds its RingBuffer list
of data from notifications from the ResourceUsageThread. Renamed
some of the fields.

* page/cocoa/ResourceUsageThreadCocoa.mm: Added.
(WebCore::vmPageSize):
(WebCore::TagInfo::TagInfo):
(WebCore::pagesPerVMTag):
(WebCore::cpuUsage):
(WebCore::categoryForVMTag):
(WebCore::ResourceUsageThread::platformThreadBody):
Extracted from ResourceUsageOverlayCocoa.

* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::dispatch):
Drive-by, don't call singleton again, we already have the result.

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Rename the ENABLE flag.

Source/WTF:

* wtf/Platform.h:
Rename the ENABLE flag.

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

4 years agoUse initializers in HTMLCanvasElement
simon.fraser@apple.com [Wed, 27 Jan 2016 01:22:44 +0000 (01:22 +0000)]
Use initializers in HTMLCanvasElement
https://bugs.webkit.org/show_bug.cgi?id=153472

Reviewed by Michael Catanzaro.

Use initializers, and re-order member variables for better packing.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::HTMLCanvasElement):
* html/HTMLCanvasElement.h:

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

4 years agoSetting HTMLInputElement.value to null to set its value to the empty string
cdumez@apple.com [Wed, 27 Jan 2016 01:16:16 +0000 (01:16 +0000)]
Setting HTMLInputElement.value to null to set its value to the empty string
https://bugs.webkit.org/show_bug.cgi?id=153519

Reviewed by Ryosuke Niwa.

Source/WebCore:

Setting HTMLInputElement.value to null to set its value to the empty string:
- https://html.spec.whatwg.org/#htmlinputelement
- http://heycam.github.io/webidl/#TreatNullAs

WebKit would previously unset the value attribute instead, which caused
it to fallback to input.defaultValue if set.

Firefox and Chrome behave correctly.

Test: fast/dom/HTMLInputElement/input-value-set-null.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValue):

LayoutTests:

Add a layout test to make sure that setting HTMLInputElement.value to null
actually sets its value to the empty string.

* fast/dom/HTMLInputElement/input-value-set-null-expected.txt: Added.
* fast/dom/HTMLInputElement/input-value-set-null.html: Added.

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

4 years agoUnreviewed, rolling out r195602.
commit-queue@webkit.org [Wed, 27 Jan 2016 01:11:53 +0000 (01:11 +0000)]
Unreviewed, rolling out r195602.
https://bugs.webkit.org/show_bug.cgi?id=153526

broke more than it fixed (Requested by thorton on #webkit).

Reverted changeset:

"REGRESSION (r194557): Keyboard shortcuts stop working after
the WKWebView is unparented and reparented"
https://bugs.webkit.org/show_bug.cgi?id=153492
http://trac.webkit.org/changeset/195602

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

4 years ago[B3] Fix control reaches end of non-void function GCC warning after r195139
ossy@webkit.org [Wed, 27 Jan 2016 01:10:58 +0000 (01:10 +0000)]
[B3] Fix control reaches end of non-void function GCC warning after r195139
https://bugs.webkit.org/show_bug.cgi?id=153426

Reviewed by Michael Catanzaro.

* b3/air/AirArg.h:
(JSC::B3::Air::Arg::cooled):

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

4 years agotestb3 and testAir should be compiled under -O0
sbarati@apple.com [Wed, 27 Jan 2016 00:57:06 +0000 (00:57 +0000)]
testb3 and testAir should be compiled under -O0
https://bugs.webkit.org/show_bug.cgi?id=153520

Reviewed by Benjamin Poulain.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

4 years agoUnreviewed, temporarily skip fast/history/page-cache-webdatabase-no-transaction-db...
cdumez@apple.com [Wed, 27 Jan 2016 00:52:32 +0000 (00:52 +0000)]
Unreviewed, temporarily skip fast/history/page-cache-webdatabase-no-transaction-db.html
https://bugs.webkit.org/show_bug.cgi?id=153525

The test flakily crashes, skip it until I can fix it.

* TestExpectations:

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

4 years agoB3's integer range analysis should know that Mul'ing two sufficiently small numbers...
fpizlo@apple.com [Wed, 27 Jan 2016 00:49:03 +0000 (00:49 +0000)]
B3's integer range analysis should know that Mul'ing two sufficiently small numbers will yield a number that still has a meaningful range
https://bugs.webkit.org/show_bug.cgi?id=153518

Reviewed by Benjamin Poulain.

Octane/encrypt had an addition overflow check that can be proved away by being sufficiently
sneaky about the analysis of adds, multiplies, and shifts.

I almost added these optimizations to the DFG integer range optimization phase. That phase is
very complicated. B3's integer range analysis is trivial. So I added it to B3. Eventually
we'll want this same machinery in the DFG also.

8% speed-up on Octane/encrypt.

* b3/B3ReduceStrength.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::dump): Dumping a constant value's name now dumps its value. This makes a huge difference for reading IR.
(JSC::B3::Value::cloneImpl):
(JSC::B3::Value::deepDump):

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

4 years agoRebaseline imported/w3c/web-platform-tests/html/semantics/interfaces.html for ios...
ryanhaddad@apple.com [Wed, 27 Jan 2016 00:33:33 +0000 (00:33 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/semantics/interfaces.html for ios-simulator after support
for HTMLDataElement was added in r195627, removing ios-simulator-wk2 specific result.
https://bugs.webkit.org/show_bug.cgi?id=153459

Unreviewed test gardening.

* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt: Removed.
* platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt:

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

4 years agoWebKitAdditions should be able to modify derived source rules
andersca@apple.com [Wed, 27 Jan 2016 00:29:42 +0000 (00:29 +0000)]
WebKitAdditions should be able to modify derived source rules
https://bugs.webkit.org/show_bug.cgi?id=153514

Reviewed by Tim Horton.

Source/WebCore:

* DerivedSources.make:
Include WebCoreDerivedSourcesAdditions.make.

* WebCore.xcodeproj/project.pbxproj:
Pass our WebKitAdditions paths as include paths to make.

Source/WebKit2:

* Configurations/BaseTarget.xcconfig:
* Configurations/WebKit.xcconfig:
Set WEBKITADDITIONS_HEADER_SEARCH_PATHS.

* DerivedSources.make:
Move the path computation earlier and include WebKitDerivedSourcesAdditions.make.

* WebKit2.xcodeproj/project.pbxproj:
Pass our WebKitAdditions paths as include paths to make.

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

4 years agoSkipping tests added with r195625 that are unsupported on ios-simulator
ryanhaddad@apple.com [Wed, 27 Jan 2016 00:08:12 +0000 (00:08 +0000)]
Skipping tests added with r195625 that are unsupported on ios-simulator

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoMake HashTable iterators STL iterators compatible
achristensen@apple.com [Tue, 26 Jan 2016 23:46:28 +0000 (23:46 +0000)]
Make HashTable iterators STL iterators compatible
https://bugs.webkit.org/show_bug.cgi?id=153512

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2016-01-26
Reviewed by Alex Christensen.

While r178581 makes many hash table iterators STL compatible, still several iterators are not.
This patch fixes that; inheriting std::iterator correctly to meet STL iterator requirements (like iterator_category etc.)
It could recover Windows build failure.

* wtf/HashTable.h:

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

4 years agodocument.open() / write() should be prevented in beforeunload event handlers
cdumez@apple.com [Tue, 26 Jan 2016 23:22:18 +0000 (23:22 +0000)]
document.open() / write() should be prevented in beforeunload event handlers
https://bugs.webkit.org/show_bug.cgi?id=153432

Reviewed by Ryosuke Niwa.

Source/WebCore:

document.open() / write() should be prevented in beforeunload event handlers:
- https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
- https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
- https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
- https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document

Test: fast/frames/page-beforeunload-document-open.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):

LayoutTests:

Add a layout test to check that document.open() / write() is indeed
prevented inside 'beforeunload' event handlers.

* fast/frames/page-beforeunload-document-open-expected.txt: Added.
* fast/frames/page-beforeunload-document-open.html: Added.
* fast/frames/resources/page-beforeunload-document-open-frame.html: Added.

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

4 years agoAdd support for HTMLDataElement
cdumez@apple.com [Tue, 26 Jan 2016 23:21:30 +0000 (23:21 +0000)]
Add support for HTMLDataElement
https://bugs.webkit.org/show_bug.cgi?id=153459

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline existing W3C tests now that more checks are passing.

* web-platform-tests/dom/nodes/Node-cloneNode-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/semantics/interfaces-expected.txt:

Source/WebCore:

Add support for HTMLDataElement:
https://html.spec.whatwg.org/multipage/semantics.html#the-data-element

Firefox already supports it.

No new tests, already covered by existing tests.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLDataElement.cpp: Added.
(WebCore::HTMLDataElement::create):
(WebCore::HTMLDataElement::HTMLDataElement):
* html/HTMLDataElement.h: Added.
* html/HTMLDataElement.idl: Added.
* html/HTMLElementsAllInOne.cpp:
* html/HTMLTagNames.in:

LayoutTests:

Rebaseline existing test now that HTMLDataElement is exposed on the
global Window object.

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

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

4 years agoUnreviewed, rolling out r195610.
ryanhaddad@apple.com [Tue, 26 Jan 2016 23:14:55 +0000 (23:14 +0000)]
Unreviewed, rolling out r195610.
https://bugs.webkit.org/show_bug.cgi?id=153513

The test added with this change is timing out on almost every
run (Requested by ryanhaddad on #webkit).

Reverted changeset:

"Calling video.controls=true during a scrub operation cancels
scrub."
https://bugs.webkit.org/show_bug.cgi?id=153494
http://trac.webkit.org/changeset/195610

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

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

4 years agoHistory.pushState causes intense memory pressure.
beidson@apple.com [Tue, 26 Jan 2016 22:48:15 +0000 (22:48 +0000)]
History.pushState causes intense memory pressure.
https://bugs.webkit.org/show_bug.cgi?id=153435

Reviewed by Sam Weinig, Oliver Hunt, and Geoff Garen.

Source/WebCore:

Tests: fast/loader/stateobjects/pushstate-frequency-iframe.html
       fast/loader/stateobjects/pushstate-frequency-with-user-gesture.html
       fast/loader/stateobjects/pushstate-frequency.html
       fast/loader/stateobjects/replacestate-frequency-iframe.html
       fast/loader/stateobjects/replacestate-frequency-with-user-gesture.html
       fast/loader/stateobjects/replacestate-frequency.html
       loader/stateobjects/pushstate-size-iframe.html
       loader/stateobjects/pushstate-size.html
       loader/stateobjects/replacestate-size-iframe.html
       loader/stateobjects/replacestate-size.html

Add restrictions on how frequently push/replaceState can be called,
as well as how much of a cumulative payload they can deliver.

* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):

* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/History.h:

LayoutTests:

* TestExpectations: Mark some of the new tests as slow.

* fast/loader/stateobjects/pushstate-frequency-expected.txt: Added.
* fast/loader/stateobjects/pushstate-frequency-iframe-expected.txt: Added.
* fast/loader/stateobjects/pushstate-frequency-iframe.html: Added.
* fast/loader/stateobjects/pushstate-frequency-with-user-gesture-expected.txt: Added.
* fast/loader/stateobjects/pushstate-frequency-with-user-gesture.html: Added.
* fast/loader/stateobjects/pushstate-frequency.html: Added.
* fast/loader/stateobjects/replacestate-frequency-expected.txt: Added.
* fast/loader/stateobjects/replacestate-frequency-iframe-expected.txt: Added.
* fast/loader/stateobjects/replacestate-frequency-iframe.html: Added.
* fast/loader/stateobjects/replacestate-frequency-with-user-gesture-expected.txt: Added.
* fast/loader/stateobjects/replacestate-frequency-with-user-gesture.html: Added.
* fast/loader/stateobjects/replacestate-frequency.html: Added.
* fast/loader/stateobjects/resources/pushstate-iframe.html: Added.
* fast/loader/stateobjects/resources/replacestate-iframe.html: Added.
* loader/stateobjects/pushstate-size-expected.txt: Added.
* loader/stateobjects/pushstate-size-iframe-expected.txt: Added.
* loader/stateobjects/pushstate-size-iframe.html: Added.
* loader/stateobjects/pushstate-size.html: Added.
* loader/stateobjects/replacestate-size-expected.txt: Added.
* loader/stateobjects/replacestate-size-iframe-expected.txt: Added.
* loader/stateobjects/replacestate-size-iframe.html: Added.
* loader/stateobjects/replacestate-size.html: Added.
* loader/stateobjects/resources/pushstate-iframe.html: Added.
* loader/stateobjects/resources/replacestate-iframe.html: Added.

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

4 years agoRebaselining cssom/subpixel-offsetleft-top-width-height-values.html for ios-simulator
ryanhaddad@apple.com [Tue, 26 Jan 2016 22:22:25 +0000 (22:22 +0000)]
Rebaselining cssom/subpixel-offsetleft-top-width-height-values.html for ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=152308

Unreviewed test gardening.

* platform/ios-simulator/cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added.

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

4 years agoAdd a private WKUIDelegate method for getting a presenting view controller for a...
andersca@apple.com [Tue, 26 Jan 2016 22:22:14 +0000 (22:22 +0000)]
Add a private WKUIDelegate method for getting a presenting view controller for a WKWebView on iOS
https://bugs.webkit.org/show_bug.cgi?id=153510

Reviewed by Dan Bernstein.

* UIProcess/API/APIUIClient.h:
(API::UIClient::presentingViewController):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::presentingViewController):

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

4 years agoIt should be possible to disable FTL for a range like we disable DFG for a range
fpizlo@apple.com [Tue, 26 Jan 2016 22:20:10 +0000 (22:20 +0000)]
It should be possible to disable FTL for a range like we disable DFG for a range
https://bugs.webkit.org/show_bug.cgi?id=153511

Reviewed by Geoffrey Garen.

* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::TierUpCheckInjectionPhase::run):
* runtime/Options.h:

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

4 years agoShifts by an amount computed using BitAnd with a mask that subsumes the shift's own...
fpizlo@apple.com [Tue, 26 Jan 2016 22:07:28 +0000 (22:07 +0000)]
Shifts by an amount computed using BitAnd with a mask that subsumes the shift's own mask should be rewired around the BitAnd
https://bugs.webkit.org/show_bug.cgi?id=153505

Reviewed by Saam Barati.

Turn this: Shl(@x, BitAnd(@y, 63))
Into this: Shl(@x, @y)

It matters for Octane/crypto.

We should also stop FTL from generating such code, but even if we did that, we'd still want
this optimization in case user code did the BitAnd.

Also we can't stop the FTL from generating such code yet, because when targetting LLVM, you
must mask your shifts this way.

* b3/B3ReduceStrength.cpp:

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

4 years agoThe thing that B3 uses to describe a stack slot should not be a Value
fpizlo@apple.com [Tue, 26 Jan 2016 22:05:28 +0000 (22:05 +0000)]
The thing that B3 uses to describe a stack slot should not be a Value
https://bugs.webkit.org/show_bug.cgi?id=153491
rdar://problem/24349446

Reviewed by Geoffrey Garen and Saam Barati.

Prior to this change, B3 represented stack slots by having a StackSlotValue that carried
two meanings:

- It represented a stack slot.

- It was a kind of Value for getting the base of the stack slot.

This seems like a good idea until you consider the following issues.

1) A Value can be killed if it is on an unreachable path, or if it has no effects and
   nobody refers to it. But the FTL uses StackSlotValue to allocate space on the stack.
   When it does this, it doesn't want it to be killed. It will dereference the object, so
   killing it is a bug.

2) A premise of B3 is that it should be always legal to perform the following
   transformation on a value:

   value->replaceWithIdentity(insertionSet.insertValue(index, proc.clone(value)));

   This inserts a new value just before the old one. The new value is a clone of the old
   one. Then the old one is essentially deleted (anything that becomes an identity dies
   shortly thereafter). Problem (1) prevents this from being legal, which breaks a major
   premise of B3 IR.

3) A premise of B3 is that it should be always legal to perform the following
   transformation on a value:

   Before:
           @42 = Thing(...)

   After:
           Branch(@doesntMatter, #yes, #no)
       BB#yes:
           @42_one = Thing(...)
           Upsilon(@42_one, ^42)
           Jump(#done)
       BB#no:
           @42_two = Thing(...)
           Upsilon(@42_two, ^42)
           Jump(#done)
       BB#done:
           @42 = Phi()

   But prior to this change, such a transformation makes absolutely no sense for
   StackSlot. It will "work" in the sense that the compiler will proceed undaunted, but
   it will disable SSA fix-up for the cloned stack slot and we will end up allocating two
   stack slots instead of one, and then we will assume that they both escape, which will
   disable efficient stack allocation. Note that the moral equivalent of this
   transformation could already happen due to tail duplication, and the only reason why
   it's not a bug right now is that we happen to hoist stack slots to the root block. But
   the whole point of our stack slots was supposed to be that they do not have to be
   hoisted.

This change fixes this issue by splitting StackSlotValue into two things: SlotBaseValue,
which is a pure operation for getting the base address of a StackSlot, and StackSlot,
which is a representation of the actual stack slot. StackSlot cannot get duplicated and
can only be killed if it's anonymous. SlotBaseValue can be killed, moved, cloned,
hoisted, etc. Since it has no effects and it has a ValueKey, it's one of the most
permissive Values in the IR, just as one would hope (after all, there is actually zero
code that needs to execute to evaluate SlotBaseValue).

This fixes a crash that we saw with GuardMalloc and ASan. It also makes the IR a lot more
easy to reason about.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3EliminateCommonSubexpressions.cpp:
* b3/B3FixSSA.cpp:
(JSC::B3::demoteValues):
(JSC::B3::fixSSA):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::run):
(JSC::B3::Air::LowerToAir::effectiveAddr):
(JSC::B3::Air::LowerToAir::lower):
* b3/B3Opcode.cpp:
(WTF::printInternal):
* b3/B3Opcode.h:
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::setBlockOrderImpl):
(JSC::B3::Procedure::addStackSlot):
(JSC::B3::Procedure::addAnonymousStackSlot):
(JSC::B3::Procedure::clone):
(JSC::B3::Procedure::dump):
(JSC::B3::Procedure::blocksInPostOrder):
(JSC::B3::Procedure::deleteStackSlot):
(JSC::B3::Procedure::deleteValue):
(JSC::B3::Procedure::calleeSaveRegisters):
(JSC::B3::Procedure::addStackSlotIndex):
(JSC::B3::Procedure::addValueIndex):
* b3/B3Procedure.h:
(JSC::B3::Procedure::setBlockOrder):
(JSC::B3::Procedure::StackSlotsCollection::StackSlotsCollection):
(JSC::B3::Procedure::StackSlotsCollection::size):
(JSC::B3::Procedure::StackSlotsCollection::at):
(JSC::B3::Procedure::StackSlotsCollection::operator[]):
(JSC::B3::Procedure::StackSlotsCollection::iterator::iterator):
(JSC::B3::Procedure::StackSlotsCollection::iterator::operator*):
(JSC::B3::Procedure::StackSlotsCollection::iterator::operator++):
(JSC::B3::Procedure::StackSlotsCollection::iterator::operator==):
(JSC::B3::Procedure::StackSlotsCollection::iterator::operator!=):
(JSC::B3::Procedure::StackSlotsCollection::iterator::findNext):
(JSC::B3::Procedure::StackSlotsCollection::begin):
(JSC::B3::Procedure::StackSlotsCollection::end):
(JSC::B3::Procedure::stackSlots):
(JSC::B3::Procedure::ValuesCollection::ValuesCollection):
* b3/B3ReduceStrength.cpp:
* b3/B3SlotBaseValue.cpp: Copied from Source/JavaScriptCore/b3/B3StackSlotValue.cpp.
(JSC::B3::SlotBaseValue::~SlotBaseValue):
(JSC::B3::SlotBaseValue::dumpMeta):
(JSC::B3::SlotBaseValue::cloneImpl):
(JSC::B3::StackSlotValue::~StackSlotValue): Deleted.
(JSC::B3::StackSlotValue::dumpMeta): Deleted.
(JSC::B3::StackSlotValue::cloneImpl): Deleted.
* b3/B3SlotBaseValue.h: Copied from Source/JavaScriptCore/b3/B3StackSlotValue.h.
* b3/B3StackSlot.cpp: Added.
(JSC::B3::StackSlot::~StackSlot):
(JSC::B3::StackSlot::dump):
(JSC::B3::StackSlot::deepDump):
(JSC::B3::StackSlot::StackSlot):
* b3/B3StackSlot.h: Added.
(JSC::B3::StackSlot::byteSize):
(JSC::B3::StackSlot::kind):
(JSC::B3::StackSlot::isLocked):
(JSC::B3::StackSlot::index):
(JSC::B3::StackSlot::offsetFromFP):
(JSC::B3::StackSlot::setOffsetFromFP):
(JSC::B3::DeepStackSlotDump::DeepStackSlotDump):
(JSC::B3::DeepStackSlotDump::dump):
(JSC::B3::deepDump):
* b3/B3StackSlotValue.cpp: Removed.
* b3/B3StackSlotValue.h: Removed.
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::effects):
(JSC::B3::Value::key):
(JSC::B3::Value::checkOpcode):
* b3/B3ValueKey.cpp:
(JSC::B3::ValueKey::materialize):
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::addBlock):
(JSC::B3::Air::Code::addStackSlot):
(JSC::B3::Air::Code::addSpecial):
* b3/air/AirCode.h:
* b3/air/AirStackSlot.cpp:
(JSC::B3::Air::StackSlot::setOffsetFromFP):
(JSC::B3::Air::StackSlot::dump):
(JSC::B3::Air::StackSlot::deepDump):
(JSC::B3::Air::StackSlot::StackSlot):
* b3/air/AirStackSlot.h:
(JSC::B3::Air::StackSlot::alignment):
(JSC::B3::Air::StackSlot::b3Slot):
(JSC::B3::Air::StackSlot::offsetFromFP):
(WTF::printInternal):
(JSC::B3::Air::StackSlot::value): Deleted.
* b3/testb3.cpp:
(JSC::B3::testStackSlot):
(JSC::B3::testStoreLoadStackSlot):
* ftl/FTLB3Compile.cpp:
* ftl/FTLB3Output.cpp:
(JSC::FTL::Output::appendTo):
(JSC::FTL::Output::lockedStackSlot):
(JSC::FTL::Output::neg):
* ftl/FTLB3Output.h:
(JSC::FTL::Output::framePointer):
(JSC::FTL::Output::constBool):
(JSC::FTL::Output::constInt32):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::lower):
* ftl/FTLState.h:

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

4 years ago[webkitdirs] Removed check for bison, gperf, and flex.
commit-queue@webkit.org [Tue, 26 Jan 2016 21:38:21 +0000 (21:38 +0000)]
[webkitdirs] Removed check for bison, gperf, and flex.
https://bugs.webkit.org/show_bug.cgi?id=153496

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-01-26
Reviewed by Alex Christensen.

This prerequisites are checked in WebKitCommon.cmake and don't
have to be in $PATH.

* Scripts/webkitdirs.pm:
(checkRequiredSystemConfig):

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

4 years agoAdd a Dictionary overload that returns an Optional result
andersca@apple.com [Tue, 26 Jan 2016 21:22:16 +0000 (21:22 +0000)]
Add a Dictionary overload that returns an Optional result
https://bugs.webkit.org/show_bug.cgi?id=153507

Reviewed by Tim Horton.

* bindings/js/Dictionary.h:
(WebCore::Dictionary::get):

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

4 years agoLet SVG images not taint canvases except when containing foreignObjects
commit-queue@webkit.org [Tue, 26 Jan 2016 21:19:12 +0000 (21:19 +0000)]
Let SVG images not taint canvases except when containing foreignObjects
https://bugs.webkit.org/show_bug.cgi?id=119639

Patch by Philip Rogers <pdr@chromium.org> on 2016-01-26
Reviewed by Brent Fulgham.

Source/WebCore:

r153876 caused SVG images to not taint canvases but the patch allowed
for subimage resources. This can be a problem if a subimage (e.g., data
uri image) contains a foreignObject which can violate security (e.g.,
visited links).

This patch updates SVGImage::hasSingleSecurityOrigin to check if the
image contains any foreignObjects or images that themselves contain
foreignObjects. SVG images without foreignObjects are allowed to not
taint canvases.

Canvas patterns are problematic because an animated SVG image can switch
between tainting and not tainting the canvas. A FIXME has been added to
solve this, and in the meantime we cause SVG images to taint patterns.

Tests: svg/as-image/svg-canvas-pattern-with-link-tainted.html
       svg/as-image/svg-canvas-svg-with-feimage-with-link-tainted.html
       svg/as-image/svg-canvas-svg-with-image-with-link-tainted.html

* html/canvas/CanvasPattern.cpp:
(WebCore::CanvasPattern::CanvasPattern):
(WebCore::CanvasPattern::~CanvasPattern):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::~SVGFEImageElement):
(WebCore::SVGFEImageElement::hasSingleSecurityOrigin):
(WebCore::SVGFEImageElement::clearResourceReferences):
* svg/SVGFEImageElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::create):
(WebCore::SVGImageElement::hasSingleSecurityOrigin):
(WebCore::SVGImageElement::isSupportedAttribute):
* svg/SVGImageElement.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::hasSingleSecurityOrigin):

LayoutTests:

* svg/as-image/resources/svg-with-feimage-with-link.svg: Added.
* svg/as-image/resources/svg-with-image-with-link.svg: Added.
* svg/as-image/svg-canvas-pattern-with-link-tainted-expected.txt: Added.
* svg/as-image/svg-canvas-pattern-with-link-tainted.html: Added.
* svg/as-image/svg-canvas-svg-with-feimage-with-link-tainted-expected.txt: Added.
* svg/as-image/svg-canvas-svg-with-feimage-with-link-tainted.html: Added.
* svg/as-image/svg-canvas-svg-with-image-with-link-tainted-expected.txt: Added.
* svg/as-image/svg-canvas-svg-with-image-with-link-tainted.html: Added.

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

4 years ago[webkitdirs] isCMakeBuild should be true by default
commit-queue@webkit.org [Tue, 26 Jan 2016 21:14:33 +0000 (21:14 +0000)]
[webkitdirs] isCMakeBuild should be true by default
https://bugs.webkit.org/show_bug.cgi?id=153497

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-01-26
Reviewed by Michael Catanzaro.

* Scripts/webkitdirs.pm:
(isCMakeBuild):

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

4 years agoCSSGrammar.y:1742.31-34: warning: unused value: $3
mcatanzaro@igalia.com [Tue, 26 Jan 2016 21:12:31 +0000 (21:12 +0000)]
CSSGrammar.y:1742.31-34: warning: unused value: $3
https://bugs.webkit.org/show_bug.cgi?id=153462

Reviewed by Alex Christensen.

This warning indicates that we have a memory leak. From the bison manual:

"Right-hand side symbols of a rule that explicitly triggers a syntax error via YYERROR are
not discarded automatically. As a rule of thumb, destructors are invoked only when user
actions cannot manage the memory."

Arguably a design error, but that's how it is.

* css/CSSGrammar.y.in:

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

4 years agoBlockPtr needs boolean operators
andersca@apple.com [Tue, 26 Jan 2016 21:09:24 +0000 (21:09 +0000)]
BlockPtr needs boolean operators
https://bugs.webkit.org/show_bug.cgi?id=153506

Reviewed by Tim Horton.

* wtf/BlockPtr.h:

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

4 years agoCalling video.controls=true during a scrub operation cancels scrub.
jer.noble@apple.com [Tue, 26 Jan 2016 20:58:31 +0000 (20:58 +0000)]
Calling video.controls=true during a scrub operation cancels scrub.
https://bugs.webkit.org/show_bug.cgi?id=153494

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-controls-drag-timeline-set-controls-property.html

Verify that the video.controls attribute actually changed before tearing down and
re-adding the media controls to the Shadow DOM.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handleControlsChange):
(Controller.prototype.hasControls):

LayoutTests:

* media/media-controls-drag-timeline-set-controls-property-expected.txt: Added.
* media/media-controls-drag-timeline-set-controls-property.html: Added.

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

4 years ago[EME][Mac] Crash in [AVStreamSession addStreamDataParser:]; uncaught exception
jer.noble@apple.com [Tue, 26 Jan 2016 20:45:58 +0000 (20:45 +0000)]
[EME][Mac] Crash in [AVStreamSession addStreamDataParser:]; uncaught exception
https://bugs.webkit.org/show_bug.cgi?id=153495

Reviewed by Eric Carlson.

When AVContentKeySession is not available, fall back to pre-AVContentKeySession behavior;
namely, immediately create an AVStreamSession object in
willProvideContentKeyRequestInitializationData, rather than waiting for didProvide.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):

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

4 years agoMarking svg/dom/SVGScriptElement/script-change-externalResourcesRequired-while-loadin...
ryanhaddad@apple.com [Tue, 26 Jan 2016 20:30:48 +0000 (20:30 +0000)]
Marking svg/dom/SVGScriptElement/script-change-externalResourcesRequired-while-loading.svg as flaky on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=153498

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years ago[iOS] Documents without an explicit width should not get fast tapping
dino@apple.com [Tue, 26 Jan 2016 20:09:27 +0000 (20:09 +0000)]
[iOS] Documents without an explicit width should not get fast tapping
https://bugs.webkit.org/show_bug.cgi?id=153465
Source/WebCore:

<rdar://problem/23962529>

Reviewed by Simon Fraser (and Wenson Hseih).

As the title says, documents that do not set a viewport should
not get the fast click behaviour. There were complaints that we broke
double-tap to scroll in ImageDocuments where the image was narrow and long.

The fix is to just keep a flag that tells the UI process if the
width was explicit. However, it turns out that those ImageDocuments
are given an explicit device-width, which is fine for scaling but
really should behave as auto for fast tapping. So we also need
to tell the UIProcess if the viewport arguments came from an
ImageDocument.

Test: fast/events/ios/viewport-no-width-value-allows-double-tap.html

* dom/ViewportArguments.cpp:
(WebCore::findSizeValue): Add a parameter that toggles a flag
if the size was explicitly set.
(WebCore::setViewportFeature): Remember if the width was
explicit.
* dom/ViewportArguments.h: Add a widthWasExplicit flag.
(WebCore::ViewportArguments::operator==):

Source/WebKit2:

<rdar://problem/23962529>

Reviewed by Simon Fraser (and Wenson Hseih).

As the title says, documents that do not set a viewport should
not get the fast click behaviour. There were complaints that we broke
double-tap to scroll in ImageDocuments where the image was narrow and long.

The fix is to just keep a flag that tells the UI process if the
width was explicit. However, it turns out that those ImageDocuments
are given an explicit device-width, which is fine for scaling but
really should behave as auto for fast tapping. So we also need
to tell the UIProcess if the viewport arguments came from an
ImageDocument.

* Shared/mac/RemoteLayerTreeTransaction.h: Add two new flags into
the transaction.
(WebKit::RemoteLayerTreeTransaction::viewportMetaTagWidthWasExplicit):
(WebKit::RemoteLayerTreeTransaction::setViewportMetaTagWidthWasExplicit):
(WebKit::RemoteLayerTreeTransaction::viewportMetaTagCameFromImageDocument):
(WebKit::RemoteLayerTreeTransaction::setViewportMetaTagCameFromImageDocument):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::description):

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]): Notice whether or not the viewport
width was explicit.
(-[WKWebView _allowsDoubleTapGestures]): Return yes if the width
was not explicit, or if the viewport came from an ImageDocument.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):

LayoutTests:

Reviewed by Simon Fraser (and Wenson Hseih).

* fast/events/ios/thin-gradient.jpg: Added.
* fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt: Added.
* fast/events/ios/viewport-no-width-value-allows-double-tap.html: Added.
* platform/ios-simulator/TestExpectations:

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

4 years agoSpeculative fixes for crashing in viewportChangeAffectedPicture
hyatt@apple.com [Tue, 26 Jan 2016 20:07:07 +0000 (20:07 +0000)]
Speculative fixes for crashing in viewportChangeAffectedPicture
https://bugs.webkit.org/show_bug.cgi?id=153450

Reviewed by Dean Jackson.

Don't attach any conditions to the removal of a picture element from
the document's HashSet. This ensures that if the condition is ever
wrong for any reason, we'll still remove the picture element on
destruction.

Fix the media query evaluation to match the other evaluations (used by
the preload scanner and HTMLImageElement). This includes using the
document element's computed style instead of our own and also null
checking the document element first. This is the likely cause of the
crashes.

* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::~HTMLPictureElement):
(WebCore::HTMLPictureElement::didMoveToNewDocument):
(WebCore::HTMLPictureElement::viewportChangeAffectedPicture):

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

4 years agoMake sure a page is still PageCache-able after firing the 'pagehide' events
cdumez@apple.com [Tue, 26 Jan 2016 19:57:49 +0000 (19:57 +0000)]
Make sure a page is still PageCache-able after firing the 'pagehide' events
https://bugs.webkit.org/show_bug.cgi?id=153449

Reviewed by Andreas Kling.

Make sure a page is still PageCache-able after firing the 'pagehide'
events and abort if it isn't. This should improve robustness and it is
easy for pagehide event handlers to do things that would make a Page no
longer PageCache-able and this leads to bugs that are difficult to
investigate.

To achieve this, the 'pagehide' event firing logic was moved out of the
CachedFrame constructor. It now happens earlier in
PageCache::addIfCacheable() after checking if the page is cacheable and
before constructing the CachedPage / CachedFrames. After firing the
'pagehide' event in PageCache::addIfCacheable(), we check again that
the page is still cacheable and we abort early if it is not.

* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
* history/PageCache.cpp:
(WebCore::setInPageCache):
(WebCore::firePageHideEventRecursively):
(WebCore::PageCache::addIfCacheable):
* history/PageCache.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):

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

4 years agoRemove a useless #include
benjamin@webkit.org [Tue, 26 Jan 2016 19:33:38 +0000 (19:33 +0000)]
Remove a useless #include
https://bugs.webkit.org/show_bug.cgi?id=153474

Reviewed by Alexey Proskuryakov.

* b3/B3ReduceStrength.cpp:

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

4 years agoRubber-stamped by Tim Horton.
bdakin@apple.com [Tue, 26 Jan 2016 19:28:32 +0000 (19:28 +0000)]
Rubber-stamped by Tim Horton.

Add one more bit of SPI.
* platform/spi/mac/NSSpellCheckerSPI.h:

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

4 years agoREGRESSION (r194557): Keyboard shortcuts stop working after the WKWebView is unparent...
timothy_horton@apple.com [Tue, 26 Jan 2016 19:12:37 +0000 (19:12 +0000)]
REGRESSION (r194557): Keyboard shortcuts stop working after the WKWebView is unparented and reparented
https://bugs.webkit.org/show_bug.cgi?id=153492
<rdar://problem/24138989>

Reviewed by Dan Bernstein.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canBecomeFirstResponder]):
(-[WKContentView becomeFirstResponder]):
(-[WKContentView resignFirstResponder]):
When WKWebView is unparented, WKContentView will attempt to resignFirstResponder upwards,
first asking WKWebView. After r194557, WKWebView will accept first responder and forward
it on to the WKContentView, which will happily accept it again, despite being the view
that's trying to resign. This will cause us to completely lose first responder,
where it was actually supposed to propagate up above WKWebView to the client.

Keep track of when WKContentView is resigning first responder, and don't
let it become first responder while it is doing so, breaking the cycle.

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

4 years agoFix build with ENABLE_DEVICE_ORIENTATION on non-iOS platforms
commit-queue@webkit.org [Tue, 26 Jan 2016 19:02:40 +0000 (19:02 +0000)]
Fix build with ENABLE_DEVICE_ORIENTATION on non-iOS platforms
https://bugs.webkit.org/show_bug.cgi?id=153490

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-01-26
Reviewed by Michael Catanzaro.

This has been broken since r178702, which changed the Page
argument from a pointer to a reference in logCanCachePageDecision().

No new tests since this is a build fix.

* history/PageCache.cpp:
(WebCore::canCachePage):

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

4 years agoMove WebVideoFullscreenManager and related classes from iOS specific folders to cocoa...
adachan@apple.com [Tue, 26 Jan 2016 18:56:00 +0000 (18:56 +0000)]
Move WebVideoFullscreenManager and related classes from iOS specific folders to cocoa folders
https://bugs.webkit.org/show_bug.cgi?id=153473

Reviewed by Eric Carlson.

Source/WebCore:

No new tests, just moving files.

* WebCore.xcodeproj/project.pbxproj:
Update due to changes to the file locations.
* platform/cocoa/WebVideoFullscreenModel.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModel.h.
* platform/cocoa/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h.
(WebCore::WebVideoFullscreenModelVideoElement::create):
Fix a style error by moving the opening curly brace down one line.
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm.

Source/WebKit2:

* DerivedSources.make:
Add new paths.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm.
(WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
Fix a style error by moving the opening curly brace to the same line as the for statement.
* WebKit2.xcodeproj/project.pbxproj:
Update due to changes to the file locations.
* WebProcess/cocoa/WebVideoFullscreenManager.h: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h.
* WebProcess/cocoa/WebVideoFullscreenManager.messages.in: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in.
* WebProcess/cocoa/WebVideoFullscreenManager.mm: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm.
(WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
Fix a style error by adding a missing space after a comma.

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

4 years agoSkipping fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html on...
ryanhaddad@apple.com [Tue, 26 Jan 2016 18:46:44 +0000 (18:46 +0000)]
Skipping fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=138468

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoMarking inspector/codemirror/prettyprinting-css-rules.html as flaky on mac-wk1 debug
ryanhaddad@apple.com [Tue, 26 Jan 2016 18:46:42 +0000 (18:46 +0000)]
Marking inspector/codemirror/prettyprinting-css-rules.html as flaky on mac-wk1 debug
https://bugs.webkit.org/show_bug.cgi?id=153460

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

4 years agoAdd WebKitSystemInterface for iOS 9.2
dbates@webkit.org [Tue, 26 Jan 2016 18:40:25 +0000 (18:40 +0000)]
Add WebKitSystemInterface for iOS 9.2
https://bugs.webkit.org/show_bug.cgi?id=153355

Rubber-stamped by David Kilzer.

Tools:

* Scripts/copy-webkitlibraries-to-product-directory:

WebKitLibraries:

* WebKitSystemInterface.h:
* WebKitSystemInterfaceIOS.h: Removed.
* libWebKitSystemInterfaceIOSDevice9.2.a: Added.
* libWebKitSystemInterfaceIOSSimulator9.2.a: Added.

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

4 years agoDo not convert GlyphBufferAdvance to FloatSize
commit-queue@webkit.org [Tue, 26 Jan 2016 18:37:37 +0000 (18:37 +0000)]
Do not convert GlyphBufferAdvance to FloatSize
https://bugs.webkit.org/show_bug.cgi?id=153429

GlyphBufferAdvance is not necessaryly convertible to FloatSize.
Also, this code was doing extra work by transforming height value.

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-01-26
Reviewed by Antti Koivisto.

No new tests needed.

* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGGlyphToPathTranslator::extents):

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

4 years agoEnable API related to the video fullscreen layer in MediaPlayerPrivateAVFoundationObjC
adachan@apple.com [Tue, 26 Jan 2016 18:35:36 +0000 (18:35 +0000)]
Enable API related to the video fullscreen layer in MediaPlayerPrivateAVFoundationObjC
also on Mac with video presentation mode support.
https://bugs.webkit.org/show_bug.cgi?id=153222

Reviewed by Eric Carlson.

No new tests. Covered by existing tests.

Introduce VideoFullscreenLayerManager to deal with the video layer when switching
between inline and fullscreen mode. We'll reuse it in other MediaPlayerPrivateInterface
implementations.

Now that MediaPlayerPrivateAVFoundationObjC's platform layer can be a WebVideoContainerLayer,
this exposes a bug in PlatformCALayerCocoa::clone() where we assumed the platform layer
is always an AVPlayerLayer if the PlatformCALayer's layer type is LayerTypeAVPlayerLayer.
Add a helper method to get an AVPlayerLayer from a PlatformCALayerCocoa (which also handles
WebVideoContainerLayer case) and use it in PlatformCALayerCocoa::clone().

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

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
Create m_videoFullscreenLayerManager. The video inline layer, video fullscreen layer,
and the video fullscreen frame are now managed by that class.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
Just call VideoFullscreenLayerManager::setVideoLayer() to handle adding the video
layer in either the inline or fullscreen layer.
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
Call VideoFullscreenLayerManager::didDestroyVideoLayer().
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer):
Get the video inline layer from VideoFullscreenLayerManager.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
Call VideoFullscreenLayerManager::setVideoFullscreenLayer().
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
Call VideoFullscreenLayerManager::setVideoFullscreenFrame().
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
Guard the iOS specific code properly.
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
Get the video fullscreen layer from VideoFullscreenLayerManager.
(WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation):
Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
Get the video fullscreen layer and video fullscreen frame from VideoFullscreenLayerManager.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
Get the video fullscreen layer from VideoFullscreenLayerManager.

* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: Added.
(WebCore::VideoFullscreenLayerManager::videoInlineLayer):
(WebCore::VideoFullscreenLayerManager::videoFullscreenLayer):
(WebCore::VideoFullscreenLayerManager::videoFullscreenFrame):
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: Added.
(-[WebVideoContainerLayer setBounds:]):
(-[WebVideoContainerLayer setPosition:]):
WebVideoContainerLayer was moved from MediaPlayerPrivateAVFoundationObjC.mm.
(WebCore::VideoFullscreenLayerManager::create):
(WebCore::VideoFullscreenLayerManager::VideoFullscreenLayerManager):
(WebCore::VideoFullscreenLayerManager::setVideoLayer):
Code moved from MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer().
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
Code moved from MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer().
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenFrame):
Code moved from MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame().
(WebCore::VideoFullscreenLayerManager::didDestroyVideoLayer):
Code moved from MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer().

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::clone):
Use the new PlatformCALayerCocoa::avPlayerLayer() method to get the AVPlayerLayer from both the
destination and source PlatformCALayers.
(PlatformCALayerCocoa::avPlayerLayer):
Return nil if the layer type is not LayerTypeAVPlayerLayer. Otherwise, return the
platform layer if it is indeed an AVPlayerLayer. If not, it should be a WebVideoContainerLayer
and we should return its sublayer which should be an AVPlayerLayer.

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

4 years agoFirst parameter to window.showModalDialog() should be mandatory
cdumez@apple.com [Tue, 26 Jan 2016 18:04:26 +0000 (18:04 +0000)]
First parameter to window.showModalDialog() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=153436

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Drop temporary WebKit workaround in html/dom/interfaces.html
imported W3C test. This test would previously time out without
the workaround but this is fixed now.

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

Source/WebCore:

Make window.showModalDialog()'s first parameter mandatory to match the
last specification containing it:
http://dev.w3.org/html5/spec-preview/user-prompts.html#dialogs-implemented-using-separate-documents

The new behavior also matches Firefox, while Chrome no longer supports
this operation.

With this change, the W3C HTML test suite no longer hangs in the middle
because it mistakenly pops up a modal dialog during testing.

Test: fast/dom/Window/showModalDialog-mandatory-parameter.html

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::showModalDialog):

LayoutTests:

* fast/dom/Window/showModalDialog-mandatory-parameter-expected.txt: Added.
* fast/dom/Window/showModalDialog-mandatory-parameter.html: Added.
Add layout test to check that showModalDialog()'s first parameter is indeed
mandatory.

* fast/dom/null-page-show-modal-dialog-crash.html:
Update existing test now that showModalDialog()'s first parameter is
mandatory.

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

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

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

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

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

Reviewed by Daniel Bates.

Source/WebCore:

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

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

LayoutTests:

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

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

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

Reviewed by Michael Catanzaro.

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

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

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

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

Reviewed by Alexey Proskuryakov.

Source/WebCore:

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

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

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

LayoutTests:

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

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

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

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

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

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

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

Tools:

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

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

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

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

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

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

Source/WebCore:

Inspired by a patch by Erik Arvidsson.

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

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

LayoutTests:

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

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

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

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

Reviewed by Csaba Osztrogonác.

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

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

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

Reviewed by Michael Catanzaro.

Source/WebKit2:

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

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

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

LayoutTests:

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

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

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

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

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

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

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

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

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

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

Source/WTF:

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

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

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

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

Reviewed by Alex Christensen.

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

No change in behavior.

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

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

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

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

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

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

LayoutTests:

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

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

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

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

.:

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

Source/WebCore:

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

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

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

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

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

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

Source/WebInspectorUI:

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

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

LayoutTests:

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

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

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

Reviewed by Zalan Bujtas.

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

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

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

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

Reviewed by Darin Adler.

Tools:

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

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

LayoutTests:

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

* fast/harness/results.html:

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

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

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

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

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

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

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

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

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

* rendering/style/RenderStyle.h:

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

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

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

Reverted changeset:

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

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

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

Reviewed by Geoffrey Garen.

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

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

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

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

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

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

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

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

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

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

Reviewed by Tim Horton.

Source/WebCore:

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

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

Source/WebKit2:

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

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

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

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

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

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

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

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

Reviewed by Simon Fraser.

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

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

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

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

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

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

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

Reviewed by Joseph Pecoraro.

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

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

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

* platform/spi/cocoa/DataDetectorsCoreSPI.h:

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

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

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

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

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

* dfg/DFGCommon.h:

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

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

Rubber stamped by Geoffrey Garen.

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

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

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

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

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

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

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

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

* dfg/DFGCommon.h:

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

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

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

Reverted changeset:

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

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

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

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

Reviewed by Andreas Kling.

Replace directionSetOnDocumentElement/writingModeSetOnDocumentElement document flags them with style flags.

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

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

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

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

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

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

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

Reverted changeset:

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

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

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

Reviewed by Alexey Proskuryakov.

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

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

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

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

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

Reviewed by Antti Koivisto.

Enable speculative revalidation to better evaluate performance and
robustness.

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

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

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

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

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

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

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

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

Reviewed by Tim Horton.

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

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

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

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

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

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

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

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

Rubber-stamped by Geoffrey Garen.

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

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

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

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

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

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

Reviewed by Gavin Barraclough.

This fixes two performance bugs and one disassembler bug.

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

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

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

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

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

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

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

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

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

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

Reviewed by Darin Adler.

Source/WebCore:

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

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

Source/WebKit2:

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

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

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

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

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

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

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

Reviewed by Brent Fulgham.

Source/JavaScriptCore:

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WebCore:

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WebKit:

* PlatformWin.cmake:

Source/WTF:

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

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

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

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

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

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