WebKit-https.git
4 years agoMark failing reftests as such, now that we detect reftest failures.
ap@apple.com [Sat, 27 Feb 2016 20:20:58 +0000 (20:20 +0000)]
Mark failing reftests as such, now that we detect reftest failures.

* platform/ios-simulator/TestExpectations:

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

4 years agoREGRESSION(r195795): [WK2] fast/text/crash-complex-text-surrogate.html is flakey
ap@apple.com [Sat, 27 Feb 2016 20:01:02 +0000 (20:01 +0000)]
REGRESSION(r195795): [WK2] fast/text/crash-complex-text-surrogate.html is flakey
https://bugs.webkit.org/show_bug.cgi?id=154709

The test has been made made non-flaky, but it also needs new results.

* platform/mac/fast/text/crash-complex-text-surrogate-expected.txt:

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

4 years agoCLoop build fix.
oliver@apple.com [Sat, 27 Feb 2016 19:28:25 +0000 (19:28 +0000)]
CLoop build fix.

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

4 years agoOptimize parseHTMLInteger()
cdumez@apple.com [Sat, 27 Feb 2016 18:30:58 +0000 (18:30 +0000)]
Optimize parseHTMLInteger()
https://bugs.webkit.org/show_bug.cgi?id=154772

Reviewed by Ryosuke Niwa.

Optimize parseHTMLInteger() a bit now that it is used a lot more and
that it has decent API test coverage. In particular, we now:
- Avoid using a StringBuilder for the digits.
- Get rid of a is8Bit() branch.
- Only traverse the input string once.

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLIntegerInternal):
(WebCore::parseHTMLInteger):
(WebCore::parseHTMLNonNegativeInteger): Deleted.

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

4 years ago[iOS] Discard decoded image data on top-level navigation.
akling@apple.com [Sat, 27 Feb 2016 17:49:29 +0000 (17:49 +0000)]
[iOS] Discard decoded image data on top-level navigation.
<https://webkit.org/b/154776>

Reviewed by Anders Carlsson.

Add a mechanism that destroys decoded data for all CachedImages and invoke it
when performing a top-level navigation on iOS.

This substantially reduces the ImageIO contribution to our peak memory footprint.

It would be even better if we could mark these images volatile during the transition
but we currently don't have framework support for such machinations.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::forEachResource):
(WebCore::MemoryCache::destroyDecodedDataForAllImages):
* loader/cache/MemoryCache.h:

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

4 years agoUnreviewed. Fix GTK+ clean build.
carlosgc@webkit.org [Sat, 27 Feb 2016 07:45:36 +0000 (07:45 +0000)]
Unreviewed. Fix GTK+ clean build.

Add missing header include.

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:

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

4 years agoWeb Inspector: Increase clickable area of the console prompt
nvasilyev@apple.com [Sat, 27 Feb 2016 07:44:29 +0000 (07:44 +0000)]
Web Inspector: Increase clickable area of the console prompt
https://bugs.webkit.org/show_bug.cgi?id=154719
<rdar://problem/24854538>

Reviewed by Timothy Hatcher.

Clicking on the area around CodeMirror element now moves
focus to the console prompt.

* UserInterface/Views/QuickConsole.js:
(WebInspector.QuickConsole.prototype._handleMouseDown):
Only capture mousedown events on .quick-console.
Don't capture clicks on CodeMirror.

* UserInterface/Views/QuickConsole.css:
(.quick-console > .console-prompt):
(.quick-console > .console-prompt > .CodeMirror):
Make sure .console-prompt is never an event.target for _handleMouseDown.

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

4 years agoNetwork cache: old pages returned by disk cache on history navigation after session...
carlosgc@webkit.org [Sat, 27 Feb 2016 07:44:07 +0000 (07:44 +0000)]
Network cache: old pages returned by disk cache on history navigation after session is restored
https://bugs.webkit.org/show_bug.cgi?id=153230

Reviewed by Chris Dumez.

Source/WebCore:

Add a flag to HistoryItem to mark them as restored from session
and use it from the FrameLoader to not change the policy request
when navigating to a history item that was restored from session,
except for iOS port.

* history/HistoryItem.h:
(WebCore::HistoryItem::setWasRestoredFromSession):
(WebCore::HistoryItem::wasRestoredFromSession):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):

Source/WebKit2:

Since r181734, the network cache never revalidates resources for
history navigation. This is good for the memory cache, but in the
case of disk cache, we might end up with outdated pages when
restoring the session. When restoring the session happens because
of an API request (we also restore the session when recovering
from a web process crash), we should revalidate back forward list
requests in the disk cache if needed. This will only happen the
first time they are loaded after a session restore. After a web process
crash, resources will be used uncondionally from the disk cache.

* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::addItemFromUIProcess): Use Ref&&
instead of PassRefPtr.
* WebProcess/WebPage/WebBackForwardListProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WePage::WebPage): Call restoreSessionInternal passing
No as restoredByAPIRequest parameter.
(WebKit::WebPage::restoreSessionInternal): Set restoredFromSession
flag to the created HistoryItem if the item was restored from
session by an API request.
(WebKit::WebPage::restoreSession): Call restoreSessionInternal
passing Yes as restoredByAPIRequest parameter.
* WebProcess/WebPage/WebPage.h:

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

4 years agoWeb Inspector: Remove unused member variables from overview graphs
commit-queue@webkit.org [Sat, 27 Feb 2016 07:26:09 +0000 (07:26 +0000)]
Web Inspector: Remove unused member variables from overview graphs
https://bugs.webkit.org/show_bug.cgi?id=154774

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

* UserInterface/Views/LayoutTimelineOverviewGraph.js:
(WebInspector.LayoutTimelineOverviewGraph.prototype.reset):
* UserInterface/Views/ScriptTimelineOverviewGraph.js:
(WebInspector.ScriptTimelineOverviewGraph.prototype.reset):

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

4 years agoREGRESSION (r196741): Web Inspector: Bottom section of Layers sidebar is 1px shorter...
nvasilyev@apple.com [Sat, 27 Feb 2016 07:17:53 +0000 (07:17 +0000)]
REGRESSION (r196741): Web Inspector: Bottom section of Layers sidebar is 1px shorter than the console prompt
https://bugs.webkit.org/show_bug.cgi?id=154773
<rdar://problem/24873345>

Reviewed by Timothy Hatcher.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.css:
(.sidebar > .panel.details.layer-tree > .content):
(.panel.details.layer-tree .bottom-bar):

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

4 years ago[GTK] Fix incorrect cast
mcatanzaro@igalia.com [Sat, 27 Feb 2016 06:19:08 +0000 (06:19 +0000)]
[GTK] Fix incorrect cast

Unreviewed.

* MiniBrowser/gtk/main.c:
(createBrowserWindow):

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

4 years agoRemove unused private field from WEBPImageDecoder
mcatanzaro@igalia.com [Sat, 27 Feb 2016 06:16:42 +0000 (06:16 +0000)]
Remove unused private field from WEBPImageDecoder

Unreviewed.

* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::WEBPImageDecoder):
* platform/image-decoders/webp/WEBPImageDecoder.h:

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

4 years agoFix a typo.
mcatanzaro@igalia.com [Sat, 27 Feb 2016 06:11:59 +0000 (06:11 +0000)]
Fix a typo.

Unreviewed. Shame I didn't notice in the previous commit.

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::removeUserContentWorld):

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

4 years agoFix GTK and maybe EFL build after r197172.
mcatanzaro@igalia.com [Sat, 27 Feb 2016 06:09:55 +0000 (06:09 +0000)]
Fix GTK and maybe EFL build after r197172.

Unreviewed.

* CMakeLists.txt:
* UIProcess/API/gtk/WebKitUserContent.cpp:
(_WebKitUserScript::_WebKitUserScript):
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::removeUserContentWorld):
(WebKit::WebUserContentController::addUserScripts):
(WebKit::WebUserContentController::removeUserScript):
(WebKit::WebUserContentController::removeAllUserScripts):

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

4 years agoFix the behavior of reflecting IDL attributes of type unsigned long
cdumez@apple.com [Sat, 27 Feb 2016 06:09:37 +0000 (06:09 +0000)]
Fix the behavior of reflecting IDL attributes of type unsigned long
https://bugs.webkit.org/show_bug.cgi?id=154771

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:
* web-platform-tests/html/dom/reflection-obsolete-expected.txt:

Source/WebCore:

Fix the behavior of reflecting IDL attributes of type unsigned long to
align with the specification:
- https://html.spec.whatwg.org/multipage/infrastructure.html#reflecting-content-attributes-in-idl-attributes
- https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers

Firefox and Chrome already follow the specification.

There were several issues with our implementation, which are all
addressed in this patch:
- Upon getting, the value returned must be in the range 0 to 2147483647.
  Otherwise, we must return the default value (0 unless specified
  otherwise). We previously returned values in the range 0 to 4294967295
  instead.
- Upon setting, we must set the content attribute to the default value
  (0 unless specified otherwise) if the input value is not in the range
  0 to 2147483647. We previously allowed values in the range 0 to
  4294967295 instead.
- "-0" was not recognized as a valid unsigned integer

Test: fast/dom/reflect-unsigned-long.html

* dom/Element.cpp:
(WebCore::Element::setUnsignedIntegralAttribute):
Update setUnsignedIntegralAttribute() to limit the input value in the
0 to 2147483647 range, as per the HTML specification. This method is
called by the bindings implementation of reflecting attributes setters.

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLNonNegativeInteger):
Update parseHTMLNonNegativeInteger() to call parseHTMLInteger() instead
of duplicating most of its code and fail if the value returned is
negative. This matches the algorithm in the specification:
- https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers

This has 2 behavior changes:
1. "-0" is now correctly parsed as 0.
2. The returned values are in the range 0 to 2147483647.

* html/parser/HTMLParserIdioms.h:
(WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
(WebCore::limitToOnlyHTMLNonNegative):
Drop the checks for "<= 2147483647" and replace with an assertion
now that parseHTMLNonNegativeInteger() already returned values in
the right range.

Tools:

Update API tests to cover the fixes to the parseHTMLNonNegativeInteger()
implementation:
- "-0" is parsed as 0.
- Range boundaries are now [0; 2147483647].

* TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:
(TestWebKitAPI::TEST):

LayoutTests:

Add test coverage for the behavior of reflecting IDL attributes of type
unsigned long.

* fast/dom/reflect-unsigned-long-expected.txt: Added.
* fast/dom/reflect-unsigned-long.html: Added.

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

4 years ago[GTK] Fix order of parameters in gtkdoc for webkit_web_view_get_snapshot
mcatanzaro@igalia.com [Sat, 27 Feb 2016 05:51:22 +0000 (05:51 +0000)]
[GTK] Fix order of parameters in gtkdoc for webkit_web_view_get_snapshot

Unreviewed.

* UIProcess/API/gtk/WebKitWebView.cpp:

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

4 years agoWeb Inspector: Custom transition bezier curve editor preview should loop when not...
commit-queue@webkit.org [Sat, 27 Feb 2016 05:40:51 +0000 (05:40 +0000)]
Web Inspector: Custom transition bezier curve editor preview should loop when not editing curve
https://bugs.webkit.org/show_bug.cgi?id=154738
<rdar://problem/24861563>

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-26
Reviewed by Timothy Hatcher.

Added extra frames to bezier preview animation to allow it to infinitely
repeat without being jarring to watch.

* UserInterface/Views/BezierEditor.css:
(.bezier-editor > .bezier-preview-timing.animate):
(@keyframes bezierPreview):
* UserInterface/Views/BezierEditor.js:

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

4 years agoREGRESSION (188611): Search field Cancel button should not overlap search text on...
zalan@apple.com [Sat, 27 Feb 2016 05:11:09 +0000 (05:11 +0000)]
REGRESSION (188611): Search field Cancel button should not overlap search text on extensions page.
https://bugs.webkit.org/show_bug.cgi?id=154692
<rdar://problem/22840453>

Reviewed by Brent Fulgham.

Adjust the cancel button position using the actual size of the cancel button.

When the input box and the font height trigger different cancel button sizes, we need to readjust
the rectangle returned by cancelButtonRectForBounds.
This fixes both the mispositioned cancel button and the squared off icon when the input field is zoomed all the way in.

Source/WebCore:

Covered by existing tests.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::cancelButtonSizes): Update button size.

LayoutTests:

* fast/forms/search/search-padding-cancel-results-buttons-expected.txt:
* platform/mac/fast/css/focus-ring-exists-for-search-field-expected.txt:
* platform/mac/fast/css/text-input-with-webkit-border-radius-expected.txt:
* platform/mac/fast/css/text-overflow-input-expected.txt:
* platform/mac/fast/forms/box-shadow-override-expected.txt:
* platform/mac/fast/forms/control-restrict-line-height-expected.txt:
* platform/mac/fast/forms/input-appearance-height-expected.txt:
* platform/mac/fast/forms/placeholder-position-expected.txt:
* platform/mac/fast/forms/placeholder-pseudo-style-expected.txt:
* platform/mac/fast/forms/search-cancel-button-style-sharing-expected.txt:
* platform/mac/fast/forms/search-display-none-cancel-button-expected.txt:
* platform/mac/fast/forms/search-rtl-expected.txt:
* platform/mac/fast/forms/search-styled-expected.txt:
* platform/mac/fast/forms/search-vertical-alignment-expected.txt:
* platform/mac/fast/forms/search/search-size-with-decorations-expected.txt:
* platform/mac/fast/forms/searchfield-heights-expected.txt:
* platform/mac/fast/repaint/search-field-cancel-expected.txt:
* platform/mac/fast/replaced/width100percent-searchfield-expected.txt:

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

4 years agoWeb Inspector: Keyboard controls to nudge control points in custom transition bezier...
commit-queue@webkit.org [Sat, 27 Feb 2016 04:54:36 +0000 (04:54 +0000)]
Web Inspector: Keyboard controls to nudge control points in custom transition bezier curve editor would be nice
https://bugs.webkit.org/show_bug.cgi?id=154739
<rdar://problem/24861498>

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-26
Reviewed by Timothy Hatcher.

Adds ability for user to nudge the most recently selected bezier control
handle by using the arrow keys. Also makes the currently selected bezier
control line snap to an axis, which is defined when the user mouses down,
whenever the mouse is dragged while the shift key is pressed.

* UserInterface/Views/BezierEditor.js:
(WebInspector.BezierEditor):
(WebInspector.BezierEditor.prototype.handleKeydownEvent):
(WebInspector.BezierEditor.prototype._handleMouseup):
(WebInspector.BezierEditor.prototype._updateControlPointsForMouseEvent):

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

4 years agoAddress Dean's comments in 154673.
jonlee@apple.com [Sat, 27 Feb 2016 04:43:57 +0000 (04:43 +0000)]
Address Dean's comments in 154673.

* Animometer/developer.html:
* Animometer/resources/debug-runner/animometer.js:
* Animometer/resources/debug-runner/graph.js:

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

4 years agoModern IDB: New database versions are never committed to SQLite.
beidson@apple.com [Sat, 27 Feb 2016 04:39:05 +0000 (04:39 +0000)]
Modern IDB: New database versions are never committed to SQLite.
<rdar://problem/24860952> and https://bugs.webkit.org/show_bug.cgi?id=154741

Modern IDB: If a database handle is not open, files are not actually deleted from disk
https://bugs.webkit.org/show_bug.cgi?id=154756

Reviewed by Alex Christensen.

Source/WebCore:

Tested by API test "IndexedDBPersistence"

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::deleteDatabase): If there's not an open handle to the database, create one.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction): If a version change transaction, actually
  set the new version on disk.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
(WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore): If there is no open backing store, create one.
  This is necessary to both read the current database version, and to actually delete the file on disk.
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): If necessary, manufacture a "most recently
  deleted database info" from the version returned by deleteBackingStore.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

Source/WebKit2:

Add WK2 SPI to force termination of the database process.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateDatabaseProcess]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::terminateDatabaseProcess):
* UIProcess/WebProcessPool.h:

Tools:

This also happens to test the previously untested fix for http://trac.webkit.org/changeset/197190

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBPersistence-1.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBPersistence-2.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBPersistence.mm: Added.
(-[IndexedDBNavigationDelegate webView:didFinishNavigation:]):
(-[IndexedDBMessageHandler userContentController:didReceiveScriptMessage:]):
(TEST):

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

4 years agoUpdate animation benchmark and tests
jonlee@apple.com [Sat, 27 Feb 2016 04:33:30 +0000 (04:33 +0000)]
Update animation benchmark and tests
https://bugs.webkit.org/show_bug.cgi?id=154673

Reviewed by Dean Jackson.

Update test visuals.

* Animometer/tests/master/resources/canvas-tests.js:
(CanvasLineSegment.Utilities.createClass): Line segments near the edge of the stage get clipped.
Update circle position and radius to minimize impact.
* Animometer/tests/master/resources/particles.js: Get rid of rotating gradient background, and
have 3 locations for emitting particles.
* Animometer/tests/master/resources/multiply.js: Update distance metric so that fringe tiles get
more color.
(initialize): Fix some of the math for laying out the tiles.
(animate): When a tile isn't used, set visibility: hidden.

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

4 years agoUpdate animation benchmark and tests
jonlee@apple.com [Sat, 27 Feb 2016 04:32:09 +0000 (04:32 +0000)]
Update animation benchmark and tests
https://bugs.webkit.org/show_bug.cgi?id=154673

Reviewed by Dean Jackson.

Update the ramp controller.

The controller refines the complexity interval to test across.

* Animometer/resources/statistics.js: Add functions that estimate cumulative distribution function.
(Regression): For the flat regression, force the first segment to be at 60 fps.
(valueAt): Add convenience function to return interpolated value based on the regression used.
(_calculateRegression): Include the number of points included for both segments, and the piecewise
errors.
* Animometer/tests/resources/math.js: Make the Kalman estimator subclass Experiment, and allow it
to be reset.

* Animometer/tests/resources/main.js: Initialize the tier such that it starts at 10^0 = 1.
Increase the number of ramps. Maintain three FPS thresholds-- the frame rate of interest, a limit
on the lowest FPS we care to go for later interpolation, and a minimum FPS threshold we want to
aim for each ramp. Also keep three estimators: a running average of the change point, a minimum
boundary for each ramp, and an estimator for all the frames within an interval. The first two
are used to determine the parameters of the next ramp, and the latter allows us to refine the
parameters.
(update): During the tier phase, it is possible that the highest complexity possible for a test
won't stress the system enough to trigger stopping the tier phase and transitioning to the ramps.
If the complexity doesn't change when going to the next tier, we've maxed the test out, and move
on. When the tier phase completed, turn off Controller.frameLengthEstimator, which estimates the
FPS at each tier.
(tune): At each interval, look at the confidence distribution of being on the 60 FPS side or the
slow side. If the slowest FPS we achieve at the ramp's maximum complexity is not at least
_fpsRampSlowThreshold, then increase the maximum complexity. If we ever achieve 60 FPS, increase
the ramp's minimum complexity to that level. If, at an even lower complexity, a glitch causes the
FPS to drop, we reset the minimum complexity.

Have the bootstrap calculation occur between tests. Clean up harness.

* Animometer/resources/debug-runner/animometer.js: Run bootstrap after a test has
completed to avoid doing all of it at the end before showing the results. Clean up
parameters being passed around.
* Animometer/resources/debug-runner/tests.js:
(text):
* Animometer/resources/runner/animometer.js:
(this._processData.calculateScore): Save the results to the same object holding the data.
(this._processData._processData): In the case where a file is dragged, calculate the score
serially. Grab the results object and move it to the results variable and remove it from
the data object. This avoids serializing the results into the JSON.
(this._processData.findRegression): Include the samples used for bootstrapping. Reduce the
resample size to shorten the wait.
* Animometer/resources/runner/benchmark-runner.js:
* Animometer/resources/statistics.js:
(bootstrap): Update how bootstrapData is sorted. In some regression results the mix of
floats and integers causes an alphabetical sort to occur.
* Animometer/resources/strings.js:

Add meta charset so that encodings between harness and test match.

* Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
* Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
* Animometer/tests/bouncing-particles/bouncing-css-images.html:
* Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
* Animometer/tests/bouncing-particles/bouncing-svg-images.html:
* Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
* Animometer/tests/master/canvas-stage.html:
* Animometer/tests/master/focus.html:
* Animometer/tests/master/image-data.html:
* Animometer/tests/master/multiply.html:
* Animometer/tests/master/particles.html:
* Animometer/tests/misc/canvas-electrons.html:
* Animometer/tests/misc/canvas-stars.html:
* Animometer/tests/misc/compositing-transforms.html:
* Animometer/tests/simple/simple-canvas-paths.html:
* Animometer/tests/simple/tiled-canvas-image.html:
* Animometer/tests/template/template-canvas.html:
* Animometer/tests/template/template-css.html:
* Animometer/tests/template/template-svg.html:
* Animometer/tests/text/layering-text.html:
* Animometer/tests/text/text-boxes.html:

Update test harness reporting.

* Animometer/developer.html: Add missing meta charset.
* Animometer/index.html: Remove unnecessary utf-8 declaration.
* Animometer/resources/debug-runner/animometer.css: Add convenience classes for
formatting the results table.
* Animometer/resources/debug-runner/animometer.js: Adjust which stats are shown.
* Animometer/resources/debug-runner/tests.js: Display bootstrapping statistics.
* Animometer/resources/strings.js: Move strings not used by the release harness.

Switch to a pseudo-random number generator.

* Animometer/resources/statistics.js: Add a Pseudo class, with a simple
pseudo-random number generator.
(_calculateRegression): Reset the generator before running bootstrap.
(bootstrap): Deleted.

Replace Math.random with Pseudo.random.
* Animometer/tests/master/resources/canvas-tests.js:
* Animometer/tests/master/resources/focus.js:
* Animometer/tests/master/resources/particles.js:
* Animometer/tests/resources/main.js:

Use bootstrapping to get confidence interval in the breakpoint.

For the ramp controller, calculate the piecewise regression, and then use
bootstrapping in order to find the 95% confidence interval. Use the raw data.

* Animometer/developer.html: Default to the complexity graph. Add a legend
checkbox to toggle visibility of the bootstrap score and histogram.
* Animometer/resources/debug-runner/animometer.css: Make some more space to show
the old raw and average scores in the legend. Add new styles for the data.
* Animometer/resources/debug-runner/graph.js:
(_addRegressionLine): Allow passing an array for the variance bar tied to the
regression line. Now |stdev| is |range|.
(createComplexityGraph): Add bootstrap median, and overlay a histogram of
the bootstrap samples. Switch raw samples from circles to X's.
(onComplexityGraphOptionsChanged): Allow toggling of the bootstrap data.
(onGraphTypeChanged): Move the regressions for the raw and average samples to the
legend. In the subtitle use the bootstrap median, and include the 95% confidence
interval.
* Animometer/resources/runner/animometer.js:
(this._processData.findRegression): Factor out the code that determines which
samples to include when calculating the piecewise regression. For series that have
many samples, or a wider range of recorded complexities, throw away the 2.5%
lowest and highest samples before calculating the regression. Keep all samples
if the number of samples to regress is small or the range of complexities is
narrow.
(this._processData._calculateScore): Factor out regression calculation to
findRegression(). Bootstrap the change point of the regression. The score is the
median.
* Animometer/resources/statistics.js:
(_calculateRegression): Correct an issue in the calculation of the regression, where
the denominator can be 0.
(bootstrap): Template for bootstrapping. Create a bootstrap sample array, Create
re-samples by random selection with replacement. Return the 95% confidence samples,
the bootstrap median, mean, and the data itself.
* Animometer/resources/strings.js: Add bootstrap.
* Animometer/tests/resources/main.js:
(processSamples): Don't prematurely cut the sample data.

Fix graph drawing.

* Animometer/resources/debug-runner/animometer.js: Add spacing in the JSON output.
Multiple tests output a lot of JSON and can hang when selecting JSON with no whitespace.
* Animometer/resources/debug-runner/animometer.css:
(#complexity-graph .series.raw circle): Update the color.
* Animometer/resources/debug-runner/graph.js: Use the FPS axis instead of the
complexity axis, which can vary in domain. For determining the complexity domain,
only use samples after samplingTimeOffset.

Allow dropping results JSON.

* Animometer/developer.html: Add a button.
* Animometer/resources/debug-runner/animometer.css:
* Animometer/resources/debug-runner/animometer.js: Read the data and go straight
to the dashboard. With JSON output, write out only the options and the raw data.

Teach the harness to evaluate the samples and determine the test score.

This will allow us to update how the score is calculated separately from the samples recorded.
This also prepares the harness to be able to accept JSON of prior runs.

* Animometer/resources/strings.js: Clean up and remove unneeded strings and reduce some of the
hierarchy.
* Animometer/resources/debug-runner/tests.js: Update to use the new strings.

* Animometer/tests/resources/main.js: Allow all controllers to show a complexity-FPS graph.
(_processComplexitySamples): Factor out some of the sample processing done in the ramp
controller for the benefit of the other controllers. |complexitySamples| contains a list of
samples. Sort the samples by complexity. Optionally remove the top x% of samples.
Group them, and calculate distribution of samples within the same complexity, and add those as
new entries into |complexityAverageSamples|.
(Controller.processSamples): Move the code responsible for determining the complexity and FPS
scores out to ResultsDashboard. The structure of the data returned by the controller is:

{
    controller: [time-regression, time-regression, ...], // optional, data specific to controller
    marks: [...],
    samples: {                    // all of the sample data
        controller: [...],
        complexity: [...],        // processed from controller samples
        complexityAverage: [...], // processed from complexity samples
    }
}

(AdaptiveController.processSamples): Adding the target frame length is no longer necessary; we
now pass the test options to the graph.
(Regression): Move to statistics.js.
* Animometer/resources/statistics.js: Move Regression to here. Add a check if the sampling range
only contains one sample, since we cannot calculate a regression from one sample point.

Teach the test harness to evaluate the data.
* Animometer/resources/runner/animometer.js:
(ResultsDashboard): Store the options used to run the test and the computed results/score separately
from the data. The results are stored as:

{
    score: /* geomean of iteration score */,
    iterationsResults: [
        {
            score: /* geomean of tests */,
            testsResults: {
                suiteName: {
                    testName: {
                        controller: {
                            average:
                            concern:
                            stdev:
                            percent:
                        },
                        frameLength: { ... },
                        complexity: {
                            complexity:
                            stdev:
                            segment1:
                            segment2:
                        },
                        complexityAverage: { ... }
                    },
                    testName: { ... },
                },
                ... next suite ...
            }
        },
        { ...next iteration... }
    ]
}

* Animometer/resources/debug-runner/animometer.js: Pass options around instead of relying
on what was selected in the form. This will later allow for dropping previous results, and
using those runs' options when calculating scores.
(ResultsTable._addGraphButton): Simplify button action by using attached test data.
* Animometer/resources/debug-runner/graph.js: Refactor to use the data.

Consolidate JS files, and move statistics out to a separate JS.

Preparation for having the Controller only handle recording and storage of the samples,
and leave the evaluation of the test score out to the harness. Move Experiment to
a new statistics.js, where Regression will also eventually go. Get rid of algorithm.js
and move it to utilities.js since the Heap is used only for Experiments.

* Animometer/tests/resources/algorithm.js: Removed. Heap is in utilities.js.
* Animometer/tests/resources/sampler.js: Removed. Experiment is in statistics.js,
Sampler in main.js.
* Animometer/tests/resources/main.js: Move Sampler here.
* Animometer/resources/statistics.js: Added. Move Statistics and Experiment here.
* Animometer/resources/extensions.js: Move Heap here. Attach static method to create
a max or min heap to Heap, instead of a new Algorithm object.

Update JS files.
* Animometer/developer.html:
* Animometer/index.html:
* Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
* Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
* Animometer/tests/bouncing-particles/bouncing-css-images.html:
* Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
* Animometer/tests/bouncing-particles/bouncing-svg-images.html:
* Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
* Animometer/tests/master/canvas-stage.html:
* Animometer/tests/master/focus.html:
* Animometer/tests/master/image-data.html:
* Animometer/tests/master/multiply.html:
* Animometer/tests/master/particles.html:
* Animometer/tests/misc/canvas-electrons.html:
* Animometer/tests/misc/canvas-stars.html:
* Animometer/tests/misc/compositing-transforms.html:
* Animometer/tests/simple/simple-canvas-paths.html:
* Animometer/tests/simple/tiled-canvas-image.html:
* Animometer/tests/template/template-canvas.html:
* Animometer/tests/template/template-css.html:
* Animometer/tests/template/template-svg.html:
* Animometer/tests/text/layering-text.html:
* Animometer/tests/text/text-boxes.html:

Fix the cursor in the graph analysis when the min
complexity is not 0.

* Animometer/resources/debug-runner/graph.js:
(_addRegression):
(createComplexityGraph):

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

4 years agoUnreviewed, rolling out r197216.
mmaxfield@apple.com [Sat, 27 Feb 2016 02:59:36 +0000 (02:59 +0000)]
Unreviewed, rolling out r197216.
https://bugs.webkit.org/show_bug.cgi?id=154766

Test simply needs updated result (Requested by litherum on
#webkit).

Reverted changeset:

"Unreviewed, rolling out r197158."
https://bugs.webkit.org/show_bug.cgi?id=154758
http://trac.webkit.org/changeset/197216

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

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

4 years ago[iOS Simulator] Reftests don't work
ap@apple.com [Sat, 27 Feb 2016 02:53:44 +0000 (02:53 +0000)]
[iOS Simulator] Reftests don't work
https://bugs.webkit.org/show_bug.cgi?id=154764

Reviewed by Daniel Bates.

* Scripts/webkitpy/port/image_diff.py: (IOSSimulatorImageDiffer._start):
Use simctl instead of sim.

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

4 years agoRemove the on demand executable allocator
oliver@apple.com [Sat, 27 Feb 2016 02:10:29 +0000 (02:10 +0000)]
Remove the on demand executable allocator
https://bugs.webkit.org/show_bug.cgi?id=154749

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Remove all the DemandExecutable code and executable allocator ifdefs.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* jit/ExecutableAllocator.cpp: Removed.
(JSC::DemandExecutableAllocator::DemandExecutableAllocator): Deleted.
(JSC::DemandExecutableAllocator::~DemandExecutableAllocator): Deleted.
(JSC::DemandExecutableAllocator::bytesAllocatedByAllAllocators): Deleted.
(JSC::DemandExecutableAllocator::bytesCommittedByAllocactors): Deleted.
(JSC::DemandExecutableAllocator::dumpProfileFromAllAllocators): Deleted.
(JSC::DemandExecutableAllocator::allocateNewSpace): Deleted.
(JSC::DemandExecutableAllocator::notifyNeedPage): Deleted.
(JSC::DemandExecutableAllocator::notifyPageIsFree): Deleted.
(JSC::DemandExecutableAllocator::allocators): Deleted.
(JSC::DemandExecutableAllocator::allocatorsMutex): Deleted.
(JSC::ExecutableAllocator::initializeAllocator): Deleted.
(JSC::ExecutableAllocator::ExecutableAllocator): Deleted.
(JSC::ExecutableAllocator::~ExecutableAllocator): Deleted.
(JSC::ExecutableAllocator::isValid): Deleted.
(JSC::ExecutableAllocator::underMemoryPressure): Deleted.
(JSC::ExecutableAllocator::memoryPressureMultiplier): Deleted.
(JSC::ExecutableAllocator::allocate): Deleted.
(JSC::ExecutableAllocator::committedByteCount): Deleted.
(JSC::ExecutableAllocator::dumpProfile): Deleted.
(JSC::ExecutableAllocator::getLock): Deleted.
(JSC::ExecutableAllocator::isValidExecutableMemory): Deleted.
(JSC::ExecutableAllocator::reprotectRegion): Deleted.
* jit/ExecutableAllocator.h:
* jit/ExecutableAllocatorFixedVMPool.cpp:
* jit/JITStubRoutine.h:
(JSC::JITStubRoutine::canPerformRangeFilter): Deleted.
(JSC::JITStubRoutine::filteringStartAddress): Deleted.
(JSC::JITStubRoutine::filteringExtentSize): Deleted.

Source/WTF:

Remove the DeamndExecutableAllocator compile flags.

* wtf/Platform.h:

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

4 years agoAdd API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
cdumez@apple.com [Sat, 27 Feb 2016 02:03:18 +0000 (02:03 +0000)]
Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
https://bugs.webkit.org/show_bug.cgi?id=154714

Reviewed by Darin Adler.

Source/WebCore:

Export a couple more symbols for API testing.

* html/parser/HTMLParserIdioms.h:

Tools:

Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger as per:
- https://html.spec.whatwg.org/multipage/infrastructure.html#signed-integers
- https://html.spec.whatwg.org/multipage/infrastructure.html#non-negative-integers

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp: Added.
(TestWebKitAPI::testParseHTMLInteger):
(TestWebKitAPI::parseHTMLIntegerFails):
(TestWebKitAPI::TEST):
(TestWebKitAPI::testParseHTMLNonNegativeInteger):
(TestWebKitAPI::parseHTMLNonNegativeIntegerFails):

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

4 years agoClear credentials and prevent unauthorized credential storage when using NetworkSession
achristensen@apple.com [Sat, 27 Feb 2016 01:29:05 +0000 (01:29 +0000)]
Clear credentials and prevent unauthorized credential storage when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=154755

Reviewed by Brady Eidson.

Credentials from previous tests were being used sometimes, notably in
http/tests/misc/401-alternative-content.php when running multiple credential-based
tests with the same WebKitTestRunner.

* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::clearCachedCredentials):
(WebKit::NetworkProcess::ensurePrivateBrowsingSession):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::NetworkDataTask):
(WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSession::~NetworkSession):
(WebKit::NetworkSession::clearCredentials):
(WebKit::NetworkSession::dataTaskForIdentifier):

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

4 years agoUnreviewed, rolling out r197174.
ryanhaddad@apple.com [Sat, 27 Feb 2016 00:59:48 +0000 (00:59 +0000)]
Unreviewed, rolling out r197174.
https://bugs.webkit.org/show_bug.cgi?id=154762

This change caused LayoutTests to crash on iOS simulator
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"bmalloc: Added a fast XLarge allocator"
https://bugs.webkit.org/show_bug.cgi?id=154720
http://trac.webkit.org/changeset/197174

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

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

4 years agoRebaseline tests for ios-simulator after r197162
ryanhaddad@apple.com [Sat, 27 Feb 2016 00:37:04 +0000 (00:37 +0000)]
Rebaseline tests for ios-simulator after r197162

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-expected.txt: Added.

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

4 years ago32-bit!!!
bdakin@apple.com [Sat, 27 Feb 2016 00:15:46 +0000 (00:15 +0000)]
32-bit!!!

* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):

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

4 years agoAnother 32-bit build fix.
bdakin@apple.com [Sat, 27 Feb 2016 00:02:02 +0000 (00:02 +0000)]
Another 32-bit build fix.

* platform/spi/cocoa/AVKitSPI.h:

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

4 years agoAttempted 32-bit build fix.
bdakin@apple.com [Fri, 26 Feb 2016 23:51:42 +0000 (23:51 +0000)]
Attempted 32-bit build fix.

* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):

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

4 years agoUnreviewed, rolling out r197158.
ryanhaddad@apple.com [Fri, 26 Feb 2016 23:41:01 +0000 (23:41 +0000)]
Unreviewed, rolling out r197158.
https://bugs.webkit.org/show_bug.cgi?id=154758

This change did not fix the failing test (Requested by
ryanhaddad on #webkit).

Reverted changeset:

"REGRESSION(r195795): [WK2] fast/text/crash-complex-text-
surrogate.html is flakey"
https://bugs.webkit.org/show_bug.cgi?id=154709
http://trac.webkit.org/changeset/197158

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

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

4 years agoUnreviewed, rolling out r197160.
ryanhaddad@apple.com [Fri, 26 Feb 2016 23:39:45 +0000 (23:39 +0000)]
Unreviewed, rolling out r197160.
https://bugs.webkit.org/show_bug.cgi?id=154757

This change causes editing/mac/attributed-string/font-
size.html to fail on El Capitan WK1 (Requested by ryanhaddad
on #webkit).

Reverted changeset:

"Font size computed style is innaccurate"
https://bugs.webkit.org/show_bug.cgi?id=154705
http://trac.webkit.org/changeset/197160

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

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

4 years agoEnhance logging: Add "always on" macros
commit-queue@webkit.org [Fri, 26 Feb 2016 23:33:45 +0000 (23:33 +0000)]
Enhance logging: Add "always on" macros
https://bugs.webkit.org/show_bug.cgi?id=154498
<rdar://problem/24757759>

Patch by Keith Rollin <krollin@apple.com> on 2016-02-26
Reviewed by Chris Dumez.

Add support for efficient always-on logging (logging that is available
in both debug and release builds). This is implemented in the form of
some new macros:

- LOG_ALWAYS: Always log information-level statements.
- LOG_ALWAYS_ERROR: Always log error-level statements. These can be
  filtered out of the normal logging so that they can be found more
  easily.

In cases where there is no efficient underlying facility for it to
utilize, LOG_ALWAYS_ERROR is redirected to WTFReportError as a backup
mechanism. LOG_ALWAYS is not given a similar treatment so that we
don't overwhelm other logging systems that aren't prepared for "always
on" logging.

* wtf/Assertions.h:
* wtf/Platform.h:

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

4 years agoPage TimerAlignmentIntervalIncrease mechanism should have upper limit
barraclough@apple.com [Fri, 26 Feb 2016 23:26:36 +0000 (23:26 +0000)]
Page TimerAlignmentIntervalIncrease mechanism should have upper limit
https://bugs.webkit.org/show_bug.cgi?id=154744

Reviewed by Geoff Garen.

There would be diminishing returns from throttling timers in background pages infinitely.
Add a heuristic to limit appropriately.

Source/WebCore:

Keep track of the current limit, and make the increase time take this into account.

* page/Page.cpp:
(WebCore::Page::setTimerThrottlingEnabled):
    - When timer throttling is disabled visit all timers to resume.
(WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
    - Track the maximum alignment interval, and call setDOMTimerAlignmentInterval
      to ensure m_timerAlignmentInterval is updated in accordance with the new limit.
(WebCore::Page::setDOMTimerAlignmentInterval):
    - When the timer alignemnt interval changes update the increase timer.
(WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
    - Apply limit.
* page/Page.h:
(WebCore::Page::timerThrottlingEnabled):
    - Accessor for readability.

Source/WebKit2:

The flow of data here is WebPageProxy informs WebProcessPool of the number of pages
participating in this mechanism, WebProcessPool computes an apropriate limit and pushes
this out to the WebProcesses, which in turn update each of their pages.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
    - Call updateHidenPageThrottingAutoIncreases on creation.
(WebKit::WebPageProxy::updateHidenPageThrottingAutoIncreases):
    - If increasing timer throttling is enabled increment the counter on WebProcessPool.
(WebKit::WebPageProxy::preferencesDidChange):
    - Call updateHidenPageThrottingAutoIncreases on preferences change.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
    - initialize new RefCounter.
(WebKit::WebProcessPool::updateHidenPageThrottingAutoIncreaseLimit):
    - When count of participating pages changes, update the limit.
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::setHiddenPageTimerThrottlingIncreaseLimit):
    - Propagate limit to WebCore::Page.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setHiddenPageTimerThrottlingIncreaseLimit):
    - Propagate limit to WebPages.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
    - Added new message.

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

4 years agoSkip js/basic-map.html on Mac since it is already run in JSC tests
ryanhaddad@apple.com [Fri, 26 Feb 2016 23:09:08 +0000 (23:09 +0000)]
Skip js/basic-map.html on Mac since it is already run in JSC tests
https://bugs.webkit.org/show_bug.cgi?id=154753

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoAttempted build fix.
bdakin@apple.com [Fri, 26 Feb 2016 23:00:49 +0000 (23:00 +0000)]
Attempted build fix.

* platform/spi/cocoa/AVKitSPI.h:

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

4 years agoReduce direct callers of Structure::findStructuresAndMapForMaterialization
commit-queue@webkit.org [Fri, 26 Feb 2016 22:58:54 +0000 (22:58 +0000)]
Reduce direct callers of Structure::findStructuresAndMapForMaterialization
https://bugs.webkit.org/show_bug.cgi?id=154751

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-02-26
Reviewed by Mark Lam.

* runtime/Structure.cpp:
(JSC::Structure::toStructureShape):
This property name iteration is identical to Structure::forEachPropertyConcurrently.
Share the code and reduce callers to the subtle findStructuresAndMapForMaterialization.

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

4 years agoAttempted build fix.
bdakin@apple.com [Fri, 26 Feb 2016 22:51:15 +0000 (22:51 +0000)]
Attempted build fix.

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
(WebKit::WebVideoFullscreenManagerProxy::resetMediaState):

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

4 years agoFix Yosemite build.
andersca@apple.com [Fri, 26 Feb 2016 22:32:26 +0000 (22:32 +0000)]
Fix Yosemite build.

* UIProcess/API/Cocoa/_WKWebsiteDataSize.mm:
(-[_WKWebsiteDataSize sizeOfDataTypes:]):

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

4 years agoFunction.name and Function.length should be configurable.
mark.lam@apple.com [Fri, 26 Feb 2016 22:29:59 +0000 (22:29 +0000)]
Function.name and Function.length should be configurable.
https://bugs.webkit.org/show_bug.cgi?id=154604

Reviewed by Saam Barati.

Source/JavaScriptCore:

According to https://tc39.github.io/ecma262/#sec-ecmascript-language-functions-and-classes,
"Unless otherwise specified, the name property of a built-in Function object,
if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }."

Similarly, "the length property of a built-in Function object has the attributes
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }."

This patch makes Function.name and Function.length configurable.

We do this by lazily reifying the JSFunction name and length properties on first
access.  We track whether each of these properties have been reified using flags
in the FunctionRareData.  On first access, if not already reified, we will put
the property into the object with its default value and attributes and set the
reified flag.  Thereafter, we rely on the base JSObject to handle access to the
property.

Also, lots of test results have to be re-baselined because the old Function.length
has attribute DontDelete, which is in conflict with the ES6 requirement that it
is configurable.

* runtime/FunctionRareData.h:
(JSC::FunctionRareData::hasReifiedLength):
(JSC::FunctionRareData::setHasReifiedLength):
(JSC::FunctionRareData::hasReifiedName):
(JSC::FunctionRareData::setHasReifiedName):
- Flags for tracking whether each property has been reified.

* runtime/JSFunction.cpp:
(JSC::JSFunction::finishCreation):
(JSC::JSFunction::createBuiltinFunction):
- Host and builtin functions currently always reify their name and length
  properties.  Currently, for builtins, the default names that are used may
  differ from the executable name.  For now, we'll stay with keeping this
  alternate approach to getting the name and length properties for host and
  builtin functions.
  However, we need their default attribute to be configurable as well.

(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::JSFunction::reifyLength):
(JSC::JSFunction::reifyName):
(JSC::JSFunction::reifyLazyPropertyIfNeeded):
(JSC::JSFunction::lengthGetter): Deleted.
(JSC::JSFunction::nameGetter): Deleted.
* runtime/JSFunction.h:
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::hasReifiedLength):
(JSC::JSFunction::hasReifiedName):

* tests/es6.yaml:
- 4 new passing tests.

* tests/mozilla/ecma/Array/15.4.4.3-1.js:
* tests/mozilla/ecma/Array/15.4.4.4-1.js:
* tests/mozilla/ecma/Array/15.4.4.4-2.js:
* tests/mozilla/ecma/GlobalObject/15.1.2.1-1.js:
* tests/mozilla/ecma/GlobalObject/15.1.2.2-1.js:
* tests/mozilla/ecma/GlobalObject/15.1.2.3-1.js:
* tests/mozilla/ecma/GlobalObject/15.1.2.4.js:
* tests/mozilla/ecma/GlobalObject/15.1.2.5-1.js:
* tests/mozilla/ecma/GlobalObject/15.1.2.6.js:
* tests/mozilla/ecma/GlobalObject/15.1.2.7.js:
* tests/mozilla/ecma/String/15.5.4.10-1.js:
* tests/mozilla/ecma/String/15.5.4.11-1.js:
* tests/mozilla/ecma/String/15.5.4.11-5.js:
* tests/mozilla/ecma/String/15.5.4.12-1.js:
* tests/mozilla/ecma/String/15.5.4.6-2.js:
* tests/mozilla/ecma/String/15.5.4.7-2.js:
* tests/mozilla/ecma/String/15.5.4.8-1.js:
* tests/mozilla/ecma/String/15.5.4.9-1.js:
- Rebase expected test results.

* tests/stress/function-configurable-properties.js: Added.

LayoutTests:

* ietestcenter/Javascript/TestCases/15.2.3.3-4-187.js:
(ES5Harness.registerTest.test):
* ietestcenter/Javascript/TestCases/15.3.4.5-15-2.js:
(ES5Harness.registerTest.test):
* js/dom/function-name-expected.txt:
* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/dom/script-tests/function-name.js:
* js/mozilla/strict/15.3.5.1-expected.txt:
* js/mozilla/strict/function-name-arity-expected.txt:
* js/mozilla/strict/script-tests/15.3.5.1.js:
* js/mozilla/strict/script-tests/function-name-arity.js:
* js/resources/getOwnPropertyDescriptor.js:
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.6/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A9.html:
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.6/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A9.html:
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.6/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A9.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.2/15.1.2.1_eval/S15.1.2.1_A4.2.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.2/15.1.2.2_parseInt/S15.1.2.2_A9.2.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.2/15.1.2.3_parseFloat/S15.1.2.3_A7.2.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.2/15.1.2.4_isNaN/S15.1.2.4_A2.2.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.2/15.1.2.5_isFinite/S15.1.2.5_A2.2.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.1_decodeURI/S15.1.3.1_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.2_decodeURIComponent/S15.1.3.2_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.3_encodeURI/S15.1.3.3_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.4_encodeURIComponent/S15.1.3.4_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.2_Object.prototype.toString/S15.2.4.2_A9.html:
* sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.3_Object.prototype.toLocaleString/S15.2.4.3_A9.html:
* sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A9.html:
* sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.5_Object.prototype.hasOwnProperty/S15.2.4.5_A9.html:
* sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.6_Object.prototype.isPrototypeOf/S15.2.4.6_A9.html:
* sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.7_Object.prototype.propertyIsEnumerable/S15.2.4.7_A9.html:
* sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/15.3.4.2_Function.prototype.toString/S15.3.4.2_A9.html:
* sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/15.3.4.3_Function.prototype.apply/S15.3.4.3_A9.html:
* sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/15.3.4.4_Function.prototype.call/S15.3.4.4_A9.html:
* sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.5/S15.3.5.1_A2_T1.html:
* sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.5/S15.3.5.1_A2_T2.html:
* sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.5/S15.3.5.1_A2_T3.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.2.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.13_String.prototype.slice/S15.5.4.13_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.15_String.prototype.substring/S15.5.4.15_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.16_String.prototype.toLowerCase/S15.5.4.16_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.18_String.prototype.toUpperCase/S15.5.4.18_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.4_String.prototype.charAt/S15.5.4.4_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.5_String.prototype.charCodeAt/S15.5.4.5_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.6_String.prototype.concat/S15.5.4.6_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A9.html:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.9_String.prototype.localeCompare/S15.5.4.9_A9.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.2_Date.parse/S15.9.4.2_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.3_Date.UTC/S15.9.4.3_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.10_Date.prototype.getFullYear/S15.9.5.10_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.11_Date.prototype.getUTCFullYear/S15.9.5.11_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.12_Date.prototype.getMonth/S15.9.5.12_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.13_Date.prototype.getUTCMonth/S15.9.5.13_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.14_Date.prototype.getDate/S15.9.5.14_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.15_Date.prototype.getUTCDate/S15.9.5.15_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.16_Date.prototype.getDay/S15.9.5.16_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.17_Date.prototype.getUTCDay/S15.9.5.17_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.18_Date.prototype.getHours/S15.9.5.18_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.19_Date.prototype.getUTCHours/S15.9.5.19_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.20_Date.prototype.getMinutes/S15.9.5.20_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.21_Date.prototype.getUTCMinutes/S15.9.5.21_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.22_Date.prototype.getSeconds/S15.9.5.22_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.23_Date.prototype.getUTCSeconds/S15.9.5.23_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.24_Date.prototype.getMilliseconds/S15.9.5.24_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.25_Date.prototype.getUTCMilliseconds/S15.9.5.25_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.26_Date.prototype.getTimezoneOffset/S15.9.5.26_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.27_Date.prototype.setTime/S15.9.5.27_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.28_Date.prototype.setMilliseconds/S15.9.5.28_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.29_Date.prototype.setUTCMilliseconds/S15.9.5.29_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.2_Date.prototype.toString/S15.9.5.2_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.30_Date.prototype.setSeconds/S15.9.5.30_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.31_Date.prototype.setUTCSeconds/S15.9.5.31_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.32_Date.prototype.setMinutes/S15.9.5.32_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.33_Date.prototype.setUTCMinutes/S15.9.5.33_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.34_Date.prototype.setHours/S15.9.5.34_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.35_Date.prototype.setUTCHours/S15.9.5.35_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.36_Date.prototype.setDate/S15.9.5.36_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.37_Date.prototype.setUTCDate/S15.9.5.37_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.38_Date.prototype.setMonth/S15.9.5.38_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.39_Date.prototype.setUTCMonth/S15.9.5.39_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.3_Date.prototype.toDateString/S15.9.5.3_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.40_Date.prototype.setFullYear/S15.9.5.40_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.41_Date.prototype.setUTCFullYear/S15.9.5.41_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.42_Date.prototype.toUTCString/S15.9.5.42_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.4_Date.prototype.toTimeString/S15.9.5.4_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.5_Date.prototype.toLocaleString/S15.9.5.5_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.6_Date.prototype.toLocaleDateString/S15.9.5.6_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.7_Date.prototype.toLocaleTimeString/S15.9.5.7_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.8_Date.prototype.valueOf/S15.9.5.8_A3_T2.html:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.9_Date.prototype.getTime/S15.9.5.9_A3_T2.html:

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

4 years agoAdd support for playbackControlsManager
bdakin@apple.com [Fri, 26 Feb 2016 22:28:23 +0000 (22:28 +0000)]
Add support for playbackControlsManager
https://bugs.webkit.org/show_bug.cgi?id=154742
-and corresponding-
rdar://problem/23833753

Reviewed by Jer Noble.

Source/WebCore:

Make AVKitSPI.h private so that it can be used from other projects.
* WebCore.xcodeproj/project.pbxproj:

Right now, set up a controls manager for a video when it starts playing. In
the future, this is something that should be handled by the
PlatformMediaSessionManager since we only want a controls for the
currentSession.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):

New function setUpVideoControlsManager.
* page/ChromeClient.h:

Make these CoreMedia functions available on Mac and iOS instead of just iOS.
* platform/cf/CoreMediaSoftLink.cpp:
* platform/cf/CoreMediaSoftLink.h:

This patch fleshes out an implementation for a bunch of these interface
functions since they need to communicate to the playbackControlsManager. This
is also where the playbackControlsManager lives.
* platform/mac/WebVideoFullscreenInterfaceMac.h:

Define an interface and implementation for WebPlaybackControlsManager.
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
(-[WebPlaybackControlsManager isSeeking]):
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager audioMediaSelectionOptions]):
(-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
(-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
(-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
(-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):

Relay this information to the playbackControlsManager.
(WebCore::WebVideoFullscreenInterfaceMac::setDuration):
(WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
(WebCore::WebVideoFullscreenInterfaceMac::setRate):
(WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
(WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
(WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager):
(WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):

New SPI needed.
* platform/spi/cocoa/AVKitSPI.h:
* platform/spi/mac/AVFoundationSPI.h:

Source/WebKit2:

WebVideoFullscreenManagerProxy ensures the model and interface for the
UIProcess side of the playbackControlsManager. It also caches the
m_controlsManagerContextId so that it can return the
controlsManagerInterface.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
(WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):

Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to
update WebViewImplAdditions.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::isPlayingMediaDidChange):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange):
(WebKit::WebPageProxy::isPlayingVideoWithAudio):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isPlayingAudio):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::isPlayingMediaDidChange):

Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::setUpVideoControlsManager):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Ensure the model an interface for the playbackControlsManager on the
WebProcess side and pass the message to the UIProcess to do the same.
* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):

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

4 years agoWKWebsiteDataStore/WKWebsiteDataRecord needs to provide size information about each...
andersca@apple.com [Fri, 26 Feb 2016 22:26:03 +0000 (22:26 +0000)]
WKWebsiteDataStore/WKWebsiteDataRecord needs to provide size information about each type of data
https://bugs.webkit.org/show_bug.cgi?id=154750
Source/WebKit2:

Reviewed by Tim Horton.

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::fetchWebsiteData):
WebsiteData::Entry now takes a size.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
If necessary, compute sizes.

(WebKit::NetworkProcess::fetchWebsiteData):
Just pass 0 for the CF cache for now.

* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
FetchWebsiteData now takes a OptionSet<WebsiteDataFetchOption>.

* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::Entry::encode):
(WebKit::WebsiteData::Entry::decode):
Encode and decode the size.

* Shared/WebsiteData/WebsiteData.h:
Add size.

* Shared/WebsiteData/WebsiteDataFetchOption.h:
Add new enum.

* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetApplicationCacheOrigins):
Pass an empty OptionSet<WebsiteDataFetchOption>.

* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerGetCacheOrigins):
Pass an empty OptionSet<WebsiteDataFetchOption>.

* UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
(-[WKWebsiteDataRecord description]):
If we have a size, print it out as well.

(-[WKWebsiteDataRecord _dataSize]):
Return a size if we have one.

* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
Call through to the SPI.

(-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
Compute the right options.

* UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
Import WKWebsiteDataStorePrivate.h.

* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
Add SPI.

* UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
* UIProcess/API/Cocoa/_WKWebsiteDataSize.mm:
(-[_WKWebsiteDataSize initWithSize:]):
(-[_WKWebsiteDataSize totalSize]):
(-[_WKWebsiteDataSize sizeOfDataTypes:]):
Add _WKWebsiteDataSize header.

* UIProcess/API/Cocoa/_WKWebsiteDataSizeInternal.h: Add IPI header.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::fetchWebsiteData):
This now takes a OptionSet<WebsiteDataFetchOption>.

* UIProcess/Network/NetworkProcessProxy.h:
Update members.

* UIProcess/WebsiteData/WebsiteDataRecord.h:
Add a hash map from types to sizes.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
This now takes a OptionSet<WebsiteDataFetchOption>.

* UIProcess/WebsiteData/WebsiteDataStore.h:
Update member functions.

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

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
This now takes a OptionSet<WebsiteDataFetchOption>.

Tools:

rdar://problem/23861395

Reviewed by Tim Horton.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController fetchWebsiteData:]):
Use the new WKWebsiteDataStore SPI to compute data sizes.

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

4 years agoUnreviewed, fix flaky test introduced in r197156.
cdumez@apple.com [Fri, 26 Feb 2016 22:06:16 +0000 (22:06 +0000)]
Unreviewed, fix flaky test introduced in r197156.

* fast/dom/Node/nullable-parameters-expected.txt:
* fast/dom/Node/nullable-parameters.html:
* fast/dom/Node/resources/testdoc.xml: Removed.
* fast/dom/Node/resources/testdoc2.xml: Removed.

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

4 years agoAdd a toWebsiteDataType and reimplement toWebsiteDataTypes using it
andersca@apple.com [Fri, 26 Feb 2016 21:51:45 +0000 (21:51 +0000)]
Add a toWebsiteDataType and reimplement toWebsiteDataTypes using it
https://bugs.webkit.org/show_bug.cgi?id=154746

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataType):
(WebKit::toWebsiteDataTypes):
(WebKit::toWKWebsiteDataTypes):

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

4 years agoFolding of OverridesHasInstance DFG nodes shoud happen in constant folding not fixup
keith_miller@apple.com [Fri, 26 Feb 2016 21:43:09 +0000 (21:43 +0000)]
Folding of OverridesHasInstance DFG nodes shoud happen in constant folding not fixup
https://bugs.webkit.org/show_bug.cgi?id=154743

Reviewed by Mark Lam.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):

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

4 years ago<g> wrapping <symbol> causes display of hidden <symbol>
commit-queue@webkit.org [Fri, 26 Feb 2016 20:58:32 +0000 (20:58 +0000)]
<g> wrapping <symbol> causes display of hidden <symbol>
https://bugs.webkit.org/show_bug.cgi?id=154576

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-02-26
Reviewed by Darin Adler.
Source/WebCore:

The SVGSymbolElement is allowed in the shadow tree of an SVGUseElement
only if it subtree root element. Any descendant SVGSymbolElement should
be removed from the subtree because it is a hidden container. If the cloned
subtree includes an SVGUseElement which references an SVGSymbolElement,
the same rule will be applied to the descendant SVGUseElement. The goal
is to remove all the descendant SVGSymbolElements from the cloned target
because these SVGSymbolElements will be expanded to SVGSVGElements and
hence become visible.

* svg/SVGUseElement.cpp:
(WebCore::disassociateAndRemoveClones): A helper function which removes
cloned SVGElements and their subtrees from their parents and disassociate
them from their originals.

(WebCore::removeDisallowedElementsFromSubtree): Use disassociateAndRemoveClones().

(WebCore::removeSymbolElementsFromSubtree): Removes all the descendant
SVGSymbolElements from the cloned subtree. It does not remove the root
element itself if it is an SVGSymbolElement because this one will be
expanded to an SVGSVGElement which is exactly what we need.

(WebCore::SVGUseElement::cloneTarget): Call removeSymbolElementsFromSubtree()
to remove the descendant SVGSymbolElements from the cloned subtree before
appending it to the container shadow root.

LayoutTests:

Ensure the <symbol> element is not displayed when it's wrapped in a <g>
element and this <g> element is referenced by a <use> element.

* platform/gtk/svg/custom/use-on-g-containing-symbol-expected.png: Removed.
* platform/gtk/svg/custom/use-on-g-containing-symbol-expected.txt: Removed.
* platform/ios-simulator/svg/custom/use-on-g-containing-symbol-expected.txt: Removed.
* platform/mac/svg/custom/use-on-g-containing-symbol-expected.png: Removed.
* platform/mac/svg/custom/use-on-g-containing-symbol-expected.txt: Removed.
* platform/win/svg/custom/use-on-g-containing-symbol-expected.txt: Removed.
* svg/custom/use-on-g-containing-symbol-expected.svg: Added.
* svg/custom/use-on-g-containing-symbol.svg:
The original test was wrong. It had the following definition:
    "<g id='symbol'><symbol>...</symbol></g>"
And it was expecting to have the symbol drawn if the <g> element was
referenced like that
    "<use xlink:href='#symbol'/>"
FireFox does not render anything for this <use> element which is correct.
With this patch, this test failed so it had to be modified to test the right
behavior. Also it is now converted to a ref test.

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

4 years agoInitialize LocaleICU data members in header
commit-queue@webkit.org [Fri, 26 Feb 2016 20:47:24 +0000 (20:47 +0000)]
Initialize LocaleICU data members in header
https://bugs.webkit.org/show_bug.cgi?id=154731

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

LocaleICU data members should be initialized in the header, to
avoid conditional initialization lines in the constructor, as
suggested by Darin in bug 154484.

* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::LocaleICU): Deleted.
* platform/text/LocaleICU.h:

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

4 years agoNative Typed Array functions should use Symbol.species
keith_miller@apple.com [Fri, 26 Feb 2016 20:25:42 +0000 (20:25 +0000)]
Native Typed Array functions should use Symbol.species
https://bugs.webkit.org/show_bug.cgi?id=154569

Reviewed by Michael Saboff.

This patch adds support for Symbol.species in the native Typed Array prototype
functions. Additionally, now that other types of typedarrays are creatable inside
the slice we use the JSGenericTypedArrayView::set function, which has been beefed
up, to put everything into the correct place.

* runtime/JSDataView.cpp:
(JSC::JSDataView::set):
* runtime/JSDataView.h:
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewFromIterator):
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::setWithSpecificType):
(JSC::JSGenericTypedArrayView<Adaptor>::set):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::speciesConstruct):
(JSC::genericTypedArrayViewProtoFuncSet):
(JSC::genericTypedArrayViewProtoFuncSlice):
(JSC::genericTypedArrayViewProtoFuncSubarray):
* tests/stress/typedarray-slice.js:
(subclasses.typedArrays.map):
(testSpecies):
(forEach):
(subclasses.forEach):
(testSpeciesRemoveConstructor):
(testSpeciesWithSameBuffer):
* tests/stress/typedarray-subarray.js: Added.
(subclasses.typedArrays.map):
(testSpecies):
(forEach):
(subclasses.forEach):
(testSpeciesRemoveConstructor):

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

4 years agoAdd WTF::OptionSet and use it for the website data types enum
andersca@apple.com [Fri, 26 Feb 2016 19:49:36 +0000 (19:49 +0000)]
Add WTF::OptionSet and use it for the website data types enum
https://bugs.webkit.org/show_bug.cgi?id=154733

Reviewed by Geoffrey Garen.

Source/WebKit2:

This is a pretty mechanical change:

Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to
WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly.

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::fetchWebsiteData):
(WebKit::DatabaseProcess::deleteWebsiteData):
(WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/DatabaseProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Platform/IPC/ArgumentCoders.h:
(IPC::ArgumentCoder<OptionSet<T>>::encode):
(IPC::ArgumentCoder<OptionSet<T>>::decode):
* Scripts/webkit/messages.py:
(class_template_headers):
* Shared/WebsiteData/WebsiteData.h:
* Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h.
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetApplicationCacheOrigins):
(WKApplicationCacheManagerDeleteEntriesForOrigin):
(WKApplicationCacheManagerDeleteAllEntries):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(toWebsiteDataTypes):
(WKResourceCacheManagerClearCacheForOrigin):
* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataTypes):
(WebKit::toWKWebsiteDataTypes):
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::fetchWebsiteData):
(WebKit::DatabaseProcessProxy::deleteWebsiteData):
(WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::add):
(WebKit::WebsiteDataRecord::addCookieHostName):
(WebKit::WebsiteDataRecord::addPluginDataHostName):
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::computeWebProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchData):
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::computeWebProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::removeData):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
(WebKit::WebProcess::deleteWebsiteData):
(WebKit::WebProcess::deleteWebsiteDataForOrigins):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Source/WTF:

Add WTF::OptionSet which makes it easier to use strong enums as flags.

* WTF.xcodeproj/project.pbxproj:
* wtf/Forward.h:
* wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h.
(WTF::OptionSet::fromRaw):
(WTF::OptionSet::OptionSet):
(WTF::OptionSet::toRaw):
(WTF::OptionSet::contains):
(WTF::OptionSet::operator|=):

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

4 years agoModern IDB: Using existing database info from SQLite backing store is busted.
beidson@apple.com [Fri, 26 Feb 2016 19:49:35 +0000 (19:49 +0000)]
Modern IDB: Using existing database info from SQLite backing store is busted.
<rdar://problem/24848143> and https://bugs.webkit.org/show_bug.cgi?id=154735

Reviewed by Alex Christensen.

No new tests.

Reproducing the bug requires having a known database on disk *before* launching the DatabaseProcess to
read in the existing IDBDatabaseInfo.

Our automated infrastructure currently has no way of testing this.

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::openDatabase):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo): Do the optional migrate on
  the IndexRecords table here; *every* time we open a SQLite backing store.
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo): Deleted.
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::isolatedCopy): Copy the entire object, not just name/version.

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

4 years agoTry to fix the Yosemite build again.
weinig@apple.com [Fri, 26 Feb 2016 19:45:11 +0000 (19:45 +0000)]
Try to fix the Yosemite build again.

* UIProcess/API/Cocoa/WKUserScript.mm:
(toStringVector):
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):

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

4 years agoBuild fix for when WK_OVERRIDE_FRAMEWORKS_DIR contains spaces.
mitz@apple.com [Fri, 26 Feb 2016 19:37:52 +0000 (19:37 +0000)]
Build fix for when WK_OVERRIDE_FRAMEWORKS_DIR contains spaces.

* Configurations/WebKitLegacy.xcconfig: Added quotes.

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

4 years ago[JSC] Add32(Imm, Tmp, Tmp) does not ZDef the destination if Imm is zero
commit-queue@webkit.org [Fri, 26 Feb 2016 19:18:55 +0000 (19:18 +0000)]
[JSC] Add32(Imm, Tmp, Tmp) does not ZDef the destination if Imm is zero
https://bugs.webkit.org/show_bug.cgi?id=154704

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-02-26
Reviewed by Geoffrey Garen.

If the Imm is zero, we should still zero the top bits
to match the definition in AirOpcodes.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::add32):
* b3/testb3.cpp:

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

4 years agoMake testRegExp not crash when given an invalid regexp
oliver@apple.com [Fri, 26 Feb 2016 19:18:06 +0000 (19:18 +0000)]
Make testRegExp not crash when given an invalid regexp
https://bugs.webkit.org/show_bug.cgi?id=154732

Reviewed by Mark Lam.

* testRegExp.cpp:
(parseRegExpLine):

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

4 years agoTry to fix the Yosemite build.
weinig@apple.com [Fri, 26 Feb 2016 18:54:25 +0000 (18:54 +0000)]
Try to fix the Yosemite build.

* UIProcess/API/Cocoa/WKUserScriptPrivate.h:

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

4 years ago[JSC] Add the test for r197155
benjamin@webkit.org [Fri, 26 Feb 2016 18:51:08 +0000 (18:51 +0000)]
[JSC] Add the test for r197155
https://bugs.webkit.org/show_bug.cgi?id=154715

Reviewed by Mark Lam.

Silly me. I forgot the test in the latest patch update.

* tests/stress/class-syntax-tdz-osr-entry-in-loop.js: Added.

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

4 years agoCache::traverse should pass the record info to its traversal handler
andersca@apple.com [Fri, 26 Feb 2016 18:44:17 +0000 (18:44 +0000)]
Cache::traverse should pass the record info to its traversal handler
https://bugs.webkit.org/show_bug.cgi?id=154695

Reviewed by Antti Koivisto.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
(WebKit::clearDiskCacheEntries):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::traverse):
* NetworkProcess/cache/NetworkCache.h:

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

4 years agoSource/WebCore:
barraclough@apple.com [Fri, 26 Feb 2016 18:20:07 +0000 (18:20 +0000)]
Source/WebCore:
RefCounter value changed callback should be called on all changes (not just zero edge).
https://bugs.webkit.org/show_bug.cgi?id=154699

Reviewed by Anders Carlsson.

RefCounter currently only triggers a callback when the count goes from zero
to non-zero and vice-versa. Change that, to be useful to more clients.

* page/PageThrottler.cpp:
(WebCore::PageThrottler::PageThrottler):
    - Updated for change in RefCounter callback siganture.
* platform/VNodeTracker.cpp:
(WebCore::VNodeTracker::VNodeTracker):
    - Can now use RefCounter callback to trigger checkPressureState().
(WebCore::VNodeTracker::pressureWarningTimerFired):
    - RefCounter count is now a size_t (%d -> %ul).
* platform/VNodeTracker.h:
    - simplified VNodeTracker::token() [no longer needs to call checkPressureState()].

Source/WebKit2:
RefCounter value changed callback should be called on all changes (not just zero edge).
https://bugs.webkit.org/show_bug.cgi?id=154699

Reviewed by Anders Carlsson.

RefCounter currently only triggers a callback when the count goes from zero
to non-zero and vice-versa. Change that, to be useful to more clients.

* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::PluginProcessManager):
    - Updated for change in RefCounter callback siganture.
* UIProcess/Plugins/PluginProcessManager.h:
    - Updated for change in RefCounter callback siganture.
* UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
(WebKit::PluginProcessManager::updateProcessSuppressionDisabled):
    - updated logic for enabling process supression.
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::ProcessThrottler):
    - Updated for change in RefCounter callback siganture.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
    - Updated for change in RefCounter callback siganture.

Source/WTF:
Unreviewed, rolling out r197168.
https://bugs.webkit.org/show_bug.cgi?id=154728

crashing on some devices (Requested by kling on #webkit).

Reverted changeset:

"[Darwin] Use vm_kernel_page_size for WTF::pageSize()."
https://bugs.webkit.org/show_bug.cgi?id=154726
http://trac.webkit.org/changeset/197168

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

Tools:
RefCounter value changed callback should be called on all changes (not just zero edge).
https://bugs.webkit.org/show_bug.cgi?id=154699

Reviewed by Geoff Garen.

RefCounter currently only triggers a callback when the count goes from zero
to non-zero and vice-versa. Change that, to be useful to more clients.

* TestWebKitAPI/Tests/WTF/RefCounter.cpp:
(TestWebKitAPI::TEST):
    - Updated for change in RefCounter callback siganture & behaviour.

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

4 years agoRemove unused CFNetwork disk cache mmap optimization in WebKit2.
akling@apple.com [Fri, 26 Feb 2016 18:17:14 +0000 (18:17 +0000)]
Remove unused CFNetwork disk cache mmap optimization in WebKit2.
<https://webkit.org/b/154727>

Reviewed by Darin Adler.

Source/WebCore:

Remove some now-unused SPI.

* platform/spi/cf/CFNetworkSPI.h:

Source/WebKit2:

Nuke all the code related to the mmap optimization we had for CFNetwork's disk cache.
This code has not been used since we moved to the WebKit2 network cache.

* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::sendBufferMaybeAborting): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformLowMemoryHandler): Deleted.
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): Deleted.
* NetworkProcess/mac/NetworkDiskCacheMonitor.h: Removed.
* NetworkProcess/mac/NetworkDiskCacheMonitor.mm: Removed.
* NetworkProcess/mac/NetworkLoadMac.mm:
(WebKit::NetworkLoad::willCacheResponseAsync): Deleted.
* NetworkProcess/mac/NetworkResourceLoaderMac.mm: Removed.
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoUnreviewed, rolling out r197167.
ryanhaddad@apple.com [Fri, 26 Feb 2016 18:12:53 +0000 (18:12 +0000)]
Unreviewed, rolling out r197167.
https://bugs.webkit.org/show_bug.cgi?id=154730

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

Reverted changeset:

"REGRESSION (188611): Search field Cancel button should not
overlap search text on extensions page."
https://bugs.webkit.org/show_bug.cgi?id=154692
http://trac.webkit.org/changeset/197167

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

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

4 years agoFix some issues in MallocBench
ggaren@apple.com [Fri, 26 Feb 2016 17:58:58 +0000 (17:58 +0000)]
Fix some issues in MallocBench
https://bugs.webkit.org/show_bug.cgi?id=154600

Reviewed by Oliver Hunt.

* MallocBench/MallocBench.xcodeproj/project.pbxproj: Make nimlang.ops
a part of the build so that it copies to the right place for execution.

* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::Interpreter): Don't try to open .ops files for writing
because we're only going to read and we might need extra permissions to
write.

(Interpreter::~Interpreter): Give more context when opening a file fails
to help with debugging.

* MallocBench/MallocBench/stress.cpp:
(benchmark_stress): Reduce iterations to complete in less than 10 seconds.

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

4 years agobmalloc: Added a fast XLarge allocator
ggaren@apple.com [Fri, 26 Feb 2016 17:57:37 +0000 (17:57 +0000)]
bmalloc: Added a fast XLarge allocator
https://bugs.webkit.org/show_bug.cgi?id=154720

Reviewed by Andreas Kling.

This is a big speedup for XLarge allocations because it avoids mmap
and page fault churn. It also enables future design changes to handle
a smaller size range on the fast path.

* bmalloc.xcodeproj/project.pbxproj:

* bmalloc/Algorithm.h:
(bmalloc::roundUpToMultipleOf):
(bmalloc::roundDownToMultipleOf): Added a non-constant round down.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::tryAllocate): XLarge no longer requires the caller
to align things.

(bmalloc::Allocator::allocate): Tweaked the alignment calculation for
clarity. When alignment and largeAlignment are equal, no adjustment
is necessary since all allocations guarantee largeAlignment.

(bmalloc::Allocator::reallocate): Updated for interface change.

Note that the new interface fixes some concurrency bugs. The old code
kept an iterator into the XLarge allocator across lock drop and acquisition,
which is not cool.

(bmalloc::Allocator::allocateXLarge): XLarge no longer requires the caller
to align things.

* bmalloc/Heap.cpp:
(bmalloc::Heap::scavengeXLargeObjects): Added scavenging for XLarge.

(bmalloc::Heap::allocateXLarge):

(bmalloc::Heap::splitAndAllocate): Split XLarge objects to xLargeAlignment.

(bmalloc::Heap::tryAllocateXLarge):
(bmalloc::Heap::xLargeSize):
(bmalloc::Heap::shrinkXLarge):
(bmalloc::Heap::deallocateXLarge): Allocate from our map before going
to the OS.

(bmalloc::Heap::findXLarge): Deleted.

* bmalloc/Heap.h:

* bmalloc/LargeObject.h:
(bmalloc::LargeObject::split):

* bmalloc/ObjectType.h:
(bmalloc::isXLarge): Give XLarge objects an explicit alignment for clarity.

* bmalloc/Range.h:
(bmalloc::Range::size):
(bmalloc::Range::operator!):
(bmalloc::Range::operator bool):
(bmalloc::Range::operator<):
(bmalloc::canMerge):
(bmalloc::merge): Some helpers that were useful in writing this patch.

* bmalloc/Sizes.h:

* bmalloc/SortedVector.h: Added.
(bmalloc::SortedVector::Bucket::Bucket):
(bmalloc::SortedVector::Bucket::operator<):
(bmalloc::SortedVector::iterator::iterator):
(bmalloc::SortedVector::iterator::operator++):
(bmalloc::SortedVector::iterator::operator!=):
(bmalloc::SortedVector::iterator::operator*):
(bmalloc::SortedVector::iterator::operator->):
(bmalloc::SortedVector::iterator::skipDeletedBuckets):
(bmalloc::SortedVector::begin):
(bmalloc::SortedVector::end):
(bmalloc::SortedVector<T>::insert):
(bmalloc::SortedVector<T>::find):
(bmalloc::SortedVector<T>::get):
(bmalloc::SortedVector<T>::take):
(bmalloc::SortedVector<T>::shrinkToFit): A simple abstraction for keeping
a sorted vector. Insertion is average amortized log(n) because we keep
deleted buckets that we can reuse.

This is better than a tree because we get better locality, less memory
use, and simpler code. Also, trees require a node memory allocator, and
implementing a memory allocator in a memory allocator is no fun.

Arguably we should use a hash table instead. But that's more code, and
sorted vector has other nice properties that we might want to take
adavantage of in the future.

* bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate): Fixed an inaccuracy in the alignment calculation
here. This code was sort of trying to enforce the alignment that the
XLarge allocator enforces -- but it's better to enforce that alignment
there.

The right calculation is:

    vmAlignment - vmPageSize + vmSize

because the worst case is when you are aligned to 0 + vmPageSize, and
you must walk forward vmAlignment - vmPageSize to reach the next
vmAlignment.

(bmalloc::tryVMExtend): Deleted. No need to go back to the OS for VM
since we manage our own.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::allocateLargeChunk): Updated for clarity. When we
grow the large heap we know that grown region is where the next allocation
will take place, so we return it directly instead of pushing it to the
free list.

This fixes a subtle bug where an overly conservative aligned allocation
algorithm can fail to allocate at all when it grows the heap.

* bmalloc/VMHeap.h:
(bmalloc::VMHeap::allocateLargeObject): Ditto.
(bmalloc::VMHeap::allocateLargeObject): Ditto.

* bmalloc/VMState.h:
(bmalloc::merge): Added a helper.

* bmalloc/Vector.h:
(bmalloc::Vector::begin):
(bmalloc::Vector::end):
(bmalloc::Vector::size):
(bmalloc::Vector::capacity):
(bmalloc::Vector::last):
(bmalloc::Vector::pop):
(bmalloc::Vector<T>::push):
(bmalloc::Vector<T>::pop):
(bmalloc::Vector<T>::shrink): Use a proper iterator API to play nice
with std algorithms.

(bmalloc::Vector<T>::insert): New function required by SortedVector.

(bmalloc::Vector<T>::reallocateBuffer):
(bmalloc::Vector<T>::shrinkCapacity): Allow for shrinking back all the way
to 0 because that's what shrinkToFit wants.
(bmalloc::Vector<T>::growCapacity):
(bmalloc::Vector<T>::shrinkToFit):

* bmalloc/XLargeMap.cpp: Added. Helper data structure for managing XLarge
objects. We have enough granularity in our metadata to represent any
kind of address range.

We store free ranges in a flat vector because most programs have very
few individual free XLarge ranges. (They usually merge.)

We store allocated ranges in a sorted vector because programs might
allocate lots of XLarge ranges. For example, if the XLarge minimum is
128kB, and you have a 1GB process, that's 8192 ranges. Linear scan would
examine 8192 items but binary search only 13.

Empirically, this is 1.5X faster than our current large allocator if you
modify MallocBench/big to allocate XLarge objects and not to initialize
objects and you allocate 128kB-256kB objects in a 1GB address space.

(bmalloc::XLargeMap::takeFree): Be careful about overflow in this function
because we support super huge pointers, alignments, and sizes.

(bmalloc::XLargeMap::addFree): Merge eagerly on free because the cost
of missing an XLarge opportunity is catastrophic. Also, I discovered
by experiment that any allocator that doesn't merge eagerly can create
lots of subtle opportunities for snowballing fragmentation, as
fragmentation in range A forces you to chop up range B, and so on.

We allocate "first fit" (allocating the lowest address) because someone
wrote a paper once that said that it's the best algorithm to combat
fragmentation (even though worst case fragmentation is unavoidable
regardless of algorithm).

(bmalloc::XLargeMap::addAllocated):
(bmalloc::XLargeMap::getAllocated):
(bmalloc::XLargeMap::takeAllocated):
(bmalloc::XLargeMap::shrinkToFit):
(bmalloc::XLargeMap::takePhysical):
(bmalloc::XLargeMap::addVirtual):
* bmalloc/XLargeMap.h: Added.
(bmalloc::XLargeMap::Allocation::operator<):

* bmalloc/XLargeRange.h: Added.
(bmalloc::XLargeRange::XLargeRange):
(bmalloc::XLargeRange::vmState):
(bmalloc::XLargeRange::setVMState):
(bmalloc::canMerge):
(bmalloc::merge):
(bmalloc::XLargeRange::split): Helper for tracking VMState in a range.

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

4 years agoUnreviewed, rolling out r197168.
commit-queue@webkit.org [Fri, 26 Feb 2016 17:54:32 +0000 (17:54 +0000)]
Unreviewed, rolling out r197168.
https://bugs.webkit.org/show_bug.cgi?id=154728

crashing on some devices (Requested by kling on #webkit).

Reverted changeset:

"[Darwin] Use vm_kernel_page_size for WTF::pageSize()."
https://bugs.webkit.org/show_bug.cgi?id=154726
http://trac.webkit.org/changeset/197168

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

4 years agoAllow WKUserScripts to be run in isolated worlds
weinig@apple.com [Fri, 26 Feb 2016 17:50:50 +0000 (17:50 +0000)]
Allow WKUserScripts to be run in isolated worlds
https://bugs.webkit.org/show_bug.cgi?id=154701

Reviewed by Anders Carlsson.

Source/WebKit2:

Adds support for using isolated worlds, called _WKUserContentWorlds in the SPI,
from the UIProcess.

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
* UIProcess/API/APIUserContentWorld.cpp: Added.
(API::generateIdentifier):
(API::UserContentWorld::worldWithName):
(API::UserContentWorld::normalWorld):
(API::UserContentWorld::UserContentWorld):
(API::UserContentWorld::~UserContentWorld):
* UIProcess/API/APIUserContentWorld.h: Added.
Add new UserContentWorld type.

* UIProcess/API/APIUserScript.h:
Bind each user script to a particular _WKUserContentWorld.

* UIProcess/API/C/WKUserScriptRef.cpp:
(WKUserScriptCreateWithSource):
(WKUserScriptCopySource):
Existing APIs create user scripts for the normal world, preserving existing behavior.

* UIProcess/API/Cocoa/WKUserScript.mm:
(-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
Existing APIs create user scripts for the normal world, preserving existing behavior.

(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
Add a new initializer which takes a world to bind to.  Also add support for the legacy whitelist/blacklist mechanism
while we are here, as the expected client needs these as well.

(-[WKUserScript _userContentWorld]):
Add accessor for the bound world.

* UIProcess/API/Cocoa/WKUserScriptInternal.h:
* UIProcess/API/Cocoa/WKUserScriptPrivate.h: Added.
Add new private header.

* UIProcess/API/Cocoa/_WKUserContentWorld.h: Added.
* UIProcess/API/Cocoa/_WKUserContentWorld.mm: Added.
(+[_WKUserContentWorld worldWithName:]):
(+[_WKUserContentWorld normalWorld]):
(-[_WKUserContentWorld dealloc]):
(-[_WKUserContentWorld name]):
(-[_WKUserContentWorld _apiObject]):
* UIProcess/API/Cocoa/_WKUserContentWorldInternal.h: Added.
Add SPI wrapper.

* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addUserScript):
(WebKit::WebUserContentControllerProxy::removeUserScript):
(WebKit::WebUserContentControllerProxy::removeAllUserScripts):
(WebKit::WebUserContentControllerProxy::addUserStyleSheet):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
(WebKit::WebUserContentControllerProxy::userScripts):
(WebKit::WebUserContentControllerProxy::userStyleSheets):
Add support for registering the worlds with the associated WebContentProcesses and then using
their identifiers to map user scripts to the correct world.

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

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
(-[WKWebProcessPlugInScriptWorld name]):
Expose the name property.

* WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
(WKBundleScriptWorldCopyName):
* WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
Expose the name property.

* WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
(WebKit::allWorlds):
(WebKit::InjectedBundleScriptWorld::create):
(WebKit::InjectedBundleScriptWorld::getOrCreate):
(WebKit::InjectedBundleScriptWorld::normalWorld):
(WebKit::InjectedBundleScriptWorld::InjectedBundleScriptWorld):
(WebKit::InjectedBundleScriptWorld::~InjectedBundleScriptWorld):
(WebKit::InjectedBundleScriptWorld::coreWorld):
(WebKit::InjectedBundleScriptWorld::clearWrappers):
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
(WebKit::InjectedBundleScriptWorld::name):
Add the name property and do some drive-by RefPtr -> Ref conversions.

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::userContentControllers):
(WebKit::worldMap):
(WebKit::WebUserContentController::getOrCreate):
(WebKit::WebUserContentController::~WebUserContentController):
(WebKit::WebUserContentController::addUserContentWorlds):
(WebKit::WebUserContentController::removeUserContentWorld):
(WebKit::WebUserContentController::addUserScripts):
(WebKit::WebUserContentController::removeUserScript):
(WebKit::WebUserContentController::removeAllUserScripts):
(WebKit::WebUserContentController::addUserStyleSheets):
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.messages.in:
Track and use worlds passed from the UIProcess.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/_WKUserContentWorld.mm: Added.
(-[SimpleDelegate webView:didFinishNavigation:]):
(-[UserContentWorldRemoteObject didObserveNormalWorld]):
(-[UserContentWorldRemoteObject didObserveWorldWithName:]):
* TestWebKitAPI/Tests/WebKit2Cocoa/_WKUserContentWorldPlugIn.mm: Added.
(-[_WKUserContentWorldPlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[_WKUserContentWorldPlugIn webProcessPlugInBrowserContextController:globalObjectIsAvailableForFrame:inScriptWorld:]):
* TestWebKitAPI/Tests/WebKit2Cocoa/_WKUserContentWorldProtocol.h: Added.

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

4 years agoRemove libqcms support
commit-queue@webkit.org [Fri, 26 Feb 2016 17:36:41 +0000 (17:36 +0000)]
Remove libqcms support
https://bugs.webkit.org/show_bug.cgi?id=154707

Patch by Martin Robinson <mrobinson@igalia.com> on 2016-02-26
Reviewed by Žan Doberšek.

No new tests. This change simply removes dead code.

* platform/image-decoders/ImageDecoder.h: Remove QCMS support.
(WebCore::ImageDecoder::qcmsOutputDeviceProfile): Deleted.
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Remove QCMS support.
(WebCore::JPEGImageReader::JPEGImageReader): Deleted.
(WebCore::JPEGImageReader::close): Deleted.
(WebCore::JPEGImageReader::decode): Deleted.
(WebCore::JPEGImageReader::colorTransform): Deleted.
(WebCore::JPEGImageReader::createColorTransform): Deleted.
(WebCore::JPEGImageDecoder::outputScanlines): Deleted.
* platform/image-decoders/png/PNGImageDecoder.cpp: Remove QCMS support.
(WebCore::PNGImageReader::PNGImageReader): Deleted.
(WebCore::PNGImageReader::close): Deleted.
(WebCore::PNGImageReader::rowBuffer): Deleted.
(WebCore::PNGImageReader::createRowBuffer): Deleted.
(WebCore::PNGImageReader::colorTransform): Deleted.
(WebCore::PNGImageReader::createColorTransform): Deleted.
(WebCore::PNGImageDecoder::headerAvailable): Deleted.
(WebCore::PNGImageDecoder::rowAvailable): Deleted.
(WebCore::PNGImageDecoder::frameComplete): Deleted.
* platform/image-decoders/webp/WEBPImageDecoder.cpp: Remove QCMS support.
(WebCore::WEBPImageDecoder::decode): Remove QCMS support.
(WebCore::WEBPImageDecoder::WEBPImageDecoder): Deleted.
(WebCore::WEBPImageDecoder::clear): Deleted.
(WebCore::WEBPImageDecoder::createColorTransform): Deleted.
(WebCore::WEBPImageDecoder::readColorProfile): Deleted.
(WebCore::WEBPImageDecoder::applyColorProfile): Deleted.
* platform/image-decoders/webp/WEBPImageDecoder.h: Remove QCMS support.
(WebCore::WEBPImageDecoder::colorTransform): Deleted.

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

4 years agoRenderTheme::controlSize* methods should take const RenderStyle&.
zalan@apple.com [Fri, 26 Feb 2016 17:36:03 +0000 (17:36 +0000)]
RenderTheme::controlSize* methods should take const RenderStyle&.
https://bugs.webkit.org/show_bug.cgi?id=154708

Reviewed by Darin Adler.

No change in functionality.

* rendering/RenderTheme.h:
(WebCore::RenderTheme::minimumMenuListSize):
(WebCore::RenderTheme::popupInternalPaddingLeft):
(WebCore::RenderTheme::popupInternalPaddingRight):
(WebCore::RenderTheme::popupInternalPaddingTop):
(WebCore::RenderTheme::popupInternalPaddingBottom):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::controlSizeForFont):
(WebCore::RenderThemeMac::sizeForFont):
(WebCore::RenderThemeMac::sizeForSystemFont):
(WebCore::RenderThemeMac::controlSizeForSystemFont):
(WebCore::RenderThemeMac::minimumProgressBarHeight):
(WebCore::RenderThemeMac::popupInternalPaddingLeft):
(WebCore::RenderThemeMac::popupInternalPaddingRight):
(WebCore::RenderThemeMac::popupInternalPaddingTop):
(WebCore::RenderThemeMac::popupInternalPaddingBottom):
(WebCore::RenderThemeMac::minimumMenuListSize):

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

4 years agoWeb Inspector: Option-clicking on the a CSS property sometimes doesn't work
commit-queue@webkit.org [Fri, 26 Feb 2016 17:15:11 +0000 (17:15 +0000)]
Web Inspector: Option-clicking on the a CSS property sometimes doesn't work
https://bugs.webkit.org/show_bug.cgi?id=154384
<rdar://problem/24714755>

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-26
Reviewed by Timothy Hatcher.

It seems as though there were race conditions between CodeMirror's event
and the native mousemove such that if CodeMirror fired second, the current
candidate was cleared, and would not reset itself until the cursor was
moved, at which point the same issue could happen. To fix this, the current
candidate is no longer cleared by CodeMirror's event and is instead only
modified by the native mouse-events.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._hidePopover):

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

4 years ago[Darwin] Use vm_kernel_page_size for WTF::pageSize().
akling@apple.com [Fri, 26 Feb 2016 17:04:18 +0000 (17:04 +0000)]
[Darwin] Use vm_kernel_page_size for WTF::pageSize().
<https://webkit.org/b/154726>

Reviewed by Antti Koivisto.

Source/WebKit2:

Use WTF::pageSize() for the SharedMemory page size.

* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::systemPageSize):

Source/WTF:

Make sure we use the right VM page size on Darwin systems.
On devices where the native page size is 4 KB, it's both
possible and profitable to madvise in smaller chunks.

* wtf/PageBlock.cpp:
(WTF::systemPageSize):

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

4 years agoREGRESSION (188611): Search field Cancel button should not overlap search text on...
zalan@apple.com [Fri, 26 Feb 2016 17:00:50 +0000 (17:00 +0000)]
REGRESSION (188611): Search field Cancel button should not overlap search text on extensions page.
https://bugs.webkit.org/show_bug.cgi?id=154692
<rdar://problem/22840453>

Reviewed by Brent Fulgham.

Adjust the cancel button position using the actual size of the cancel button.

When the input box and the font height trigger different cancel button sizes, we need to readjust
the rectangle returned by cancelButtonRectForBounds.
This fixes both the mispositioned cancel button and the squared off icon when the input field is zoomed all the way in.

Covered by existing tests.

Source/WebCore:

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::cancelButtonSizes): Update button size.

LayoutTests:

* fast/forms/search/search-padding-cancel-results-buttons-expected.txt:
* platform/mac/fast/css/focus-ring-exists-for-search-field-expected.txt:
* platform/mac/fast/css/text-input-with-webkit-border-radius-expected.txt:
* platform/mac/fast/css/text-overflow-input-expected.txt:
* platform/mac/fast/forms/box-shadow-override-expected.txt:
* platform/mac/fast/forms/control-restrict-line-height-expected.txt:
* platform/mac/fast/forms/input-appearance-height-expected.txt:
* platform/mac/fast/forms/placeholder-position-expected.txt:
* platform/mac/fast/forms/placeholder-pseudo-style-expected.txt:
* platform/mac/fast/forms/search-cancel-button-style-sharing-expected.txt:
* platform/mac/fast/forms/search-display-none-cancel-button-expected.txt:
* platform/mac/fast/forms/search-rtl-expected.txt:
* platform/mac/fast/forms/search-styled-expected.txt:
* platform/mac/fast/forms/search-vertical-alignment-expected.txt:
* platform/mac/fast/forms/search/search-size-with-decorations-expected.txt:
* platform/mac/fast/forms/searchfield-heights-expected.txt:
* platform/mac/fast/repaint/search-field-cancel-expected.txt:
* platform/mac/fast/replaced/width100percent-searchfield-expected.txt:

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

4 years ago[cmake] Moved WebKit/Storage sources and include dir to CMakeLists.txt.
commit-queue@webkit.org [Fri, 26 Feb 2016 16:47:29 +0000 (16:47 +0000)]
[cmake] Moved WebKit/Storage sources and include dir to CMakeLists.txt.
https://bugs.webkit.org/show_bug.cgi?id=154722

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-26
Reviewed by Darin Adler.

This code provides port-independent layer used by all WK1 ports,
so it belongs to main CMakeLists.txt, not Platform files.

* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWin.cmake:

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

4 years agoImplement ::slotted pseudo element
antti@apple.com [Fri, 26 Feb 2016 14:57:01 +0000 (14:57 +0000)]
Implement ::slotted pseudo element
https://bugs.webkit.org/show_bug.cgi?id=149441
<rdar://problem/22731987>

Reviewed by Andreas Kling.

Source/WebCore:

Based on latest in https://github.com/w3c/webcomponents/issues/331

* css/CSSGrammar.y.in:

    Parse ::slotted.

* css/CSSParser.cpp:
(WebCore::CSSParser::detectFunctionTypeToken):
* css/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
(WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector):

    Tokenize ::slotted.

(WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
* css/CSSParserValues.h:
* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId):
* css/CSSSelector.h:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAuthorRules):
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):

    Match ::slotted selector.

(WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):

    Collect ::slotted rules that may apply to an element in a slot.

(WebCore::ElementRuleCollector::matchUserRules):
(WebCore::ElementRuleCollector::matchUARules):
(WebCore::findSlottedPseudoElementSelector):
(WebCore::ElementRuleCollector::ruleMatches):
* css/ElementRuleCollector.h:
* css/RuleSet.cpp:
(WebCore::RuleSet::addRule):

    Collect ::slotted rules.

(WebCore::RuleSet::shrinkToFit):
* css/RuleSet.h:
(WebCore::RuleSet::hostPseudoClassRules):
(WebCore::RuleSet::slottedPseudoElementRules):
(WebCore::RuleSet::focusPseudoClassRules):
(WebCore::RuleSet::universalRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):

    Disable style sharing for children of shadow host. They may be affected by the shadow tree style
    which is not considered in style sharing checks.

LayoutTests:

* fast/shadow-dom/css-scoping-shadow-slotted-rule.html:

    Enable the test, fix it and update it to the current spec.

* fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt: Added.
* fast/shadow-dom/slotted-pseudo-element-css-text.html: Added.

    Add parsing/cssText test based on a Blink test.
    There are a few failures due to * not roundtripping and the parser being too lenient with pseudo elements.

* platform/mac/TestExpectations:

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

4 years ago[DFG] Drop unnecessary proved type branch in ToPrimitive
utatane.tea@gmail.com [Fri, 26 Feb 2016 11:49:49 +0000 (11:49 +0000)]
[DFG] Drop unnecessary proved type branch in ToPrimitive
https://bugs.webkit.org/show_bug.cgi?id=154716

Reviewed by Geoffrey Garen.

This branching based on the proved types is unnecessary because this is already handled in constant folding phase.
In fact, the DFGSpeculativeJIT64.cpp case is already removed in r164243.
This patch removes the remaining JIT32_64 case.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

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

4 years agoW3C test importer should have an option to clean the destination directory
youenn.fablet@crf.canon.fr [Fri, 26 Feb 2016 10:10:06 +0000 (10:10 +0000)]
W3C test importer should have an option to clean the destination directory
https://bugs.webkit.org/show_bug.cgi?id=152685

Reviewed by Darin Adler.

Adding --clean-dest-dir option to W3C test importer.
When this option is set, all files in the destination directory will be deleted
except for WebKit specific files (test expectations, .gitignore...) before new tests import.
Dangling test expectations are removed after tests import.'

Adding unit test and minor refactoring for the other tests.

* Scripts/webkitpy/w3c/test_importer.py:
(parse_args): Add '--clean-dest-dir' option.
(TestImporter.do_import):
(TestImporter._is_baseline): helper routine to capture -expected.txt files.
(TestImporter):
(TestImporter._should_not_keep_when_importing): helper routine to filter files that should not be cleaned before importing.
(TestImporter.clean_destination_directory):
(TestImporter.remove_dangling_expectations):
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest._parse_options):
(TestImporterTest.test_import_dir_with_no_tests_and_no_hg):
(TestImporterTest.test_import_dir_with_no_tests):
(TestImporterTest.test_import_dir_with_empty_init_py):
(test_clean_directory_option):

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

4 years agoSync web-platform-tests up to revision 5ca8b46
youenn.fablet@crf.canon.fr [Fri, 26 Feb 2016 08:55:07 +0000 (08:55 +0000)]
Sync web-platform-tests up to revision 5ca8b46
https://bugs.webkit.org/show_bug.cgi?id=154678

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* resources/ImportExpectations: Unskipped some tests (already imported tests) and skipped new tests added to WPT repo.
* resources/TestRepositories: Update revision to 5ca8b46.
* resources/web-platform-tests-modules.json:
* web-platform-tests/XMLHttpRequest/FormData-append-expected.txt:
* web-platform-tests/XMLHttpRequest/FormData-append.html:
* web-platform-tests/XMLHttpRequest/OWNERS: Added.
* web-platform-tests/XMLHttpRequest/event-readystate-sync-open-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/event-readystate-sync-open.htm: Added.
* web-platform-tests/XMLHttpRequest/formdata-delete-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/formdata-delete.htm: Added.
* web-platform-tests/XMLHttpRequest/formdata-get-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/formdata-get.htm: Added.
* web-platform-tests/XMLHttpRequest/formdata-has-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/formdata-has.htm: Added.
* web-platform-tests/XMLHttpRequest/formdata-set-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/formdata-set.htm: Added.
* web-platform-tests/XMLHttpRequest/interfaces-expected.txt:
* web-platform-tests/XMLHttpRequest/open-method-responsetype-set-sync-expected.txt:
* web-platform-tests/XMLHttpRequest/open-method-responsetype-set-sync.htm:
* web-platform-tests/XMLHttpRequest/open-url-encoding-expected.txt:
* web-platform-tests/XMLHttpRequest/open-url-encoding.htm:
* web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt:
* web-platform-tests/XMLHttpRequest/responsexml-document-properties.htm:
* web-platform-tests/XMLHttpRequest/responsexml-get-twice-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/responsexml-get-twice.htm: Added.
* web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt:
* web-platform-tests/XMLHttpRequest/w3c-import.log:
* web-platform-tests/common/OWNERS: Added.
* web-platform-tests/common/w3c-import.log:
* web-platform-tests/dom/OWNERS: Added.
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.html: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.svg: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xml: Added.
* web-platform-tests/dom/nodes/Document-createEvent-expected.txt:
* web-platform-tests/dom/nodes/Document-createEvent.html:
* web-platform-tests/dom/nodes/MutationObserver-childList-expected.txt:
* web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt:
* web-platform-tests/dom/w3c-import.log:
* web-platform-tests/domparsing/DOMParser-parseFromString-html-expected.txt:
* web-platform-tests/domparsing/OWNERS: Added.
* web-platform-tests/domparsing/w3c-import.log:
* web-platform-tests/fetch/OWNERS: Added.
* web-platform-tests/fetch/api/headers/headers-combine-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-nameshake-expected.txt.
* web-platform-tests/fetch/api/headers/headers-combine.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-nameshake.html.
* web-platform-tests/fetch/api/headers/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/domparsing/w3c-import.log.
* web-platform-tests/fetch/api/request/request-clone.sub.html:
* web-platform-tests/fetch/api/request/request-consume.html:
* web-platform-tests/fetch/api/request/request-error-expected.txt:
* web-platform-tests/fetch/api/request/request-error.html:
* web-platform-tests/fetch/api/request/request-idl-expected.txt:
* web-platform-tests/fetch/api/request/request-init-001.sub-expected.txt:
* web-platform-tests/fetch/api/request/request-init-001.sub.html:
* web-platform-tests/fetch/api/request/request-init-003.sub.html:
* web-platform-tests/fetch/api/request/w3c-import.log: Added.
* web-platform-tests/fetch/api/resources/method.py:
(main):
* web-platform-tests/fetch/api/resources/utils.js:
(checkRequest):
(readTextStream):
* web-platform-tests/fetch/api/resources/w3c-import.log: Added.
* web-platform-tests/fetch/api/response/response-clone.html:
* web-platform-tests/fetch/api/response/response-consume.html:
* web-platform-tests/fetch/api/response/response-error-expected.txt:
* web-platform-tests/fetch/api/response/response-error.html:
* web-platform-tests/fetch/api/response/response-idl-expected.txt:
* web-platform-tests/fetch/api/response/response-idl.html:
* web-platform-tests/fetch/api/response/response-init-002.html:
* web-platform-tests/fetch/api/response/response-static-error.html:
* web-platform-tests/fetch/api/response/response-static-redirect-expected.txt:
* web-platform-tests/fetch/api/response/response-static-redirect.html:
* web-platform-tests/fetch/api/response/w3c-import.log: Added.
* web-platform-tests/fetch/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/w3c-import.log.
* web-platform-tests/html/OWNERS: Added.
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces.html:
* web-platform-tests/html/dom/w3c-import.log:
* web-platform-tests/html/semantics/document-metadata/the-base-element/base_multiple.html:
* web-platform-tests/html/semantics/embedded-content/media-elements/historical-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/historical.html:
* web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-document-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-document.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-iframe-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-iframe.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-embed-element/w3c-import.log:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-media-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-media.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-img-element/w3c-import.log:
* web-platform-tests/html/semantics/forms/textfieldselection/w3c-import.log:
* web-platform-tests/html/semantics/forms/the-input-element/checkbox.html:
* web-platform-tests/html/semantics/forms/the-input-element/radio.html:
* web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html:
* web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-radio-expected.txt: Added.
* web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html: Added.
* web-platform-tests/html/semantics/selectors/pseudo-classes/w3c-import.log:
* web-platform-tests/html/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/w3c-import.log.
* web-platform-tests/images/OWNERS: Added.
* web-platform-tests/images/w3c-import.log:
* web-platform-tests/lint.whitelist:
* web-platform-tests/media/OWNERS: Added.
* web-platform-tests/media/w3c-import.log:
* web-platform-tests/service-workers/OWNERS: Added.
* web-platform-tests/service-workers/cache-storage/OWNERS: Added.
* web-platform-tests/service-workers/cache-storage/resources/credentials-iframe.html: Added.
* web-platform-tests/service-workers/cache-storage/resources/credentials-worker.js: Added.
(assert_equals):
(self.onfetch):
(self.onmessage):
* web-platform-tests/service-workers/cache-storage/resources/test-helpers.js:
(response.new.Response):
(assert_response_equals):
(assert_response_array_equivalent):
(assert_response_array_equals):
(assert_response_in_array):
* web-platform-tests/service-workers/cache-storage/resources/testharness-helpers.js:
* web-platform-tests/service-workers/cache-storage/resources/w3c-import.log:
* web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js:
(cache_test):
* web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js:
(request.new.Request.entries.a.request.clone):
(return.cache.match.entries.non_2xx_response.request.url.then):
(return.cache.match.entries.error_response.request.url.then):
(return.cache.match.string_appeared_here.then): Deleted.
(return.cache.match.entries.a.request.url.then): Deleted.
(return.cache.match.entries.a.request.then): Deleted.
(return.cache.match.new.Request.entries.a.request.url.then): Deleted.
(then): Deleted.
(return.cache.match.entries.cat.request.url.string_appeared_here.then): Deleted.
(cache_test): Deleted.
(return.cache.match.request.then): Deleted.
* web-platform-tests/service-workers/cache-storage/script-tests/cache-matchAll.js: Added.
(return.cache.matchAll.string_appeared_here.then):
(return.cache.matchAll.entries.a.request.url.then):
(return.cache.matchAll.entries.a.request.then):
(return.cache.matchAll.new.Request.entries.a.request.url.then):
(then):
(return.cache.matchAll.entries.cat.request.url.string_appeared_here.then):
* web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js:
(cache_test):
* web-platform-tests/service-workers/cache-storage/script-tests/cache-storage.js:
(promise_test):
* web-platform-tests/service-workers/cache-storage/script-tests/w3c-import.log:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https.html:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-matchAll.https.html: Copied from LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https.html.
* web-platform-tests/service-workers/cache-storage/serviceworker/credentials.html: Added.
* web-platform-tests/service-workers/cache-storage/serviceworker/w3c-import.log:
* web-platform-tests/service-workers/cache-storage/w3c-import.log:
* web-platform-tests/service-workers/cache-storage/window/cache-match.https.html:
* web-platform-tests/service-workers/cache-storage/window/cache-matchAll.https.html: Copied from LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https.html.
* web-platform-tests/service-workers/cache-storage/window/w3c-import.log:
* web-platform-tests/service-workers/cache-storage/worker/cache-match.https.html:
* web-platform-tests/service-workers/cache-storage/worker/cache-matchAll.https.html: Copied from LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-match.https.html.
* web-platform-tests/service-workers/cache-storage/worker/w3c-import.log:
* web-platform-tests/service-workers/w3c-import.log:
* web-platform-tests/streams/README.txt: Removed.
* web-platform-tests/streams/byte-length-queuing-strategy.https-expected.txt: Added.
* web-platform-tests/streams/byte-length-queuing-strategy.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/byte-length-queuing-strategy.html.
* web-platform-tests/streams/byte-length-queuing-strategy.js:
(test):
* web-platform-tests/streams/count-queuing-strategy.https-expected.txt: Added.
* web-platform-tests/streams/count-queuing-strategy.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/count-queuing-strategy.html.
* web-platform-tests/streams/count-queuing-strategy.js:
(test):
* web-platform-tests/streams/readable-streams/bad-strategies.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/bad-strategies.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.html.
* web-platform-tests/streams/readable-streams/bad-strategies.js:
(get string_appeared_here):
(test):
(promise_test):
* web-platform-tests/streams/readable-streams/bad-underlying-sources.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/bad-underlying-sources.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.html.
* web-platform-tests/streams/readable-streams/brand-checks.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/brand-checks.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/brand-checks.html.
* web-platform-tests/streams/readable-streams/cancel.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/cancel.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/cancel.html.
* web-platform-tests/streams/readable-streams/count-queuing-strategy-integration.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/count-queuing-strategy-integration.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/count-queuing-strategy-integration.html.
* web-platform-tests/streams/readable-streams/garbage-collection.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/garbage-collection.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.html.
* web-platform-tests/streams/readable-streams/general.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/general.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/general.html.
* web-platform-tests/streams/readable-streams/general.js:
(test):
(promise_test):
* web-platform-tests/streams/readable-streams/pipe-through.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/pipe-through.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/pipe-through.html.
* web-platform-tests/streams/readable-streams/readable-stream-reader.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/readable-stream-reader.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/readable-stream-reader.html.
* web-platform-tests/streams/readable-streams/readable-stream-reader.js:
(test):
* web-platform-tests/streams/readable-streams/tee.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/tee.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.html.
* web-platform-tests/streams/readable-streams/templated.https-expected.txt: Added.
* web-platform-tests/streams/readable-streams/templated.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/templated.html.
* web-platform-tests/streams/readable-streams/w3c-import.log: Added.
* web-platform-tests/streams/resources/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/domparsing/w3c-import.log.
* web-platform-tests/streams/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/w3c-import.log.

LayoutTests:

* platform/mac/TestExpectations: Renaming test filenames, and adding test expectation to area-coords.html.

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

4 years ago[EFL] Remove WebUIPopupMenuClient
ryuan.choi@navercorp.com [Fri, 26 Feb 2016 06:45:41 +0000 (06:45 +0000)]
[EFL] Remove WebUIPopupMenuClient
https://bugs.webkit.org/show_bug.cgi?id=154717

Reviewed by Gyuyoung Kim.

WebUIPopupMenuClient is only for EFL to expose WebPopupMenuProxy and WebPopupItem to WK C APIs.
This patch removes it and related code.

* PlatformEfl.cmake: Removed WKPopupItem related files from source list.
* UIProcess/API/C/efl/WKAPICastEfl.h: Removed WKPopupMenu related code.
* UIProcess/API/C/efl/WKPageEfl.cpp: Removed.
* UIProcess/API/C/efl/WKPageEfl.h: Removed.
* UIProcess/API/C/efl/WKPopupItem.cpp: Removed.
* UIProcess/API/C/efl/WKPopupItem.h: Removed.
* UIProcess/API/C/efl/WKPopupMenuListener.cpp: Removed.
* UIProcess/API/C/efl/WKPopupMenuListener.h: Removed.
* UIProcess/API/efl/EwkView.cpp:
(EwkView::requestPopupMenu):
* UIProcess/API/efl/EwkView.h:
* UIProcess/API/efl/ewk_popup_menu.cpp:
(EwkPopupMenu::EwkPopupMenu):
(EwkPopupMenu::close):
(EwkPopupMenu::setSelectedIndex):
* UIProcess/API/efl/ewk_popup_menu_item.cpp: Used WebPopupItem and others instead of WK C APIs.
* UIProcess/API/efl/ewk_popup_menu_item_private.h: Ditto.
* UIProcess/API/efl/ewk_popup_menu_private.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close): Removed unnecessary EFL guards.
(WebKit::WebPageProxy::showPopupMenu): Ditto.
(WebKit::WebPageProxy::hidePopupMenu): Ditto.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPopupMenuProxy.h:
* UIProcess/efl/PageUIClientEfl.cpp: Removed WKPopupMenuListener related code.
(WebKit::PageUIClientEfl::PageUIClientEfl): Deleted.
(WebKit::PageUIClientEfl::showPopupMenu): Deleted.
(WebKit::PageUIClientEfl::hidePopupMenu): Deleted.
* UIProcess/efl/PageUIClientEfl.h:
* UIProcess/efl/WebPageProxyEfl.cpp:
(WebKit::WebPageProxy::initializeUIPopupMenuClient): Deleted.
* UIProcess/efl/WebPopupMenuListenerEfl.cpp:
(WebKit::WebPopupMenuListenerEfl::WebPopupMenuListenerEfl): Deleted.
(WebKit::WebPopupMenuListenerEfl::valueChanged): Deleted.
* UIProcess/efl/WebPopupMenuListenerEfl.h:
(WebKit::WebPopupMenuListenerEfl::create): Deleted.
* UIProcess/efl/WebPopupMenuProxyEfl.cpp: Used WebPopupItem and others instead of WK C APIs.
* UIProcess/efl/WebPopupMenuProxyEfl.h: Ditto.
(WebKit::WebPopupMenuProxyEfl::create):
* UIProcess/efl/WebUIPopupMenuClient.cpp: Removed.
* UIProcess/efl/WebUIPopupMenuClient.h: Removed.
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::createPopupMenuProxy): Used WebPopupItem and others instead of WK C APIs.

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

4 years agoFont size computed style is innaccurate
mmaxfield@apple.com [Fri, 26 Feb 2016 06:38:53 +0000 (06:38 +0000)]
Font size computed style is innaccurate
https://bugs.webkit.org/show_bug.cgi?id=154705
<rdar://problem/23474068>

Reviewed by Timothy Hatcher.

Source/WebCore:

Safari rounds the font size value reported to getComputedStyle(). Neither Firefox
nor Chrome do this.

Covered by existing tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
(WebCore::fontSizeFromStyle):

LayoutTests:

Update expected results.

* css3/calc/font-size-fractional-expected.txt:
* css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html:
* css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt:
* editing/mac/attributed-string/font-size-expected.txt:
* editing/mac/attributed-string/vertical-align-expected.txt:
* platform/mac-mavericks/editing/mac/attributed-string/font-size-expected.txt:
* platform/mac-mavericks/editing/mac/attributed-string/vertical-align-expected.txt:
* platform/mac-yosemite/editing/mac/attributed-string/font-size-expected.txt:
* platform/mac-yosemite/editing/mac/attributed-string/vertical-align-expected.txt:

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

4 years ago[JSC] Be aggressive with OSR Entry to FTL if the DFG function was only used for OSR...
commit-queue@webkit.org [Fri, 26 Feb 2016 05:59:48 +0000 (05:59 +0000)]
[JSC] Be aggressive with OSR Entry to FTL if the DFG function was only used for OSR Entry itself
https://bugs.webkit.org/show_bug.cgi?id=154575

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

I noticed that imaging-gaussian-blur spends most of its
samples in DFG code despite executing most of the loop
iterations in FTL.

On this particular test, the main function is only entered
once and have a very heavy loop there. What happens is DFG
starts by compiling the full function in FTL. That takes about
8 to 10 milliseconds during which the DFG code makes very little
progress. The calls to triggerOSREntryNow() try to OSR Enter
for a while then finally start compiling something. By the time
the function is ready, we have wasted a lot of time in DFG code.

What this patch does is set a flag when a DFG function is entered.
If we try to triggerOSREntryNow() and the flag was never set,
we start compiling both the full function and the one for OSR Entry.

* dfg/DFGJITCode.h:
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileEntryExecutionFlag):
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGJITCompiler.h:
* dfg/DFGOperations.cpp:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::Plan): Deleted.
* dfg/DFGPlan.h:
* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::TierUpCheckInjectionPhase::run):

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

4 years agoREGRESSION(r195795): [WK2] fast/text/crash-complex-text-surrogate.html is flakey
mmaxfield@apple.com [Fri, 26 Feb 2016 05:20:54 +0000 (05:20 +0000)]
REGRESSION(r195795): [WK2] fast/text/crash-complex-text-surrogate.html is flakey
https://bugs.webkit.org/show_bug.cgi?id=154709
<rdar://problem/24483596>

Reviewed by Dan Bernstein.

Tools:

Force auto-activation rules to a consistent state.

* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::InjectedBundle::platformInitialize):

LayoutTests:

* platform/mac-wk2/TestExpectations:

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

4 years ago[iOS] Enable PageCache backing store clearing optimization for WebKit2.
akling@apple.com [Fri, 26 Feb 2016 05:01:25 +0000 (05:01 +0000)]
[iOS] Enable PageCache backing store clearing optimization for WebKit2.
<https://webkit.org/b/154712>

Reviewed by Anders Carlsson.

We had an optimization for iOS where we'd tear down the compositing tree for
pages in the page cache, to save memory, but we were only enabling it when
instantiating a WebKit1 web view.

This patch enables the optimization for WebKit2 as well.

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

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

4 years ago[Web IDL] Mark DOMString parameters as nullable when they should be
cdumez@apple.com [Fri, 26 Feb 2016 04:36:37 +0000 (04:36 +0000)]
[Web IDL] Mark DOMString parameters as nullable when they should be
https://bugs.webkit.org/show_bug.cgi?id=154666

Reviewed by Darin Adler.

Source/WebCore:

Mark DOMString parameters as nullable when they should be. We previously
emulated nullable DOMString attributes by using:
[TreatNullAs=NullString, TreatUndefinedAs=NullString]
However, this was non-standard and very verbose. Also, developers would
sometimes forget the [TreatUndefinedAs=NullString] part and the behavior
would end up being wrong for undefined.

After this clean up, the non-standard [TreatUndefinedAs=NullString] is
no longer used so this patch drops support for it. Only
[TreatNullAs=NullString] remains and this one will be renamed to
[TreatNullAs=EmptyString] via Bug 154654 to match Web IDL standard.

Tests: fast/dom/Element/getElementsByTagNameNS-nullable.html
       fast/dom/Node/nullable-parameters.html
       fast/events/storageevent-initStorageEvent-nullable.html

* Modules/mediastream/RTCPeerConnection.idl:
Drop [TreatUndefinedAs=NullString] from createDataChannel()'s first
parameter instead of marking it as nullable. This matches the
specification:
- http://w3c.github.io/webrtc-pc/#rtcpeerconnection-interface-extensions-1
This means there is a slight behavior change when undefined is passed, it
now becomes the string "undefined" instead of a null String.

* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
Drop handling of [TreatUndefinedAs=] as it is no longer used.

* bindings/scripts/IDLAttributes.txt:
Drop support for [TreatUndefinedAs=] as it is no longer used.

* bindings/scripts/test/TestObj.idl:

* dom/DOMImplementation.idl:
Make a few parameters nullable and drop [TreatNullAs=NullString,
TreatUndefinedAs=NullString]. There is no web-exposed behavior
change.

* dom/Document.idl:
- Make a few parameters nullable and drop [TreatNullAs=NullString,
  TreatUndefinedAs=NullString]. There is no web-exposed behavior
  change from this.
- Drop these attributes from ObjC-specific bindings as they only
  matter to JS bindings.
- The namespaceURI parameter to getElementsByTagNameNS() is now marked
  as nullable even though it only treated null as a null String, not
  undefined. This was a bug and did not match the specification:
  https://dom.spec.whatwg.org/#document

* dom/Element.idl:
- Make a few parameters nullable and drop [TreatNullAs=NullString,
  TreatUndefinedAs=NullString]. There is no web-exposed behavior
  change from this.
- Drop these attributes from ObjC-specific bindings as they only
  matter to JS bindings.
- The namespaceURI parameter to getElementsByTagNameNS() is now marked
  as nullable even though it only treated null as a null String, not
  undefined. This was a bug and did not match the specification:
  https://dom.spec.whatwg.org/#interface-element

* dom/NamedNodeMap.idl:
Make a few parameters nullable and drop [TreatNullAs=NullString,
TreatUndefinedAs=NullString]. There is no web-exposed behavior
change from this.

* dom/Node.idl:
- Drop these attributes from isSupported() as this is not exposed
  to JS (only native bindings) and these attributes only matter to
  JS bindings.
- Make the first parameter to lookupPrefix() / isDefaultNamespace()
  and lookupNamespaceURI() nullable. Previously, we treated null
  as a null string but not undefined. There is therefore a slight
  behavior change but this matches the specification:
  https://dom.spec.whatwg.org/#node

* fileapi/Blob.idl:
* html/HTMLButtonElement.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
* page/DOMWindow.idl:
Make a few parameters nullable and drop [TreatNullAs=NullString,
TreatUndefinedAs=NullString]. There is no web-exposed behavior
change from this.

* storage/StorageEvent.idl:
Mark oldValueArg / newValueArg parameters to initStorageEvent()
as nullable. Previously, we only treated null as a null string,
not undefined. This is therefore a slight behavior change but
it matches the specification:
https://www.w3.org/TR/webstorage/#storageeventinit

LayoutTests:

Add test coverage for minor behavioral changes in this patch.

* fast/dom/Element/getElementsByTagNameNS-nullable-expected.txt: Added.
* fast/dom/Element/getElementsByTagNameNS-nullable.html: Added.
* fast/dom/Node/nullable-parameters-expected.txt: Added.
* fast/dom/Node/nullable-parameters.html: Added.
* fast/dom/Node/resources/testdoc.xml: Added.
* fast/dom/Node/resources/testdoc2.xml: Added.
* fast/events/storageevent-initStorageEvent-nullable-expected.txt: Added.
* fast/events/storageevent-initStorageEvent-nullable.html: Added.

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

4 years ago[JSC] Temporal Dead Zone checks on "this" are eliminated when doing OSR Entry to FTL
benjamin@webkit.org [Fri, 26 Feb 2016 02:04:42 +0000 (02:04 +0000)]
[JSC] Temporal Dead Zone checks on "this" are eliminated when doing OSR Entry to FTL
https://bugs.webkit.org/show_bug.cgi?id=154664

Reviewed by Saam Barati.

When doing OSR Enter into a constructor, we lose the information
that this may have been set to empty by a previously executed block.

All the code just assumed the type for a FlushedJS value and thus
not an empty value. It was then okay to eliminate the TDZ checks.

In this patch, the values on root entry now assume they may be empty.
As a result, the SetArgument() for "this" has "empty" as possible
type and the TDZ checks are no longer eliminated.

* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::initialize):

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

4 years agoREGRESSION (r196744): NetworkExtension.framework and NEFilterSource class are not...
ddkilzer@apple.com [Fri, 26 Feb 2016 02:04:01 +0000 (02:04 +0000)]
REGRESSION (r196744): NetworkExtension.framework and NEFilterSource class are not available on Recovery partition
<http://webkit.org/b/154703>

Reviewed by Andy Estes.

* platform/cocoa/NetworkExtensionContentFilter.mm: Make
soft-linking of NetworkExtension.framework and NEFilterSource
class optional since they are not available on the Recovery
partition.  Note that NetworkExtensionContentFilter::enabled()
does not need to change since it already had the correct
behavior when getNEFilterSourceClass() returned nullptr.

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

4 years agoUpdate the definition of ENABLE_VIDEO_PRESENTATION_MODE for Mac platform
adachan@apple.com [Fri, 26 Feb 2016 02:03:22 +0000 (02:03 +0000)]
Update the definition of ENABLE_VIDEO_PRESENTATION_MODE for Mac platform
https://bugs.webkit.org/show_bug.cgi?id=154702

Reviewed by Dan Bernstein.

* Configurations/FeatureDefines.xcconfig:# Please enter the commit message for your changes. Lines starting

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

4 years agoSkipping flaky test storage/indexeddb/intversion-open-in-upgradeneeded.html on mac-wk2
ryanhaddad@apple.com [Fri, 26 Feb 2016 01:56:25 +0000 (01:56 +0000)]
Skipping flaky test storage/indexeddb/intversion-open-in-upgradeneeded.html on mac-wk2
https://bugs.webkit.org/show_bug.cgi?id=154706

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoUnreivewed build fix for r197150.
jiewen_tan@apple.com [Fri, 26 Feb 2016 01:33:37 +0000 (01:33 +0000)]
Unreivewed build fix for r197150.

* TestWebKitAPI/Tests/mac/IsNavigationActionTrusted.mm:

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

4 years agoRestrict information passed with navigation action which is triggered by untrusted...
jiewen_tan@apple.com [Fri, 26 Feb 2016 01:22:33 +0000 (01:22 +0000)]
Restrict information passed with navigation action which is triggered by untrusted event
https://bugs.webkit.org/show_bug.cgi?id=154571
<rdar://problem/15967937>

Reviewed by Andy Estes.

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::actionDictionary):

Source/WebKit2:

When navigation action is triggered by an untrusted event, we should be more restricted of
what information should be passed to the clients to lower the risk that clients could
be fooled by the untrusted event.

In this patch, we drop the modifiers for key state events and set the mouse button to NoButton
for mouse events.

* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/IsNavigationActionTrusted.mm: Added.
(-[WKNavigationActionDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(TestWebKitAPI::TEST):
(-[NavigationActionDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
* TestWebKitAPI/Tests/mac/IsNavigationActionTrusted.html: Added.

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

4 years agoChange ASSERT to RELEASE_ASSERT in SOFT_LINK_CLASS() macro
ddkilzer@apple.com [Fri, 26 Feb 2016 01:00:24 +0000 (01:00 +0000)]
Change ASSERT to RELEASE_ASSERT in SOFT_LINK_CLASS() macro

Follow-up fix noted by Andy Estes for:

    [Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
    <http://webkit.org/b/154364>

* platform/mac/SoftLinking.h:
(SOFT_LINK_CLASS): Change ASSERT to RELEASE_ASSERT to check the
return value of objc_getClass().  This matches what we do for
SOFT_LINK_CLASS_FOR_SOURCE().

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

4 years ago[iOS Simulator] http/tests/security/contentSecurityPolicy/1.1/plugintypes tests failing
dbates@webkit.org [Fri, 26 Feb 2016 00:58:11 +0000 (00:58 +0000)]
[iOS Simulator] http/tests/security/contentSecurityPolicy/1.1/plugintypes tests failing
https://bugs.webkit.org/show_bug.cgi?id=154652

Skip Content Security Policy plugin-types tests when run in the iOS simulator app because
plugins are not supported on iOS.

* platform/ios-simulator/TestExpectations:

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

4 years agoReplace RefCounter::Token implementation with RefPtr
barraclough@apple.com [Fri, 26 Feb 2016 00:54:13 +0000 (00:54 +0000)]
Replace RefCounter::Token implementation with RefPtr
https://bugs.webkit.org/show_bug.cgi?id=154698

Reviewed by Anders Carlsson.

* wtf/RefCounter.h:
(WTF::RefCounter::RefCounter):
(WTF::RefCounter::count):
(WTF::RefCounter::value):
(WTF::RefCounter<T>::~RefCounter):
(WTF::RefCounter::Token::Token): Deleted.
(WTF::RefCounter::Token::operator bool): Deleted.
(WTF::RefCounter<T>::Token::Token): Deleted.
(WTF::=): Deleted.
    - Delete.

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

4 years agoShould template RefCounter instead of RefCounter::Token
barraclough@apple.com [Fri, 26 Feb 2016 00:45:35 +0000 (00:45 +0000)]
Should template RefCounter instead of RefCounter::Token
https://bugs.webkit.org/show_bug.cgi?id=154691

Speculative windows build fix.

* wtf/RefCounter.h:
(WTF::RefCounter::RefCounter):
(WTF::RefCounter::count):

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

4 years ago[Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
mmaxfield@apple.com [Fri, 26 Feb 2016 00:33:39 +0000 (00:33 +0000)]
[Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
https://bugs.webkit.org/show_bug.cgi?id=143402

Reviewed by Alex Christensen.

.:

Turn on by default, and turn on for Windows.

EFL and GTK already explicitly disable it in OptionsEfl.cmake and OptionsGTK.cmake.

* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:

LayoutTests:

Rebaseline many tests.

There are some known bugs (which are marked in platform/win/TestExpecations):
webkit.org/b/137204 The SVG -> OTF Font converter outputs 'kern' tables instead of 'GPOS' tables
webkit.org/b/154690 SVG Fonts don't draw multibyte characters
webkit.org/b/137096 The SVG -> OTF Font Converter does not work with SVG's "altglyph" facility
webkit.org/b/137093 Same thing with the "lang" attribute

* platform/win/svg/W3C-SVG-1.1/fonts-desc-02-t-expected.txt: Added.
* platform/win/svg/W3C-SVG-1.1/text-text-06-t-expected.txt: Added.
* platform/win/TestExpectations:
* platform/win/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/filters-felem-01-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/painting-marker-07-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/pservers-grad-17-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/pservers-grad-20-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/pservers-pattern-03-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/styling-css-04-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/styling-pres-02-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/svgdom-over-01-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/text-tref-03-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/text-tspan-02-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/types-dom-05-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1/animate-elem-03-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/animate-elem-36-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/animate-elem-40-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/filters-light-04-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1/fonts-elem-05-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/fonts-elem-06-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1/masking-mask-01-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1/render-elems-06-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/render-elems-07-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/render-elems-08-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/render-groups-01-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1/render-groups-03-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/text-fonts-03-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt:
* platform/win/svg/batik/text/textEffect-expected.txt:
* platform/win/svg/batik/text/textEffect3-expected.txt:
* platform/win/svg/custom/glyph-selection-arabic-forms-expected.txt:
* platform/win/svg/custom/svg-fonts-in-html-expected.txt:
* platform/win/svg/custom/svg-fonts-with-no-element-reference-expected.txt: Added.
* platform/win/svg/custom/svg-fonts-word-spacing-expected.txt:
* platform/win/svg/foreignObject/text-tref-02-b-expected.txt:
* platform/win/svg/hixie/intrinsic/003-expected.txt:
* platform/win/svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures-expected.txt:
* platform/win/svg/text/text-text-04-t-expected.txt:
* platform/win/svg/text/text-text-05-t-expected.txt:
* platform/win/svg/text/text-text-06-t-expected.txt:
* platform/win/svg/wicd/test-rightsizing-b-expected.txt:
* platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
* platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:

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

4 years ago[ES6] for...in iteration doesn't comply with the specification
sbarati@apple.com [Fri, 26 Feb 2016 00:15:58 +0000 (00:15 +0000)]
[ES6] for...in iteration doesn't comply with the specification
https://bugs.webkit.org/show_bug.cgi?id=154665

Reviewed by Michael Saboff.

If you read ForIn/OfHeadEvaluation inside the spec:
https://tc39.github.io/ecma262/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind
It calls EnumerateObjectProperties(obj) to get a set of properties
to enumerate over (it models this "set" as en ES6 generator function).
EnumerateObjectProperties is defined in section 13.7.5.15:
https://tc39.github.io/ecma262/#sec-enumerate-object-properties
The implementation calls Reflect.getOwnPropertyDescriptor(.) on the
properties it sees. We must do the same by modeling the operation as
a [[GetOwnProperty]] instead of a [[HasProperty]] internal method call.

* jit/JITOperations.cpp:
* jit/JITOperations.h:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSObject.cpp:
(JSC::JSObject::hasProperty):
(JSC::JSObject::hasPropertyGeneric):
* runtime/JSObject.h:
* tests/stress/proxy-get-own-property.js:
(assert):
(let.handler.getOwnPropertyDescriptor):
(i.set assert):

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

4 years agoUnreviewed, rolling out r197137.
commit-queue@webkit.org [Thu, 25 Feb 2016 23:59:21 +0000 (23:59 +0000)]
Unreviewed, rolling out r197137.
https://bugs.webkit.org/show_bug.cgi?id=154700

broke windows build (Requested by alexchristensen on #webkit).

Reverted changeset:

"Replace RefCounter::Token implementation with RefPtr"
https://bugs.webkit.org/show_bug.cgi?id=154698
http://trac.webkit.org/changeset/197137

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

4 years agoCSP: Remove SecurityPolicy script interface
dbates@webkit.org [Thu, 25 Feb 2016 23:52:07 +0000 (23:52 +0000)]
CSP: Remove SecurityPolicy script interface
https://bugs.webkit.org/show_bug.cgi?id=154694
<rdar://problem/24846482>

Reviewed by Andy Estes.

Source/WebCore:

Remove the Content Security Policy script interface, SecurityPolicy. This interface was only
enabled when building with ENABLE(CSP_NEXT) (disabled by default).

For completeness, the SecurityPolicy interface was removed from the Content Security Policy 1.1 spec.
in <https://github.com/w3c/webappsec/commit/18882953ce2d8afca25f685557fef0e0471b2c9a> (12/26/2013).

* CMakeLists.txt: Remove files to DOMSecurityPolicy.{cpp, idl}.
* DerivedSources.cpp: Remove file JSDOMSecurityPolicy.cpp.
* DerivedSources.make: Remove file DOMSecurityPolicy.idl.
* PlatformGTK.cmake: Ditto.
* PlatformMac.cmake: Ditto.
* WebCore.xcodeproj/project.pbxproj: Remove files DOMSecurityPolicy files.
* bindings/scripts/CodeGeneratorGObject.pm: Remove reference to DOMSecurityPolicy.
* dom/Document.cpp:
(WebCore::Document::securityPolicy): Deleted.
* dom/Document.h:
* dom/Document.idl: Remove attribute securityPolicy.
* page/DOMSecurityPolicy.cpp: Removed.
* page/DOMSecurityPolicy.h: Removed.
* page/DOMSecurityPolicy.idl: Removed.

LayoutTests:

Remove SecurityPolicy tests and update platform-specific expected results as needed.

* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowconnectionto-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowconnectionto.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-alloweval-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-alloweval.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowfontfrom-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowfontfrom.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowformaction-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowformaction.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowframefrom-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowframefrom.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowimagefrom-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowimagefrom.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowinlinescript-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowinlinescript.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowinlinestyle-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowinlinestyle.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowmediafrom-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowmediafrom.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowobjectfrom-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowobjectfrom.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowplugintype-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowplugintype.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowscriptfrom-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowscriptfrom.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowstylefrom-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowstylefrom.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-isactive-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-isactive.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-reporturi-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-reporturi.html: Removed.
* http/tests/security/contentSecurityPolicy/resources/securitypolicy-tests-base.js: Removed.
* platform/gtk/js/dom/global-constructors-attributes-expected.txt: Update expected result as needed.
* platform/win/js/dom/global-constructors-attributes-expected.txt: Ditto.

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

4 years agoDon't clear the weak JSString cache on memory pressure.
akling@apple.com [Thu, 25 Feb 2016 23:24:41 +0000 (23:24 +0000)]
Don't clear the weak JSString cache on memory pressure.
<https://webkit.org/b/154693>

Reviewed by Antti Koivisto.

This was stupid. The cache is a WeakGCMap, so all the JSStrings pointed to are
still alive anyway. This way we keep the ability to deduplicate common strings.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseNoncriticalMemory): Deleted.

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

4 years agoDrop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
cdumez@apple.com [Thu, 25 Feb 2016 23:24:14 +0000 (23:24 +0000)]
Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
https://bugs.webkit.org/show_bug.cgi?id=154662

Reviewed by Darin Adler.

Source/WebCore:

Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute.
This has no standard equivalent and all uses in WebKit are either useless
or wrong.

Test: fast/frames/detached-frame-document-defaultCharset.html

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Deleted.
* bindings/scripts/IDLAttributes.txt:
Drop support for [TreatReturnedNullStringAs=X] entirely.

* dom/Document.cpp:
(WebCore::Document::defaultCharset):
Fall back to return "UTF-8" instead of the null string, similarly to
what is done in for Document.characterSet. Note that this attribute
is non-standard and is an IE extension. Firefox never supported it
and Chrome dropped it last year.

* dom/Document.idl:
- Drop extended attribute for Document.defaultCharset as the
  implementation has been updated to never return a null String.
- Drop extended attribute for Document.readyState. It was useless
  because the implementation could never return a null String.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::getAllResponseHeaders):
Update implementation to return emptyString() instead of "" in case
of error.

* xml/XMLHttpRequest.idl:
Drop extended attribute from XMLHttpRequest.getAllResponseHeaders().
It was useless because the implementation could never return a
null String.

* xml/XSLTProcessor.idl:
Drop extended attribute from XSLTProcessor.getParameter(). The
operation is already marked as [Custom] so the extended attribute
had no effect.

LayoutTests:

Add layout test to cover the return value of document.defaultCharset before
and after its frame is detached.

* fast/frames/detached-frame-document-defaultCharset-expected.txt: Added.
* fast/frames/detached-frame-document-defaultCharset.html: Added.

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

4 years agoUnreviewed test gardening.
beidson@apple.com [Thu, 25 Feb 2016 23:12:50 +0000 (23:12 +0000)]
Unreviewed test gardening.

Fix a test flake where order doesn't matter.

* platform/wk2/storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt: Removed.
* storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
* storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-private-expected.txt:
* storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
(prepareDatabase.request.onblocked):
(onOpenSuccess):

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