WebKit-https.git
4 years ago[WinCairo] GStreamer compile errors.
peavo@outlook.com [Tue, 6 Oct 2015 20:45:07 +0000 (20:45 +0000)]
[WinCairo] GStreamer compile errors.
https://bugs.webkit.org/show_bug.cgi?id=149839

Reviewed by Alex Christensen.

Help MSVC to resolve ambiguous calls.

* platform/graphics/MediaPlayer.h:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::handleSample):
(WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::videoChanged):
(WebCore::MediaPlayerPrivateGStreamer::videoCapsChanged):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::audioChanged):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::textChanged):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChanged):
(WebCore::MediaPlayerPrivateGStreamerBase::networkState):
(WebCore::MediaPlayerPrivateGStreamerBase::muteChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::activeChanged):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(webkitVideoSinkRender):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcChangeState):
(webKitWebSrcNeedDataCb):
(webKitWebSrcEnoughDataMainCb):
(webKitWebSrcEnoughDataCb):
(webKitWebSrcSeekMainCb):
(webKitWebSrcSeekDataCb):

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

4 years agoTake 2 on marking compositing/video/video-poster.html as flaky due to crashes.
commit-queue@webkit.org [Tue, 6 Oct 2015 20:43:36 +0000 (20:43 +0000)]
Take 2 on marking compositing/video/video-poster.html as flaky due to crashes.
https://bugs.webkit.org/show_bug.cgi?id=149819

Patch by Ryan Haddad <ryanhaddad@apple.com> on 2015-10-06
Reviewed by Alexey Proskuryakov.

* platform/mac-elcapitan/TestExpectations: Removed.
* platform/mac/TestExpectations:

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

4 years agoRefactor TokenPreloadScanner::StartTagScanner::processAttribute()
cdumez@apple.com [Tue, 6 Oct 2015 20:40:52 +0000 (20:40 +0000)]
Refactor TokenPreloadScanner::StartTagScanner::processAttribute()
https://bugs.webkit.org/show_bug.cgi?id=149847

Reviewed by Antti Koivisto.

Refactor TokenPreloadScanner::StartTagScanner::processAttribute() to only
process attributes that make sense given the current tagId. In particular,
- We only process the charset parameter if the tag is a link or a script.
- We only process the sizes / srcset attributes if the tag is an img.

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
(WebCore::TokenPreloadScanner::StartTagScanner::setUrlToLoad): Deleted.

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

4 years agoWeb Inspector: Fix spacing of FindBanner prev/next buttons
commit-queue@webkit.org [Tue, 6 Oct 2015 20:28:25 +0000 (20:28 +0000)]
Web Inspector: Fix spacing of FindBanner prev/next buttons
https://bugs.webkit.org/show_bug.cgi?id=149717

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2015-10-06
Reviewed by Darin Adler.

The sizing and spacing of the previous and next buttons in the FindBanner
is slightly off and should be readjusted to ensure that both buttons are
the same size and have the same spacing.

* UserInterface/Views/FindBanner.css:
(.find-banner > button.segmented.right > .glyph):
(.find-banner > button.segmented):
(.find-banner > button.segmented > .glyph):
(.find-banner > button.segmented.left): Deleted.
(.find-banner > button.segmented.left > .glyph): Deleted.
(.find-banner > button.segmented.right): Deleted.

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

4 years agoPost-review cleanup after r190572.
mmaxfield@apple.com [Tue, 6 Oct 2015 20:26:32 +0000 (20:26 +0000)]
Post-review cleanup after r190572.

Unreviewed.

* TestWebKitAPI/Tests/WebKit2/WKRetainPtr.cpp:

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

4 years agoTry to fix the 32-bit build.
andersca@apple.com [Tue, 6 Oct 2015 20:26:17 +0000 (20:26 +0000)]
Try to fix the 32-bit build.

* UIProcess/API/C/mac/WKPagePrivateMac.mm:

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

4 years agoBinding generator XXConstructor::finishCreation should take references as parameters
youenn.fablet@crf.canon.fr [Tue, 6 Oct 2015 20:14:08 +0000 (20:14 +0000)]
Binding generator XXConstructor::finishCreation should take references as parameters
https://bugs.webkit.org/show_bug.cgi?id=149838

Reviewed by Darin Adler.

Updated the binding generator so that XXConstructor::finishCreation
takes a JSDOMGlobalObject& in lieu of a JSDOMGlobalObject*.

Covered by rebased binding tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDeclaration):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObjectConstructor::create):
(WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallbackConstructor::create):
(WebCore::JSTestCallbackConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetterConstructor::create):
(WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::create):
(WebCore::JSTestEventConstructorConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetConstructor::create):
(WebCore::JSTestEventTargetConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestExceptionConstructor::create):
(WebCore::JSTestExceptionConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableConstructor::create):
(WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::create):
(WebCore::JSTestInterfaceConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorConstructor::create):
(WebCore::JSTestJSBuiltinConstructorConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerConstructor::create):
(WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorConstructor::create):
(WebCore::JSTestNamedConstructorNamedConstructor::create):
(WebCore::JSTestNamedConstructorConstructor::finishCreation):
(WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodeConstructor::create):
(WebCore::JSTestNodeConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::JSTestNondeterministicConstructor::create):
(WebCore::JSTestNondeterministicConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::create):
(WebCore::JSTestObjConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsConstructor::create):
(WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltinsConstructor::create):
(WebCore::JSTestOverrideBuiltinsConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::create):
(WebCore::JSTestTypedefsConstructor::finishCreation):
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::JSattributeConstructor::create):
(WebCore::JSattributeConstructor::finishCreation):
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::JSreadonlyConstructor::create):
(WebCore::JSreadonlyConstructor::finishCreation):

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

4 years ago[Win] Unreviewed build correction.
bfulgham@apple.com [Tue, 6 Oct 2015 20:08:57 +0000 (20:08 +0000)]
[Win] Unreviewed build correction.

* TestWebKitAPI/PlatformWin.cmake: We don't need to link to all of these libraries. Most
are soft-linked at runtime.

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

4 years agoFix crash in ApplyStyleCommand::applyRelativeFontStyleChange()
commit-queue@webkit.org [Tue, 6 Oct 2015 19:48:24 +0000 (19:48 +0000)]
Fix crash in ApplyStyleCommand::applyRelativeFontStyleChange()
https://bugs.webkit.org/show_bug.cgi?id=149300
<rdar://problem/22747046>

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2015-10-06
Reviewed by Chris Dumez.

Source/WebCore:

This is a merge of Blink r167845 and r194944:
https://codereview.chromium.org/177093016
https://codereview.chromium.org/1124863003

Test: editing/style/apply-style-crash2.html
      editing/style/apply-style-crash3.html

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
The issue was that we would traverse the DOM tree past the beyondEnd
under some circumstances and thus NodeTraversal::next() would return
null unexpectedly. This CL adds a check to make sure startNode != beyondEnd
before traversing to avoid the problem.

Besides that, this CL hardens changing font style over unknown elements.
When adjusting the start node position of where to apply a font style
command, check that we haven't stepped off the end.

This CL also adds a few more assertions to catch similar issues
more easily in the future.

LayoutTests:

* editing/style/apply-style-crash2-expected.txt: Added.
* editing/style/apply-style-crash2.html: Added.
* editing/style/apply-style-crash3-expected.txt: Added.
* editing/style/apply-style-crash3.html: Added.

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

4 years ago[CSS Grid Layout] Don't need to reset auto-margins during grid items layout
jfernandez@igalia.com [Tue, 6 Oct 2015 19:23:52 +0000 (19:23 +0000)]
[CSS Grid Layout] Don't need to reset auto-margins during grid items layout
https://bugs.webkit.org/show_bug.cgi?id=149764

Reviewed by Darin Adler.

Source/WebCore:

This patch implements a refactoring of the auto-margin alignment code for grid
items so it uses start/end and before/after margin logic terms.

I addition, it avoids resetting the auto-margin values, which requires an extra
layout, before applying the alignment logic.

No new tests because there is no behavior change.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeMarginLogicalHeightForChild): Computing margins if child needs layout.
(WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
(WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded): Using start/end logical margins.
(WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded): Using before/after logical margins.
(WebCore::RenderGrid::columnAxisOffsetForChild): Just added comment.
(WebCore::RenderGrid::rowAxisOffsetForChild): Just added comment.

LayoutTests:

Removed a duplicated layout tests.

* fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change-expected.txt: Removed.
* fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change.html: Removed.

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

4 years agoWeb Inspector: Simplify TimelineRecordBar a bit
commit-queue@webkit.org [Tue, 6 Oct 2015 19:13:46 +0000 (19:13 +0000)]
Web Inspector: Simplify TimelineRecordBar a bit
https://bugs.webkit.org/show_bug.cgi?id=149733

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

* UserInterface/Views/TimelineRecordBar.js:
(WebInspector.TimelineRecordBar.prototype.set records):

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

4 years agoWKPage needs to expose a KVO-compliant object, similar to WKWebView
andersca@apple.com [Tue, 6 Oct 2015 19:11:24 +0000 (19:11 +0000)]
WKPage needs to expose a KVO-compliant object, similar to WKWebView
https://bugs.webkit.org/show_bug.cgi?id=149851
rdar://problem/22382022

Reviewed by Dan Bernstein.

Move the PageLoadStateObserver object from WKBrowsingContextController out into a separate file and make it
work with any Objective-C object. Use it in WKObservablePageState and add a WKPageCreateObservableState function.

* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm: Renamed from Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp.
(-[WKObservablePageState initWithPage:]):
(-[WKObservablePageState dealloc]):
(-[WKObservablePageState isLoading]):
(-[WKObservablePageState title]):
(-[WKObservablePageState URL]):
(-[WKObservablePageState hasOnlySecureContent]):
(-[WKObservablePageState estimatedProgress]):
(WKPageCreateObservableState):
(WKPageGetProcessIdentifier):
(WKPageIsURLKnownHSTSHost):
* UIProcess/API/Cocoa/PageLoadStateObserver.h: Added.
(WebKit::PageLoadStateObserver::PageLoadStateObserver):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(PageLoadStateObserver::PageLoadStateObserver): Deleted.
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoFix run-javascriptcore-tests/run-jsc-stress-tests to work with rootless, add a -...
keith_miller@apple.com [Tue, 6 Oct 2015 18:45:04 +0000 (18:45 +0000)]
Fix run-javascriptcore-tests/run-jsc-stress-tests to work with rootless, add a --quick option and deprecate the Mozilla driver.
https://bugs.webkit.org/show_bug.cgi?id=149815

Reviewed by Filip Pizlo.

Rootless has an issue where it will strip any environment variables that start with DYLD starting a perl/ruby/python script.
Now, run-jsc-stress-tests takes an new argument, --env-vars, that will set the specified environment variables before
running tests. Additionally, I added a quick option that only runs default and the NoCJITValidate versions of each test.
Finally, I removed the calls to the mozilla jsDriver.pl since the run-jsc-stress-tests runner runs the same test suite
so should just use one test runner.

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):
(runMozillaTests): Deleted.
(defaultJsDriverArgsForMozillaTests): Deleted.
* Scripts/run-jsc-stress-tests:

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

4 years agoImport some Blink layout tests.
jhoneycutt@apple.com [Tue, 6 Oct 2015 18:39:21 +0000 (18:39 +0000)]
Import some Blink layout tests.
https://bugs.webkit.org/show_bug.cgi?id=149768

These are a subset of tests that don't time out and whose expected
results in Blink match the results in WebKit when run under DRT and
WKTR.

Reviewed by Andy Estes.

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

4 years agoTile map shows a green rect when threaded scrolling is disabled
timothy_horton@apple.com [Tue, 6 Oct 2015 18:20:29 +0000 (18:20 +0000)]
Tile map shows a green rect when threaded scrolling is disabled
https://bugs.webkit.org/show_bug.cgi?id=149716

Reviewed by Darin Adler.

Green is supposed to indicate that we're using the fast path; if threaded
scrolling is disabled, we're definitely not doing that.

* platform/graphics/TiledBacking.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::TileController):
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::update):
Default to the "we have no ScrollingCoordinator" purple indication;
if a ScrollingCoordinator comes along it will setScrollingModeIndication
and change it from this default.

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

4 years agoRemove redundant isComposited() function and replace
zalan@apple.com [Tue, 6 Oct 2015 18:06:34 +0000 (18:06 +0000)]
Remove redundant isComposited() function and replace
hasLayer() && layer()->isComposited() with RenderObject::isComposited().
https://bugs.webkit.org/show_bug.cgi?id=149846

Reviewed by Simon Fraser.

No change in functionality.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
(WebCore::RenderLayerCompositor::requiresCompositingForFrame):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintUsingContainer):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
* rendering/RenderView.cpp:
(WebCore::rendererObscuresBackground):
(WebCore::isComposited): Deleted.
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidgetGeometry):

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

4 years agoUnreviewed, rolling out r190619.
commit-queue@webkit.org [Tue, 6 Oct 2015 17:36:44 +0000 (17:36 +0000)]
Unreviewed, rolling out r190619.
https://bugs.webkit.org/show_bug.cgi?id=149849

borke the binding tests on iOS at least (Requested by youenn
on #webkit).

Reverted changeset:

"Binding generator XXConstructor::finishCreation should take
references as parameters"
https://bugs.webkit.org/show_bug.cgi?id=149838
http://trac.webkit.org/changeset/190619

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

4 years agoSlider knobs should scale when rendering while zoomed
wenson_hsieh@apple.com [Tue, 6 Oct 2015 17:28:02 +0000 (17:28 +0000)]
Slider knobs should scale when rendering while zoomed
https://bugs.webkit.org/show_bug.cgi?id=149835
<rdar://problem/22897080>

Reviewed by Darin Adler.

Make slider knobs follow suit with the rest of the unscaled form controls
by rendering to an offscreen buffer when the page is zoomed or scaled and
then rendering a scaled version of the offscreen buffer onto the page.

* platform/mac/ThemeMac.mm:
(WebCore::drawCellOrFocusRingIntoRectWithView): Helper function for drawing
    cells and/or focus rings.
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext): Refactored to
    handle drawing slider knobs as well.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSliderThumb): Use scaled rendering when necessary.

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

4 years ago[GTK] Make update-webkitgtk-libs work behind firewall
commit-queue@webkit.org [Tue, 6 Oct 2015 17:21:22 +0000 (17:21 +0000)]
[GTK] Make update-webkitgtk-libs work behind firewall

update-webkitgtk-libs can work behind a firewall with changes to
a few packages.  Where outbound git and active FTP connections
fail, using http protocol succeeds.  Most packages are
already accessed using http.

https://bugs.webkit.org/show_bug.cgi?id=148941

Patch by Mark Salisbury <mark.salisbury@hp.com> on 2015-10-06
Reviewed by Martin Robinson.

Tools
* gtk/jhbuild.modules:
    Replace git URLs with http.  Remove no longer used ftp repositories.
    Update argument for libxml2's autogen.sh script (--without-python
    is ignored; --with-python=no is correct).
* jhbuild/jhbuild-wrapper:
    Instead of connecting to git://git.gnome.org/jhbuild, connect to
    http://git.gnome.org/browse/jhbuild.

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

4 years ago[Web IDL] 'length' property is wrong for variadic operations
cdumez@apple.com [Tue, 6 Oct 2015 17:20:23 +0000 (17:20 +0000)]
[Web IDL] 'length' property is wrong for variadic operations
https://bugs.webkit.org/show_bug.cgi?id=149714

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C DOM test as our behavior changed. The new failures are
temporary and are due to the test being wrong. The test will be fixed
via Bug 149645 and we will pass those checks again.

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

Source/WebCore:

The value of the 'length' property was wrong for variadic operations:
- https://heycam.github.io/webidl/#dfn-optional-argument

The final argument of a variadic operation is considered to be an
optional argument. Therefore, we should not account for it when
computing the value of the 'length' property. This patch fixes WebKit's
behavior to match the specification.

Test: fast/dom/variadic-operations-length.html

* bindings/scripts/CodeGeneratorJS.pm:
(GetFunctionLength):
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):

LayoutTests:

Add a layout test to check that the value for the 'length' property of
variadic operations is correct.

* fast/dom/variadic-operations-length-expected.txt: Added.
* fast/dom/variadic-operations-length.html: Added.

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

4 years agoBinding generator should add builtin header for JSBuiltin attributes
youenn.fablet@crf.canon.fr [Tue, 6 Oct 2015 16:50:22 +0000 (16:50 +0000)]
Binding generator should add builtin header for JSBuiltin attributes
https://bugs.webkit.org/show_bug.cgi?id=149837

Reviewed by Darin Adler.

Ensured XXBuiltins.h header is included for builtin attributes.
Renamed AddIncludesForJSBuiltinMethods as AddJSBuiltinIncludesIfNeeded.
Test loop is done through all functions and attributes to handle conditional correctly.

Covered by existing and added binding tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(AddJSBuiltinIncludesIfNeeded):
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
* bindings/scripts/test/TestObj.idl:

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

4 years agoBinding generator XXConstructor::finishCreation should take references as parameters
youenn.fablet@crf.canon.fr [Tue, 6 Oct 2015 16:37:31 +0000 (16:37 +0000)]
Binding generator XXConstructor::finishCreation should take references as parameters
https://bugs.webkit.org/show_bug.cgi?id=149838

Reviewed by Darin Adler.

Updated the binding generator so that XXConstructor::finishCreation
takes a JSDOMGlobalObject& in lieu of a JSDOMGlobalObject*.

Covered by rebased binding tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDeclaration):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObjectConstructor::create):
(WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallbackConstructor::create):
(WebCore::JSTestCallbackConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetterConstructor::create):
(WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::create):
(WebCore::JSTestEventConstructorConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetConstructor::create):
(WebCore::JSTestEventTargetConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestExceptionConstructor::create):
(WebCore::JSTestExceptionConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableConstructor::create):
(WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::create):
(WebCore::JSTestInterfaceConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorConstructor::create):
(WebCore::JSTestJSBuiltinConstructorConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerConstructor::create):
(WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorConstructor::create):
(WebCore::JSTestNamedConstructorNamedConstructor::create):
(WebCore::JSTestNamedConstructorConstructor::finishCreation):
(WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodeConstructor::create):
(WebCore::JSTestNodeConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::JSTestNondeterministicConstructor::create):
(WebCore::JSTestNondeterministicConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::create):
(WebCore::JSTestObjConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsConstructor::create):
(WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltinsConstructor::create):
(WebCore::JSTestOverrideBuiltinsConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::create):
(WebCore::JSTestTypedefsConstructor::finishCreation):
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::JSattributeConstructor::create):
(WebCore::JSattributeConstructor::finishCreation):
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::JSreadonlyConstructor::create):
(WebCore::JSreadonlyConstructor::finishCreation):

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

4 years ago[Cairo] fast/canvas/canvas-imageSmoothingFoo tests failed after r190383.
commit-queue@webkit.org [Tue, 6 Oct 2015 16:35:01 +0000 (16:35 +0000)]
[Cairo] fast/canvas/canvas-imageSmoothingFoo tests failed after r190383.
https://bugs.webkit.org/show_bug.cgi?id=149752

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-10-06
Reviewed by Carlos Garcia Campos.

CG's low interpolation quality setting is equivalent to most other browsers default or high settings.

Source/WebCore:

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::State::State):

LayoutTests:

* platform/efl/fast/canvas/canvas-imageSmoothingQuality-expected.txt: Added.
* platform/gtk/fast/canvas/canvas-imageSmoothingQuality-expected.txt: Added.

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

4 years agoEnable XSLT when building WebKit for iOS using the public iOS SDK
dbates@webkit.org [Tue, 6 Oct 2015 16:33:21 +0000 (16:33 +0000)]
Enable XSLT when building WebKit for iOS using the public iOS SDK
https://bugs.webkit.org/show_bug.cgi?id=149827

Patch by Daniel Bates <dbates@webkit.org> on 2015-10-06
Reviewed by Alexey Proskuryakov.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

Teach script configure-xcode-for-ios-development to copy the OS X XSLT headers to the iPhoneOS
and iPhoneSimulator SDKs so as to support building WebKit for iOS with XSLT. A person must
run this script before building WebKit for iOS or the build will fail because one or more XSLT
headers cannot be found.

* Scripts/configure-xcode-for-ios-development:
(copyMissingXSLTHeadersToSDKIfNeeded): Added.

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

4 years ago[Win] Correct positioning error introduced in r190235
bfulgham@apple.com [Tue, 6 Oct 2015 16:28:38 +0000 (16:28 +0000)]
[Win] Correct positioning error introduced in r190235
https://bugs.webkit.org/show_bug.cgi?id=149631
<rdar://problem/22635080>

Reviewed by Simon Fraser.

Covered by existing compositing tests:
  css3/filters/clipping-overflow-scroll-with-pixel-moving-effect-on.html
  fast/layers/no-clipping-overflow-hidden-added-after-transform.html
  fast/layers/no-clipping-overflow-hidden-added-after-transition.html
  fast/layers/no-clipping-overflow-hidden-hardware-acceleration.html
  transforms/2d/preserve3d-not-fixed-container.html

* platform/graphics/ca/TileGrid.cpp:
(TileGrid::platformCALayerPaintContents): No need to do this extra flipping step
on Windows.
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::displayCallback): We should always flip the
coordinate system when drawing these layers on Windows.
(shouldInvertBeforeDrawingContent): Deleted.
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
(WebTiledBackingLayerWin::displayCallback): We do not need to flip coordinates
for these tiled layers; that's already accounted for in common tile drawing code.

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

4 years agoFix ENABLE_OPENGL=OFF builds
commit-queue@webkit.org [Tue, 6 Oct 2015 16:21:04 +0000 (16:21 +0000)]
Fix ENABLE_OPENGL=OFF builds
https://bugs.webkit.org/show_bug.cgi?id=146511

Patch by Emanuele Aina <emanuele.aina@collabora.com> on 2015-10-06
Reviewed by Darin Adler.

.:

* Source/cmake/OptionsGTK.cmake: Make ENABLE_WAYLAND_TARGET depend on
ENABLE_OPENGL due to EGL usage.

Source/WebCore:

* platform/graphics/texmap/BitmapTextureGL.h:
* platform/graphics/texmap/BitmapTextureGL.cpp:
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/texmap/TextureMapperShaderProgram.h:
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
Fix TEXTURE_MAPPER_GL vs. TEXTURE_MAPPER guards to make sure that
ENABLE_OPENGL=OFF only disables the GL-related parts.

Source/WebKit2:

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize):
(webkitWebViewBaseDraw):
(webkitWebViewBaseDidRelaunchWebProcess):
Replace USE(TEXTURE_MAPPER_GL) with USE(TEXTURE_MAPPER) around
webkitWebViewRenderAcceleratedCompositingResults()
* UIProcess/DrawingAreaProxyImpl.cpp:
* UIProcess/DrawingAreaProxyImpl.h:
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::DrawingArea):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/LayerTreeHost.h:
Replace USE(TEXTURE_MAPPER_GL) with USE(TEXTURE_MAPPER) around
setNativeSurfaceHandleForCompositing().
* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore):
Default to no AC if no GL support has been built.
* WebProcess/WebPage/DrawingArea.messages.in:
Replace USE(TEXTURE_MAPPER_GL) with USE(TEXTURE_MAPPER) around
SetNativeSurfaceHandleForCompositing.
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
Replace USE(TEXTURE_MAPPER_GL) with USE(TEXTURE_MAPPER) around
setNativeSurfaceHandleForCompositing().
(WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
Force setAcceleratedCompositingEnabled() only if a LayerTreeHost
implementation is available, to avoid crashing when building without
any GL support.

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

4 years agoFix Windows build after r190611.
achristensen@apple.com [Tue, 6 Oct 2015 14:23:09 +0000 (14:23 +0000)]
Fix Windows build after r190611.

* PlatformWin.cmake:
Forward headers from contentextensions.

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

4 years agoUse modern for-loops in WebCore/html.
commit-queue@webkit.org [Tue, 6 Oct 2015 13:31:14 +0000 (13:31 +0000)]
Use modern for-loops in WebCore/html.
https://bugs.webkit.org/show_bug.cgi?id=149662

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-10-06
Reviewed by Darin Adler.

No new tests because there is no behavior change.

* html/DOMFormData.cpp:
(WebCore::DOMFormData::DOMFormData):
* html/EmailInputType.cpp:
(WebCore::EmailInputType::typeMismatchFor):
* html/FileInputType.cpp:
(WebCore::FileInputType::receiveDroppedFiles):
* html/FormController.cpp:
(WebCore::FormControlState::serializeTo):
(WebCore::FormControlState::deserialize):
(WebCore::SavedFormState::serializeTo):
(WebCore::SavedFormState::getReferencedFilePaths):
(WebCore::FormController::createSavedFormStateMap):
(WebCore::FormController::formElementsState):
(WebCore::FormController::restoreControlStateIn):
(WebCore::FormController::getReferencedFilePaths):
* html/HTMLAnchorElement.cpp:
(WebCore::hasNonEmptyBox):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::~HTMLCanvasElement):
(WebCore::HTMLCanvasElement::notifyObserversCanvasChanged):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::length):
* html/HTMLFormControlsCollection.cpp:
(WebCore::firstNamedItem):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::~HTMLFormElement):
(WebCore::HTMLFormElement::formWouldHaveSecureSubmission):
(WebCore::HTMLFormElement::removedFrom):
(WebCore::HTMLFormElement::length):
(WebCore::HTMLFormElement::submitImplicitly):
(WebCore::HTMLFormElement::validateInteractively):
(WebCore::HTMLFormElement::getTextFieldValues):
(WebCore::HTMLFormElement::submit):
(WebCore::HTMLFormElement::reset):
(WebCore::HTMLFormElement::defaultButton):
(WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
(WebCore::HTMLFormElement::removeFromPastNamesMap):
(WebCore::HTMLFormElement::documentDidResumeFromPageCache):
* html/HTMLInputElement.cpp:
(WebCore::parseAcceptAttribute):
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::HTMLKeygenElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMediaGroup):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::index):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::saveLastSelection):
(WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
(WebCore::HTMLSelectElement::setActiveSelectionEndIndex):
(WebCore::HTMLSelectElement::selectedIndex):
(WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
(WebCore::HTMLSelectElement::saveFormControlState):
(WebCore::HTMLSelectElement::restoreFormControlState):
(WebCore::HTMLSelectElement::appendFormData):
(WebCore::HTMLSelectElement::reset):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setDefaultValue):
* html/InputType.cpp:
(WebCore::populateInputTypeFactoryMap):
* html/MediaController.cpp:
(MediaController::duration):
(MediaController::setCurrentTime):
(MediaController::play):
(MediaController::setPlaybackRate):
(MediaController::setVolume):
(MediaController::setMuted):
(playbackStateWaiting):
(MediaController::updateMediaElements):
(MediaController::bringElementUpToSpeed):
(MediaController::isBlocked):
(MediaController::hasEnded):
(MediaController::asyncEventTimerFired):
(MediaController::clearPositionTimerFired):
(MediaController::hasAudio):
(MediaController::hasVideo):
(MediaController::hasClosedCaptions):
(MediaController::setClosedCaptionsVisible):
(MediaController::supportsScanning):
(MediaController::beginScrubbing):
(MediaController::endScrubbing):
(MediaController::canPlay):
(MediaController::isLiveStream):
(MediaController::hasCurrentSrc):
(MediaController::returnToRealtime):
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseTimeFragment):
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::revoke):
(WebCore::PublicURLManager::stop):
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::getCachedMaxIndex):
(WebCore::WebGLBuffer::setCachedMaxIndex):
(WebCore::WebGLBuffer::setTarget):
* html/canvas/WebGLContextGroup.cpp:
(WebCore::WebGLContextGroup::loseContextGroup):
* html/canvas/WebGLDrawBuffers.cpp:
(WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
(WebCore::WebGLFramebuffer::checkStatus):
(WebCore::WebGLFramebuffer::deleteObjectImpl):
(WebCore::WebGLFramebuffer::initializeAttachments):
(WebCore::WebGLFramebuffer::drawBuffers):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::deleteTexture):
* html/canvas/WebGLVertexArrayObject.cpp:
(WebCore::WebGLVertexArrayObject::deleteObjectImpl):
* html/canvas/WebGLVertexArrayObjectOES.cpp:
(WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
* html/parser/AtomicHTMLToken.h:
(WebCore::AtomicHTMLToken::initializeAttributes):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
* html/parser/HTMLFormattingElementList.cpp:
(WebCore::HTMLFormattingElementList::ensureNoahsArkCondition):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
* html/parser/XSSAuditor.cpp:
(WebCore::semicolonSeparatedValueContainsJavaScriptURL):
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::distribute):
(WebCore::ContentDistributor::invalidate):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
(WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
* html/track/AudioTrackList.cpp:
(AudioTrackList::getTrackById):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newCuesAvailable):
(WebCore::LoadableTextTrack::newRegionsAvailable):
* html/track/TextTrackCueList.cpp:
(WebCore::TextTrackCueList::getCueById):
(WebCore::TextTrackCueList::activeCues):
* html/track/TextTrackList.cpp:
(TextTrackList::getTrackIndexRelativeToRenderedTracks):
(TextTrackList::invalidateTrackIndexesAfterTrack):
* html/track/TrackListBase.cpp:
(TrackListBase::isAnyTrackEnabled):
* html/track/VideoTrackList.cpp:
(VideoTrackList::getTrackById):

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

4 years agoURTBF after r190611.
ossy@webkit.org [Tue, 6 Oct 2015 09:41:00 +0000 (09:41 +0000)]
URTBF after r190611.

* CMakeLists.txt:

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

4 years agoReport error when main resource is blocked by content blocker
commit-queue@webkit.org [Tue, 6 Oct 2015 08:18:08 +0000 (08:18 +0000)]
Report error when main resource is blocked by content blocker
https://bugs.webkit.org/show_bug.cgi?id=149719
rdar://problem/21970595

Patch by Alex Christensen <achristensen@webkit.org> on 2015-10-06
Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/contentextensions/main-resource.html

* English.lproj/Localizable.strings:
* contentextensions/ContentExtensionActions.h:
* contentextensions/ContentExtensionError.h:
(WebCore::ContentExtensions::make_error_code):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
Instead of nulling out the ResourceRequest, processContentExtensionRulesForLoad
now returns a status indicating whether the request should be blocked.
This is needed because the DocumentLoader needs a CachedResource with an error representing the blocking
(WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
* contentextensions/ContentExtensionsBackend.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
Dispatch an error if the resource is blocked by a content blocker.
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
(WebCore::FrameLoader::cancelledError):
(WebCore::FrameLoader::blockedByContentBlockerError):
(WebCore::FrameLoader::connectionProperties):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/UserContentController.cpp:
(WebCore::UserContentController::removeAllUserContentExtensions):
(WebCore::UserContentController::processContentExtensionRulesForLoad):
(WebCore::UserContentController::actionsForResourceLoad):
* page/UserContentController.h:
* platform/efl/ErrorsEfl.cpp:
(WebCore::blockedError):
(WebCore::blockedByContentBlockerError):
(WebCore::cannotShowURLError):
* platform/efl/ErrorsEfl.h:
* platform/gtk/ErrorsGtk.cpp:
(WebCore::blockedError):
(WebCore::blockedByContentBlockerError):
(WebCore::cannotShowURLError):
* platform/gtk/ErrorsGtk.h:

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::blockedError):
(WebFrameLoaderClient::blockedByContentBlockerError):
(WebFrameLoaderClient::cannotShowURLError):
Add blockedByContentBlockerError so WebFrameLoaderClient is not an abstract class,
but it should be unused because content blockers are not enabled on WK1.

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::blockedError):
(WebFrameLoaderClient::blockedByContentBlockerError):
(WebFrameLoaderClient::cannotShowURLError):
* WebCoreSupport/WebFrameLoaderClient.h:
Added stub that should never be used.

Source/WebKit2:

* Shared/API/c/WKErrorRef.h:
* WebProcess/WebCoreSupport/WebErrors.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::blockedError):
(WebKit::WebFrameLoaderClient::blockedByContentBlockerError):
(WebKit::WebFrameLoaderClient::cannotShowURLError):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
(WebKit::blockedError):
(WebKit::blockedByContentBlockerError):
(WebKit::cannotShowURLError):
* WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
(WebKit::blockedError):
(WebKit::blockedByContentBlockerError):
(WebKit::cannotShowURLError):
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
(WebKit::blockedError):
(WebKit::blockedByContentBlockerError):
(WebKit::cannotShowURLError):
Make a new error type for loads that were blocked by a content blocker.

LayoutTests:

* http/tests/contentextensions/main-resource-expected.txt: Added.
* http/tests/contentextensions/main-resource.html: Added.
* http/tests/contentextensions/main-resource.html.json: Added.

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

4 years agoJSBuiltinConstructor must always add builtin header
calvaris@igalia.com [Tue, 6 Oct 2015 08:02:00 +0000 (08:02 +0000)]
JSBuiltinConstructor must always add builtin header
https://bugs.webkit.org/show_bug.cgi?id=149759

Reviewed by Darin Adler.

Covered by TestJSBuiltinConstructor.idl.

* bindings/scripts/CodeGeneratorJS.pm:
(AddIncludesForJSBuiltinMethods): Forces adding the builtin header when the JSBuiltinConstructor is present.
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: Expectation.

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

4 years agoUnreviewed EFL Gardening
commit-queue@webkit.org [Tue, 6 Oct 2015 06:54:48 +0000 (06:54 +0000)]
Unreviewed EFL Gardening
https://bugs.webkit.org/show_bug.cgi?id=149830

Remove "--lint-test-files warnings".

Patch by Byung Jun Kim <bj1987.kim@samsung.com> on 2015-10-05

* platform/efl/TestExpectations:

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

4 years agoMigrate streams API to JS Builtins
youenn.fablet@crf.canon.fr [Tue, 6 Oct 2015 06:20:58 +0000 (06:20 +0000)]
Migrate streams API to JS Builtins
https://bugs.webkit.org/show_bug.cgi?id=147092

Reviewed by Darin Adler.

Source/WebCore:

Moved ReadableStream implementation from C++ to JS Builtins.
Created specific private constructors for ReadableStreamReader and ReadableStreamController.
Added these constructors to  JSDOMWindowBase.
Constructors are based on a template found in JSDOMConstructor which might serve to webidl-generated classes as well.

Covered by existing tests.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/streams/ReadableStream.cpp: Removed.
* Modules/streams/ReadableStream.h: Removed.
* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStream.js:
(strategy.size):
(initializeReadableStream):
(cancel):
(getReader):
(pipeTo):
(tee):
(locked):
* Modules/streams/ReadableStreamController.h:
* Modules/streams/ReadableStreamController.idl:
* Modules/streams/ReadableStreamController.js: Added.
(enqueue):
(error):
(close):
(desiredSize):
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamReader):
(privateInitializeReadableStreamController):
(isReadableStream):
(isReadableStreamReader):
(isReadableStreamController):
(errorReadableStream):
(requestReadableStreamPull):
(getReadableStreamDesiredSize):
(releaseReadableStreamReader):
(cancelReadableStream):
(finishClosingReadableStream):
(closeReadableStream):
(closeReadableStreamReader):
(enqueueInReadableStream):
(readFromReadableStreamReader):
(invokeOrNoop):
(promiseInvokeOrNoop):
* Modules/streams/ReadableStreamReader.cpp: Removed.
* Modules/streams/ReadableStreamReader.h:
* Modules/streams/ReadableStreamReader.idl:
* Modules/streams/ReadableStreamReader.js: Copied from Source/WebCore/Modules/streams/ReadableStream.js.
(cancel):
(read):
(releaseLock):
(closed):
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMConstructor.h: Added.
(WebCore::JSBuiltinConstructor::create):
(WebCore::JSBuiltinConstructor::createStructure):
(WebCore::JSBuiltinConstructor::JSBuiltinConstructor):
(WebCore::JSBuiltinConstructor::initializeProperties):
(WebCore::JSBuiltinConstructor<JSClass>::finishCreation):
(WebCore::JSBuiltinConstructor<JSClass>::construct):
(WebCore::JSBuiltinConstructor<JSClass>::getConstructData):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::finishCreation):
* bindings/js/JSReadableStreamControllerCustom.cpp: Removed.
* bindings/js/JSReadableStreamCustom.cpp: Removed.
* bindings/js/JSReadableStreamPrivateConstructors.cpp: Added.
(WebCore::constructJSReadableStreamController):
(WebCore::constructJSReadableStreamReader):
(WebCore::JSBuiltinConstructor<JSReadableStreamReader>::createJSObject):
(WebCore::JSBuiltinConstructor<JSReadableStreamController>::createJSObject):
(WebCore::JSBuiltinReadableStreamReaderPrivateConstructor::createInitializeFunction):
(WebCore::JSBuiltinReadableStreamControllerPrivateConstructor::createInitializeFunction):
(WebCore::createReadableStreamReaderPrivateConstructor):
(WebCore::createReadableStreamControllerPrivateConstructor):
* bindings/js/JSReadableStreamPrivateConstructors.h: Added.
* bindings/js/JSReadableStreamReaderCustom.cpp: Removed.
* bindings/js/ReadableJSStream.cpp: Removed.
* bindings/js/ReadableJSStream.h: Removed.
* bindings/js/WebCoreBuiltinNames.h: Added.
(WebCore::WebCoreBuiltinNames::WebCoreBuiltinNames):
* bindings/js/WebCoreJSBuiltins.cpp:
* bindings/js/WebCoreJSClientData.h:
(WebCore::WebCoreJSClientData::WebCoreJSClientData):
(WebCore::WebCoreJSClientData::builtinNames):
(WebCore::WebCoreJSClientData::readableStreamControllerBuiltins):
(WebCore::WebCoreJSClientData::readableStreamReaderBuiltins):

LayoutTests:

Rebasing some tests, one subtest passing, two others still failing but with different reasons.

* streams/reference-implementation/brand-checks-expected.txt:
* streams/reference-implementation/readable-stream-reader-expected.txt:

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

4 years agoUnreviewed, rolling out r190599.
commit-queue@webkit.org [Tue, 6 Oct 2015 06:15:11 +0000 (06:15 +0000)]
Unreviewed, rolling out r190599.
https://bugs.webkit.org/show_bug.cgi?id=149836

Made perf tests randomly crash (Requested by ap on #webkit).

Reverted changeset:

"GC shouldn't cancel every FTL compilation"
https://bugs.webkit.org/show_bug.cgi?id=149821
http://trac.webkit.org/changeset/190599

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

4 years agoUnreviewed, rolling out r190589.
commit-queue@webkit.org [Tue, 6 Oct 2015 05:51:34 +0000 (05:51 +0000)]
Unreviewed, rolling out r190589.
https://bugs.webkit.org/show_bug.cgi?id=149833

Caused lots of leaks, and possibly crashes (Requested by ap on
#webkit).

Reverted changeset:

"Unreviewed, rolling back in r190450"
https://bugs.webkit.org/show_bug.cgi?id=149727
http://trac.webkit.org/changeset/190589

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

4 years agodata: URLs should not be preloaded
cdumez@apple.com [Tue, 6 Oct 2015 05:43:03 +0000 (05:43 +0000)]
data: URLs should not be preloaded
https://bugs.webkit.org/show_bug.cgi?id=149829

Reviewed by Ryosuke Niwa.

Source/WebCore:

Update the HTMLPreloadScanner so that data: URLs do not get preloaded.
There is no need as the data is already available.

Test: fast/preloader/image-data-url.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload):

LayoutTests:

Add layout test to make sure that images with a data: URL do not
get preloaded.

* fast/preloader/image-data-url-expected.txt: Added.
* fast/preloader/image-data-url.html: Added.

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

4 years ago[iOS] REGRESSION(r190434): Media continues to play when locking screen
jer.noble@apple.com [Tue, 6 Oct 2015 04:13:32 +0000 (04:13 +0000)]
[iOS] REGRESSION(r190434): Media continues to play when locking screen
https://bugs.webkit.org/show_bug.cgi?id=149822

Reviewed by Brent Fulgham.

Source/WebCore:

In MediaSessionManagerIOS.mm, both -applicationWillEnterForeground: and
-applicationDidBecomeActive: called
PlatformMediaSessionManager::applicationWillEnterForeground(), leading to the
PlatformMediaSession's m_interruptionCount becoming increasingly unbalanced.

Rename PlatformMediaSessionManager::applicationWillEnterForeground() to
applicationDidEnterForeground() to more correctly reflect when this notification will be
called. Add a new method, MediaSessionManagerIOS::applicationWillEnterForeground(bool),
whose paramater is whether the screen was locked. This allows the beginInterruption() and
endInterruption() methods to be correctly balanced.

Drive-by fix: remove the unimplemented declarations for application{will,did}Enter{Fore,Back}ground()
from PlatformMediaSession.h.

* platform/audio/PlatformMediaSession.h:
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
(WebCore::PlatformMediaSessionManager::applicationWillEnterForeground): Deleted.
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::applicationDidEnterBackground):
(WebCore::MediaSessionManageriOS::applicationWillEnterForeground):
(-[WebMediaSessionHelper applicationWillEnterForeground:]):
(-[WebMediaSessionHelper applicationDidBecomeActive:]):
* testing/Internals.cpp:
(WebCore::Internals::applicationDidEnterForeground):
(WebCore::Internals::applicationWillEnterForeground): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Pass through isSuspendedUnderLock when notifying the WebPage that the
applicationWillEnterForeground, and pass that boolean in the userInfo of the
WebUIApplicationWillEnterForegroundNotification.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationWillEnterForeground):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationWillEnterForeground):

LayoutTests:

applicationWillEnterForeground() -> applicationDidEnterForeground().

* media/video-background-playback-expected.txt:
* media/video-background-playback.html:
* media/video-background-tab-playback-expected.txt:
* media/video-background-tab-playback.html:

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

4 years agoModify the image to fit the width of the blog.
nvasilyev@apple.com [Tue, 6 Oct 2015 03:00:36 +0000 (03:00 +0000)]
Modify the image to fit the width of the blog.

* blog-files/web-inspector-keyboard-shortcuts/debugger-shortcuts.png:

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

4 years agoInvalid CSS Selector for Content Blockers invalidates others
achristensen@apple.com [Tue, 6 Oct 2015 02:47:38 +0000 (02:47 +0000)]
Invalid CSS Selector for Content Blockers invalidates others
https://bugs.webkit.org/show_bug.cgi?id=148446
rdar://problem/22918235

Reviewed by Benjamin Poulain.

Source/WebCore:

Test: http/tests/contentextensions/invalid-selector.html

* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::isValidSelector):
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::loadRule):
Add a check to see if a selector is valid before adding it.

LayoutTests:

* http/tests/contentextensions/invalid-selector-expected.txt: Added.
* http/tests/contentextensions/invalid-selector.html: Added.
* http/tests/contentextensions/invalid-selector.html.json: Added.

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

4 years agoRemove a few includes from JSGlobalObject.h
ggaren@apple.com [Tue, 6 Oct 2015 01:59:02 +0000 (01:59 +0000)]
Remove a few includes from JSGlobalObject.h
https://bugs.webkit.org/show_bug.cgi?id=148004

Reviewed by Saam Barati.

* parser/VariableEnvironment.cpp:
* parser/VariableEnvironment.h:
* runtime/JSGlobalObject.h:
* runtime/JSString.cpp:
(JSC::JSString::createStructure):
(JSC::JSRopeString::RopeBuilder::expand):
* runtime/JSString.h:
(JSC::JSString::canGetIndex):
(JSC::JSString::offsetOfLength):
(JSC::JSString::offsetOfFlags):
(JSC::JSString::createStructure): Deleted.
* runtime/Structure.h:
* runtime/StructureInlines.h:
* runtime/StructureRareDataInlines.h:

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

4 years agoAdd more assets for Web Inspector Keyboard Shortcuts blog post.
nvasilyev@apple.com [Tue, 6 Oct 2015 01:57:48 +0000 (01:57 +0000)]
Add more assets for Web Inspector Keyboard Shortcuts blog post.

* blog-files/web-inspector-keyboard-shortcuts/icon-disable.png: Added.
* blog-files/web-inspector-keyboard-shortcuts/icon-play.png: Added.
* blog-files/web-inspector-keyboard-shortcuts/icon-step-in.png: Added.
* blog-files/web-inspector-keyboard-shortcuts/icon-step-out.png: Added.
* blog-files/web-inspector-keyboard-shortcuts/icon-step-over.png: Added.
* blog-files/web-inspector-keyboard-shortcuts/search.png: Added.

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

4 years agoGC shouldn't cancel every FTL compilation
fpizlo@apple.com [Tue, 6 Oct 2015 01:33:39 +0000 (01:33 +0000)]
GC shouldn't cancel every FTL compilation
https://bugs.webkit.org/show_bug.cgi?id=149821

Reviewed by Saam Barati.

During one of the CodeBlock GC refactorings, we messed up the GC's compilation cancellation
code. The GC should be able to cancel compilation plans if it determines that the plan will
be DOA. But, prior to this fix, that code was killing every FTL compilation. This happened
because the meaning of CodeBlock::isKnownToBeLiveDuringGC() changed.

It's funny that this didn't show up as a bigger slow-down. Basically, those benchmarks that
GC a lot usually don't rely on good compilation, while those benchmarks that do rely on good
compilation usually don't GC a lot. That's probably why this wasn't super obvious when we
broke it.

This change just changes the cancellation logic so that it only cancels plans if the owning
executable is dead. This is safe; in fact the relevant method would be correct even if it
always returned true. It would also be correct if it always returned false. So, compared to
what we had before we changed isKnownToBeLiveDuringGC(), this new code will cancel fewer
compilations. But, that's better than cancelling every compilation. I've filed a bug and
written a FIXME for investigating ways to resurrect the old behavior:
https://bugs.webkit.org/show_bug.cgi?id=149823

Nonetheless, this change looks like it might be a 1% speed-up on Octane. It improves earley
and gbemu.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::isKnownToBeLiveDuringGC):

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

4 years agoAdd assets for Web Inspector Keyboard Shortcuts blog post.
nvasilyev@apple.com [Tue, 6 Oct 2015 01:31:03 +0000 (01:31 +0000)]
Add assets for Web Inspector Keyboard Shortcuts blog post.

* blog-files/web-inspector-keyboard-shortcuts/clear-console.png: Added.
* blog-files/web-inspector-keyboard-shortcuts/console-filters.m4v: Added.
* blog-files/web-inspector-keyboard-shortcuts/debugger-shortcuts.png: Added.
* blog-files/web-inspector-keyboard-shortcuts/hide-element.m4v: Added.
* blog-files/web-inspector-keyboard-shortcuts/select-next-and-previous-tabs.m4v: Added.
* blog-files/web-inspector-keyboard-shortcuts/toggle-split-console.m4v: Added.
* blog-files/web-inspector-keyboard-shortcuts/tooltips.gif: Added.

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

4 years agoCSSGradientValue should check whether gradientLength is zero or not.
commit-queue@webkit.org [Tue, 6 Oct 2015 01:22:48 +0000 (01:22 +0000)]
CSSGradientValue should check whether gradientLength is zero or not.
https://bugs.webkit.org/show_bug.cgi?id=149373
<rdar://problem/22771418>

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2015-10-05
Reviewed by Darin Adler.

Source/WebCore:

This is a merge of Blink r158220,
https://chromiumcodereview.appspot.com/24350008

Test: fast/gradients/css3-repeating-radial-gradients-crash.html

* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::addStops):
Check whether gradientLength > 0 before using it as denominator.

LayoutTests:

* fast/gradients/css3-repeating-radial-gradients-crash-expected.txt: Added.
* fast/gradients/css3-repeating-radial-gradients-crash.html: Added.

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

4 years agoGet rid of some dead code
andersca@apple.com [Tue, 6 Oct 2015 01:09:08 +0000 (01:09 +0000)]
Get rid of some dead code
https://bugs.webkit.org/show_bug.cgi?id=149825

Reviewed by Tim Horton.

* UIProcess/API/APIUIClient.h:
(API::UIClient::didDraw): Deleted.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didDraw): Deleted.
* UIProcess/WebPageProxy.h:

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

4 years agoEXT_texture_filter_anisotropic extension exposed with WEBKIT_ prefix
dino@apple.com [Tue, 6 Oct 2015 01:05:38 +0000 (01:05 +0000)]
EXT_texture_filter_anisotropic extension exposed with WEBKIT_ prefix
https://bugs.webkit.org/show_bug.cgi?id=149765
<rdar://problem/22983722>

Reviewed by Beth Dakin.

Source/WebCore:

We can now remove the WEBKIT_ prefix from this extension.

Test: fast/canvas/webgl/unprefixed-anisotropic-extension.html

* html/canvas/WebGL2RenderingContext.cpp: Support the prefixed and unprefixed form.
(WebCore::WebGL2RenderingContext::getExtension):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):

LayoutTests:

Simple test that the unprefixed form exists. The actual functionality
is exercised in the WebGL conformance tests.

* fast/canvas/webgl/unprefixed-anisotropic-extension-expected.txt: Added.
* fast/canvas/webgl/unprefixed-anisotropic-extension.html: Added.

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

4 years agoProspective Mavericks build fix.
mmaxfield@apple.com [Tue, 6 Oct 2015 00:27:48 +0000 (00:27 +0000)]
Prospective Mavericks build fix.

Unreviewed.

* UIProcess/API/cpp/WKRetainPtr.h:

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

4 years agoREGRESSION(189668?): http/tests/notifications/events.html flakily asserts or times out
mmaxfield@apple.com [Mon, 5 Oct 2015 23:45:56 +0000 (23:45 +0000)]
REGRESSION(189668?): http/tests/notifications/events.html flakily asserts or times out
https://bugs.webkit.org/show_bug.cgi?id=149218

Reviewed by Alexey Proskuryakov.

Tools:

Because of r189668, WebKitTestRunner now tears down and recreates its WKNotificationManagerRef
when the TestOptions change. Previously, WebNotificationProvider only could handle a single
WKNotificationManagerRef. Because the ower of the WKNotificationManagerRef is reference counted,
and AppKit internally retains some objects which end up retaining the WKNotificationManagerRef,
the old WKNotificationManager may not be destroyed before the new one is created. Therefore,
WebNotificationProvider must be updated to appropriately handle multiple
WKNotificationManagerRefs in flight at the same time.

* WebKitTestRunner/WebNotificationProvider.cpp:
(WTR::WebNotificationProvider::~WebNotificationProvider):
(WTR::WebNotificationProvider::showWebNotification):
(WTR::WebNotificationProvider::closeWebNotification):
(WTR::WebNotificationProvider::addNotificationManager):
(WTR::WebNotificationProvider::removeNotificationManager):
(WTR::WebNotificationProvider::simulateWebNotificationClick):
(WTR::WebNotificationProvider::reset):
* WebKitTestRunner/WebNotificationProvider.h:

LayoutTests:

* TestExpectations:

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

4 years agoReference cycles during SVG dependency invalidation
dino@apple.com [Mon, 5 Oct 2015 23:43:13 +0000 (23:43 +0000)]
Reference cycles during SVG dependency invalidation
https://bugs.webkit.org/show_bug.cgi?id=149824
<rdar://problem/22771412>

Reviewed by Tim Horton.

Source/WebCore:

Detect any reference cycles as we are invalidating.

This is mostly a merge of the following Blink commit:
https://chromium.googlesource.com/chromium/blink/+/a4bc83453bda89823b672877dc02247652a02d51

Test: svg/custom/reference-cycle.svg

* rendering/svg/RenderSVGResource.cpp:
(WebCore::removeFromCacheAndInvalidateDependencies): Keep around a hash
table of dependencies, so that we can detect if an element is already
present before marking it.

LayoutTests:

Adding a test that has a cycle between feImage resources.

Merge Blink commit:
https://chromium.googlesource.com/chromium/blink/+/a4bc83453bda89823b672877dc02247652a02d51

* svg/custom/reference-cycle-expected.txt: Added.
* svg/custom/reference-cycle.svg: Added.

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

4 years ago[Intl] Change the return type of canonicalizeLocaleList() from JSArray* to Vector...
sukolsak@gmail.com [Mon, 5 Oct 2015 23:36:56 +0000 (23:36 +0000)]
[Intl] Change the return type of canonicalizeLocaleList() from JSArray* to Vector<String>
https://bugs.webkit.org/show_bug.cgi?id=149807

Reviewed by Benjamin Poulain.

From ECMA-402, 9.2.1, the abstract operation CanonicalizeLocaleList
returns a List of Strings. From the spec, we never modify the result
from CanonicalizeLocaleList(). We never expose it to the user either.
This patch changes the return type of canonicalizeLocaleList() from
JSArray* to Vector<String>. This should ease the workload of the GC and
make the code a bit easier to read.

* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructorFuncSupportedLocalesOf):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf):
* runtime/IntlObject.cpp:
(JSC::canonicalizeLocaleList):
(JSC::lookupSupportedLocales):
(JSC::bestFitSupportedLocales):
(JSC::supportedLocales):
* runtime/IntlObject.h:

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

4 years agoMarking compositing/video/video-poster.html as flaky for El Capitan.
commit-queue@webkit.org [Mon, 5 Oct 2015 23:36:12 +0000 (23:36 +0000)]
Marking compositing/video/video-poster.html as flaky for El Capitan.
https://bugs.webkit.org/show_bug.cgi?id=149819
<rdar://problem/16622896> ASSERT(!needsLayout()) at com.apple.WebCore: WebCore::RenderView::paint

Patch by Ryan Haddad <ryanhaddad@apple.com> on 2015-10-05
Reviewed by Simon Fraser.

* platform/mac-elcapitan/TestExpectations: Added.

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

4 years agoUnreviewed, rolling back in r190450
ggaren@apple.com [Mon, 5 Oct 2015 23:31:53 +0000 (23:31 +0000)]
Unreviewed, rolling back in r190450
https://bugs.webkit.org/show_bug.cgi?id=149727

The cause of the leak was VM shutdown, which happens in workers.

The fix is for CodeBlockSet to participate in lastChanceToFinalize,
since it's responsible for running CodeBlock destructors.

I ran the leaks tests locally and did not see any CodeBlock-related leaks.

Restored changesets:

"CodeBlock should be a GC object"
https://bugs.webkit.org/show_bug.cgi?id=149727
http://trac.webkit.org/changeset/190450

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

4 years agoFix null pointer dereference in WebSocket::connect()
commit-queue@webkit.org [Mon, 5 Oct 2015 23:28:20 +0000 (23:28 +0000)]
Fix null pointer dereference in WebSocket::connect()
https://bugs.webkit.org/show_bug.cgi?id=149311
<rdar://problem/22748858>

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2015-10-05
Reviewed by Chris Dumez.

Source/WebCore:

This is a merge of Blink r187441,
https://codereview.chromium.org/785933005

Test: http/tests/websocket/construct-in-detached-frame.html

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
Call function implemented below instead of duplicating the code.
* page/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::shouldBypassMainWorldContentSecurityPolicy):
* page/ContentSecurityPolicy.h:
Factor the logic to check shouldBypassMainWorldContentSecurityPolicy into
a function in this class. Check Frame pointers are not null before getting
shouldBypassMainWorldContentSecurityPolicy via those pointers.
* page/EventSource.cpp:
(WebCore::EventSource::create):
This got fixed as a bonus.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
This got fixed as a bonus too.

LayoutTests:

* http/tests/websocket/construct-in-detached-frame-expected.txt: Added.
* http/tests/websocket/construct-in-detached-frame.html: Added.
* http/tests/websocket/resources/construct-in-detached-frame.html: Added.

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

4 years agoWebCore::IOSurface should ask the IOSurface for the pixel format instead of
bdakin@apple.com [Mon, 5 Oct 2015 23:17:42 +0000 (23:17 +0000)]
WebCore::IOSurface should ask the IOSurface for the pixel format instead of
caching it
https://bugs.webkit.org/show_bug.cgi?id=149820
-and corresponding-
rdar://problem/22976230

Reviewed by Tim Horton.

Also there is no reason to make YUV be iOS only, so this patch removes those
PLATFORM checks.

* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::IOSurface):
(IOSurface::format):
* platform/spi/cocoa/IOSurfaceSPI.h:

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

4 years agoRevert LayoutTests parts of r190579, which were incorrect.
ap@apple.com [Mon, 5 Oct 2015 23:13:50 +0000 (23:13 +0000)]
Revert LayoutTests parts of r190579, which were incorrect.

* svg/custom/invalid-xslt-crash-expected.txt: Copied from LayoutTests/svg/custom/invalid-xslt-crash-expected.txt.
* svg/custom/invalid-xslt-crash.svg:

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

4 years agoShadowRoot with leading or trailing white space cause a crash
rniwa@webkit.org [Mon, 5 Oct 2015 22:49:34 +0000 (22:49 +0000)]
ShadowRoot with leading or trailing white space cause a crash
https://bugs.webkit.org/show_bug.cgi?id=149782

Reviewed by Chris Dumez.

Source/WebCore:

Fixed the crash by adding a null pointer check since a TextNode that appears as a direct child
of a ShadowRoot doesn't have a parent element.

Test: fast/shadow-dom/shadow-root-with-child-whitespace-text-crash.html

* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::previousSiblingRenderer):

LayoutTests:

Added a regression test.

* fast/shadow-dom/shadow-root-with-child-whitespace-text-crash-expected.txt: Added.
* fast/shadow-dom/shadow-root-with-child-whitespace-text-crash.html: Added.

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

4 years agoDisable Bitcode when building for iOS device
dbates@webkit.org [Mon, 5 Oct 2015 22:35:54 +0000 (22:35 +0000)]
Disable Bitcode when building for iOS device
https://bugs.webkit.org/show_bug.cgi?id=149818

Reviewed by Alexey Proskuryakov.

Xcode 7 generates bitcode for iOS device apps by default. Do not generate bitcode
when building for iOS device.

* Scripts/webkitdirs.pm:
(XcodeOptions):

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

4 years ago[iOS] Make it possible to build WebKit using iphoneos SDK without a developer certifi...
dbates@webkit.org [Mon, 5 Oct 2015 22:30:11 +0000 (22:30 +0000)]
[iOS] Make it possible to build WebKit using iphoneos SDK without a developer certificate installed
https://bugs.webkit.org/show_bug.cgi?id=140828
<rdar://problem/19520599>

Reviewed by Alexey Proskuryakov.

Support building WebKit for iOS device without an iOS Developer certificate installed. Otherwise,
we will pass CODE_SIGN_IDENTITY="iPhone Developer: " to Xcode to find a iOS Developer certificate
to use. To use a specific installed iOS Developer certificate, explicitly pass CODE_SIGN_IDENTITY
to build-webkit.

* Scripts/webkitdirs.pm:
(XcodeOptions): Cleaned up code. When building for iOS device, pass to Xcode CODE_SIGN_IDENTITY="iPhone Developer: "
to code sign using the installed iOS development certificate (if it exists - we assume there is only one such certificate).
Otherwise, pass CODE_SIGN_IDENTITY="" and CODE_SIGNING_REQUIRED=NO to Xcode to disable code signing.
(hasIOSDevelopmentCertificate): Added.

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

4 years agoBuild fix.
bdakin@apple.com [Mon, 5 Oct 2015 22:16:55 +0000 (22:16 +0000)]
Build fix.

* platform/spi/cocoa/IOSurfaceSPI.h:

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

4 years agoUnreviewed build fix.
bdakin@apple.com [Mon, 5 Oct 2015 22:13:21 +0000 (22:13 +0000)]
Unreviewed build fix.

* platform/spi/cocoa/IOSurfaceSPI.h:

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

4 years agoModernize IDBRequest::ReadyState into an enum class.
beidson@apple.com [Mon, 5 Oct 2015 21:29:13 +0000 (21:29 +0000)]
Modernize IDBRequest::ReadyState into an enum class.
https://bugs.webkit.org/show_bug.cgi?id=149817

Reviewed by Alex Christensen.

No new tests (Refactor, no behavior change).

* Modules/indexeddb/IDBRequest.h:

* Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
(WebCore::LegacyOpenDBRequest::shouldEnqueueEvent):

* Modules/indexeddb/legacy/LegacyRequest.cpp:
(WebCore::LegacyRequest::LegacyRequest):
(WebCore::LegacyRequest::result):
(WebCore::LegacyRequest::error):
(WebCore::LegacyRequest::errorCode):
(WebCore::LegacyRequest::readyState):
(WebCore::LegacyRequest::markEarlyDeath):
(WebCore::LegacyRequest::abort):
(WebCore::LegacyRequest::setCursorDetails):
(WebCore::LegacyRequest::setPendingCursor):
(WebCore::LegacyRequest::setResultCursor):
(WebCore::LegacyRequest::finishCursor):
(WebCore::LegacyRequest::shouldEnqueueEvent):
(WebCore::LegacyRequest::stop):
(WebCore::LegacyRequest::dispatchEvent):
(WebCore::LegacyRequest::transactionDidFinishAndDispatch):
(WebCore::LegacyRequest::enqueueEvent):
* Modules/indexeddb/legacy/LegacyRequest.h:

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

4 years agoCleaning up after revision 190339
commit-queue@webkit.org [Mon, 5 Oct 2015 21:21:18 +0000 (21:21 +0000)]
Cleaning up after revision 190339
https://bugs.webkit.org/show_bug.cgi?id=149732

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2015-10-05
Reviewed by Myles C. Maxfield.

Source/WebCore:

* xml/XSLStyleSheet.h:
* xml/XSLStyleSheetLibxslt.cpp:
(WebCore::XSLStyleSheet::compileStyleSheet):

LayoutTests:

* svg/custom/invalid-xslt-crash.svg:
* svg/custom/invalid-xslt-crash-expected.txt:
Replace render tree dump test with text dump.
Pass if no crash.

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

4 years agoDumpRenderTree built with public iOS SDK crashes under -[WebPreferences(WebPrivate...
dbates@webkit.org [Mon, 5 Oct 2015 20:57:09 +0000 (20:57 +0000)]
DumpRenderTree built with public iOS SDK crashes under -[WebPreferences(WebPrivate) _setCurrentNetworkLoaderSessionCookieAcceptPolicy:]
https://bugs.webkit.org/show_bug.cgi?id=149766

Reviewed by Alexey Proskuryakov.

Source/WebKit/mac:

Assert that we have a non-null pointer to a cookie storage.

* WebView/WebPreferences.mm:
(+[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:]):

Tools:

Create network storage testing session on iOS.

Currently we do not create a network storage testing session on iOS. A network storage testing session always
has an associated cookie store. When WebKit is built without USE(CFNETWORK), NetworkStorageSession::defaultStorageSession().cookieStorage()
returns nullptr because the caller is expected to interact with NSHTTPCookieStorage instead of querying
NetworkStorageSession for the cookie store. When WebKit is built with USE(CFNETWORK) accessing
NetworkStorageSession::defaultStorageSession().cookieStorage() returns a valid cookie store (creating one if
it does not exist). Instead we should make use of NetworkStorageSession::switchToNewTestingSession() to
create a network storage testing session when building DumpRenderTree for iOS so as to ensure a consistent
testing environment regardless of whether we built with USE(CFNETWORK). This will also make the behavior of
DumpRenderTree on iOS more consistent with the behavior of DumpRenderTree on Mac.

As a side effect of this change DumpRenderTree no longer crashes in -[WebPreferences(WebPrivate) _setCurrentNetworkLoaderSessionCookieAcceptPolicy:]
when WebKit is built without USE(CFNETWORK) because NetworkStorageSession::defaultStorageSession().cookieStorage()
returns a non-null pointer to a cookie store.

* DumpRenderTree/mac/DumpRenderTree.mm:
(prepareConsistentTestingEnvironment):

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

4 years agoRebaseline test for iOS
timothy_horton@apple.com [Mon, 5 Oct 2015 20:52:22 +0000 (20:52 +0000)]
Rebaseline test for iOS

* platform/ios-simulator/fast/text/mark-matches-overflow-clip-expected.txt:

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

4 years agoErrant space!!
bdakin@apple.com [Mon, 5 Oct 2015 20:46:54 +0000 (20:46 +0000)]
Errant space!!
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::releaseGraphicsContext):
(IOSurface::convertToFormat):

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

4 years agoAdd a graphics benchmark
commit-queue@webkit.org [Mon, 5 Oct 2015 20:38:52 +0000 (20:38 +0000)]
Add a graphics benchmark
https://bugs.webkit.org/show_bug.cgi?id=149053
<rdar://problem/18984169>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-10-05
Reviewed by Dean Jackson.

Instead of measuring the FPS of the animation, this benchmark measures the
test complexity when rendering at a set-point FPS which should be lower
than 60 FPS. This benchmark tries to stay at the set-point FPS by using
a closed loop control system PID function. The gain of the system is passed
as a parameter when running the test. Measuring the FPS faithfully results
very fluctuating values. A Kalman filter is used to give a better estimate
for the current FPS.

The animation of the tests is done manually. requestAnimationFrame() is
called with a callback. Inside this callback, the test is animating by
changing the positions of the elements inside the page. The test complexity
may change also if the current FPS is not equal to the desired FPS.

In this patch, the benchmark and the tests are included. The shared code
and the tests runner are included in separate patches.

* Animometer/runner/animometer.html:
* Animometer/runner/resources/animometer.js:
Add two new examples for more complex animation techniques.
Add an option to show/hide the test running results which is off by default.

* Animometer/runner/resources/tests.js: Added.
(suiteFromName): Returns a suite given its name.
(testFromName): Returns a test given its suite and name.

* Animometer/tests: Added.
This directory includes all the test suites to be run by the benchmark.
runner. All the tests should try to run on three stages: CSS, canvas and
SVG.

* Animometer/tests/bouncing-particles: Added.
* Animometer/tests/bouncing-particles/resources: Added.
The bouncing particles test is an example of a simple animation technique.

* Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Added.
* Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Added.
* Animometer/tests/bouncing-particles/bouncing-css-images.html: Added.
* Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Added.
* Animometer/tests/bouncing-particles/bouncing-svg-images.html: Added.
* Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Added.
Bouncing particles test pages.

* Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Added.
(BouncingParticle): Base class for a bouncing particle.
(BouncingParticle.prototype.center): Returns the center point or the particle.
(BouncingParticle.prototype.animate): Moves the particle based on its current position, angle and velocity.

(BouncingParticlesAnimator): A sub class of Animator.

(BouncingParticlesStage): Represents the container of all the bouncing particles.
(BouncingParticlesStage.prototype.parseShapeParamters): Gets the shape parameters for shape animating tests.
(BouncingParticlesStage.prototype.randomRotater): Creates a rotater for the particles.
(BouncingParticlesStage.prototype.animate): Animates all the particles.
(BouncingParticlesStage.prototype.tune): Changes the test by adding or removing particles.

(BouncingParticlesBenchmark): Runs the benchmark for bouncing particles test.
(BouncingParticlesBenchmark.prototype.createAnimator): Creates an animator of type BouncingParticlesAnimator.

* Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: Added.
(BouncingCssShape): A sub class of BouncingParticle for animating CSS shapes.
(BouncingCssShape.prototype._createSpan): Creates a <span> element and takes the shape and clipping classes into consideration.
(BouncingCssShape.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
(BouncingCssShape.prototype.animate): Rotates and moves the shape to a new location.

(BouncingCssShapesStage): A sub class of BouncingParticlesStage for animating CSS shapes.
(BouncingCssShapesStage.prototype.createParticle): Creates a particle of type BouncingCssShape.
(BouncingCssShapesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.

(BouncingCssShapesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS shapes.
(BouncingCssShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCssShapesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingCssShapesBenchmark.

* Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: Added.
(BouncingCssImage): A sub class of BouncingParticle for animating CSS images.
(BouncingCssImage.prototype._move): Move the particle to a new location. Apply transform since it does not require layout.
(BouncingCssImage.prototype.animate): Rotates and moves the shape to a new location.

(BouncingCssImagesStage): A sub class of BouncingParticlesStage for animating CSS images.
(BouncingCssImagesStage.prototype.createParticle): Creates a particle of type BouncingCssImage.
(BouncingCssImagesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.

(BouncingCssImagesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS images.
(BouncingCssImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCssImagesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingCssImagesBenchmark.

* Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Added.
(BouncingCanvasParticle): A base sub-class of BouncingParticle for animating canvas particles.
(BouncingCanvasParticle.prototype._applyRotation): Apply the particle rotation-around-center transform to the canvas context.
(BouncingCanvasParticle.prototype._applyClipping): Apply the particle clipping to the canvas context.
(BouncingCanvasParticle.prototype._draw): A non-implemented version of the drawing function.
(BouncingCanvasParticle.prototype.animate): Carries out all the steps to redraw the canvas particle.

(BouncingCanvasParticlesStage): A base sub-class of BouncingParticlesStage for animating canvas particles.

(BouncingCanvasParticlesAnimator): A concrete sub-class of BouncingParticlesAnimator for animating canvas particles.
(BouncingCanvasParticlesAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.

(BouncingCanvasParticlesBenchmark): A base sub-class of StageBenchmark for animating canvas particles.
(BouncingCanvasParticlesBenchmark.prototype.createAnimator): Creates the canvas particles animator.

* Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Added.
(BouncingCanvasShape): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
(BouncingCanvasShape.prototype._applyFill): Sets the fillStyle in the canvas context.
(BouncingCanvasShape.prototype._drawShape): Carries out the actual drawing.
(BouncingCanvasShape.prototype._draw): Carries out all the steps to draw the shape.

(BouncingCanvasShapesStage): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
(BouncingCanvasShapesStage.prototype.createParticle): Creates a particle of type BouncingCanvasShape.

(BouncingCanvasShapesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas shapes.
(BouncingCanvasShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasShapesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasShapesBenchmark.

* Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Added.
(BouncingCanvasImage): A concrete sub-class of BouncingCanvasParticle for animating canvas images.
(BouncingCanvasImage.prototype._draw): Draws an image on the context of a canvas.

(BouncingCanvasImagesStage): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
(BouncingCanvasImagesStage.prototype.createParticle): Creates a particle of type BouncingCanvasImage.

(BouncingCanvasImagesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
(BouncingCanvasImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasImagesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasImagesBenchmark.

* Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Added.
(BouncingSvgParticle): A base sub-class of BouncingParticle for animating SVG particles.
(BouncingSvgParticle.prototype._applyClipping): Apply the particle clipping by setting the 'clip-path' attribute of the SVGElement.
(BouncingSvgParticle.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
(BouncingSvgParticle.prototype.animate): Rotates and moves the shape to a new location.
(BouncingSvgParticlesStage): A sub class of BouncingParticlesStage for animating SVGElements.
(BouncingSvgParticlesStage.prototype._createDefs): Creates an SVGDefsElement.
(BouncingSvgParticlesStage.prototype._ensureDefsIsCreated): Ensures there is only one SVGDefsElement is created.
(BouncingSvgParticlesStage.prototype._createClipStar): Creates an SVGClipPathElement and sets its 'd' attribute to a star like shape.
(BouncingSvgParticlesStage.prototype.ensureClipStarIsCreated): Ensure there is only one star SVGClipPathElement is created.
(BouncingSvgParticlesStage.prototype.particleWillBeRemoved): Remove the corresponding element form the parent children list.

* Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Added.
(BouncingSvgShape): A concrete sub-class of BouncingSVGParticle for animating SVG shapes.
(BouncingSvgShape.prototype._createShape): Creates an SVG shape.
(BouncingSvgShape.prototype._applyFill): Applies the selected fill style to the SVG shape.

(BouncingSvgShapesStage): A concrete sub-class of BouncingSvgParticlesStage for animating SVG shapes.
(BouncingSvgShapesStage.prototype.createGradient): Creates an SVGLinearGradientElement.
(BouncingSvgShapesStage.prototype.createParticle): Creates a particle of type BouncingSvgShape.
(BouncingSvgShapesStage.prototype.particleWillBeRemoved): Ensures the attached SVGLinearGradientElement is removed from the SVGDefsElement.

(BouncingSvgShapesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
(BouncingSvgShapesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgShapesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingSvgShapesBenchmark.

* Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Added.
(BouncingSvgImage): A concrete sub-class of BouncingSVGParticle for animating SVG images.

(BouncingSvgImagesStage): A concrete sub-class of BouncingSVGParticlesBenchmark for animating SVG images.
(BouncingSvgImagesStage.prototype.createParticle): Creates a particle of type BouncingSvgImage.

(BouncingSvgImagesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
(BouncingSvgImagesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgImagesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingSvgImagesBenchmark.

* Animometer/tests/examples: Added.
* Animometer/tests/examples/canvas-electrons.html: Added.
* Animometer/tests/examples/canvas-stars.html: Added.
Examples test pages.

* Animometer/tests/examples/resources: Added.
* Animometer/tests/examples/resources/canvas-electrons.js: Added.
(CanvasElectron): An object which draws and animate a electron object on a canvas stage.
(CanvasElectron.prototype._draw): Draws the electron object.
(CanvasElectron.prototype.animate): Animates the electron object.

(CanvasElectronsStage): A concrete sub-class of Stage for animating electrons.
(CanvasElectronsStage.prototype.tune): Changes the test by adding or removing elements.
(CanvasElectronsStage.prototype.animate): Animates the test elements.

(CanvasElectronsAnimator): A concrete sub-class of StageAnimator for animating canvas electrons.
(CanvasElectronsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.

(CanvasElectronsBenchmark): A concrete sub-class of StageBenchmark for animating electrons.
(CanvasElectronsBenchmark.prototype.createStage): Creates a stage of CanvasElectronsStage.
(CanvasElectronsBenchmark.prototype.createAnimator): Creates an animator of type CanvasElectronsAnimator.
(window.benchmarkClient.create): Creates a benchmark of type CanvasElectronsBenchmark.

* Animometer/tests/examples/resources/canvas-stars.js: Added.
(CanvasStar): An object which draws and animate a star object on a canvas stage.
(CanvasStar.prototype._draw): Draws the star object.
(CanvasStar.prototype.animate): Animates the star object.

(CanvasStarsStage): A concrete sub-class of Stage for animating stars.
(CanvasStarsStage.prototype.tune): Changes the test by adding or removing elements.
(CanvasStarsStage.prototype.animate): Animates the test elements.

(CanvasStarsAnimator): A concrete sub-class of StageAnimator for animating canvas stars.
(CanvasStarsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.

(CanvasStarsBenchmark): A concrete sub-class of Benchmark for animating stars.
(CanvasStarsBenchmark.prototype.createStage): Creates a stage of CanvasStarsStage.
(CanvasStarsBenchmark.prototype.createAnimator): Creates an animator of type CanvasStarsAnimator.
(window.benchmarkClient.create): Creates a benchmark of type CanvasStarsBenchmark.

* Animometer/tests/resources: Added.
This directory includes the script which is required to run an adaptive
graphics benchmark. From an empty test page, the set of classes in this
directory are responsible for measuring the current frame rate and
changing the test to reach a desired FPS. It keeps asking the test page
to tune itself by a certain value to increase or decrease the frame rate.
It's also responsible for sampling the test state and the corresponding
frame rate.

* Animometer/tests/resources/main.js: Added.
(BenchmarkState): Tracks the state of the benchmark test.
(BenchmarkState.prototype._timeOffset): Returns the timeOffset of a stage.
(BenchmarkState.prototype._message): Returns the message of a stage.
(BenchmarkState.prototype.update): Sets the currentTimeOffset to a new value.
(BenchmarkState.prototype.samplingTimeOffset): Returns the timeOffset of the sampling stage.
(BenchmarkState.prototype.currentStage): Returns the current stage of the benchmark.
(BenchmarkState.prototype.currentMessage): Returns the message of the current stage and timeOffset.
(BenchmarkState.prototype.currentProgress): Returns a percentage of how much the benchmark is running.

(Animator): Manages animating the test.
(Animator.prototype.start): Called if animating using setInterval is requested.
(Animator.prototype.timeDelta): Returns the current timeDelta
(Animator.prototype.animate): Manages the test animation.
(Animator.prototype.animateLoop): Called if animating using requestAnimationFrame is requested.

(Benchmark): Manages running the test benchmark and recording the sampled data.
(Benchmark.prototype.start): Starts the benchmark.
(Benchmark.prototype.update): Called from the animator.animate() to change the complexity of the test.
(Benchmark.prototype.record): Shows the current (not final) results of the benchmark.
(Benchmark.prototype.resolveWhenFinished): Spins until the benchmark is finished and returns its results.
(Benchmark.prototype.run): Starts the test, runs it, waits until it is finished and return its results.
(window.runBenchmark): Called from the benchmark runner through the suite controller run-callback.

* Animometer/tests/resources/math.js: Added.
(Matrix): A matrix object.
(Vector3): A vector of size 3 object.
(Matrix3): A matrix of size 3x3 object.

(PIDController): Closed-loop controller for a set-point y.
(PIDController.prototype._sat): Limits the output to a certain range.
(PIDController.prototype.tune): Given the current output of a system, it produces a new pid value for tuning it.

(KalmanEstimator): Implement Kalman filter to get an estimate for a sampled data point.
(KalmanEstimator.prototype.estimate): Returns an estimate for for a sampled data point.

* Animometer/tests/resources/utilities.js: Added.
(window.Utilities._parse): Given a separator character, it pareses a string to a set of <key, value> pairs.
(window.Utilities.parseParameters): Parses a test parameters.
(window.Utilities.parseArguments): Parses a tag arguments.
(window.Utilities.extendObject): Adds the attributes and their values of an object to another object.
(window.Utilities.copyObject): Copies the attributes and their values of an object to a new object.
(window.Utilities.mergeObjects): Copies the attributes and their values of two objects to a new object.
(window.Utilities.createSvgElement): Creates an SVGElement given its name and its attributes.

* Animometer/tests/resources/stage.css: Added.
* Animometer/tests/resources/stage.js: Added.
(Rotater): Manages rotating an angle within a fixed time interval.
(Rotater.prototype.get interval): Returns the time interval which is required to rotate 360 degrees.
(Rotater.prototype.next): Moves the current time by a delta.
(Rotater.prototype.degree): Returns the current rotating degree.
(Rotater.prototype.rotateZ): Returns CSS formatted transform rotateZ() string for the current degree.
(Rotater.prototype.rotate): Returns SVG formatted transform rotate() string for the current degree.

(Stage): A base class for managing the test complexity and test animation.
(Stage.prototype.get size): Returns the size of the stage excluding the CSS padding.
(Stage.prototype.random): Returns a random float.
(Stage.prototype.randomInt): Returns a random integer.
(Stage.prototype.randomPosition): Returns a random position.
(Stage.prototype.randomSquareSize): Returns a square size.
(Stage.prototype.randomVelocity): Returns a random velocity.
(Stage.prototype.randomAngle): Returns a random angle.
(Stage.prototype.randomColor): Returns a random color not too dark and not too light.
(Stage.prototype.randomRotater): Creates a random rotater. Its velocity depends on choosing a random rotation time interval.
(Stage.prototype.tune): A not-implemented version of this function.
(Stage.prototype.animate): A not-implemented version of this function.
(Stage.prototype.clear): Clears the stage from all its animation elements.

(StageAnimator): A base class for the stage-based animators.
(StageAnimator.prototype.animate): Calls Animator.animate() which updates the test page and then calls Stage.animate() to force redraw.

(StageBenchmark): A base class for the stage-based benchmarks.
(StageBenchmark.prototype.createStage): Creates the default stage.
(StageBenchmark.prototype.createAnimator): Creates the default animator.
(StageBenchmark.prototype.tune): Delegates the call to stage.
(StageBenchmark.prototype.clear): Delegates the call to stage.
(StageBenchmark.prototype.showResults): Shows the results/progress through its recordTable and progressBar.

* Animometer/tests/resources/yin-yang.png: Added.
* Animometer/tests/resources/yin-yang.svg: Added.
These images are shared among all the tests.

* Animometer/tests/template: Added.
* Animometer/tests/template/resources: Added.
This directory includes template tests which do nothing. They can be used
to author new tests. Animated items can be created, moved and redrawn by
removing the TODO comments in the script files and writing actual code.

* Animometer/tests/template/template-css.html: Added.
* Animometer/tests/template/template-canvas.html: Added.
* Animometer/tests/template/template-svg.html: Added.
Template test pages. They can be used as they are. CSS attributes or hidden
elements can be added to these derived test pages if needed.

* Animometer/tests/template/resources/template-css.js: Added.

(TemplateCssStage): A stage to create and animate HTMLElements.
(TemplateCssStage.prototype.tune): Changes the test by adding or removing elements.
(TemplateCssStage.prototype.animate): Animates the test elements.
(TemplateCssBenchmark):
(TemplateCssBenchmark.prototype.createStage): Creates the test stage.
(window.benchmarkClient.create): Creates a benchmark of type TemplateCssBenchmark.

* Animometer/tests/template/resources/template-canvas.js: Added.
(TemplateCanvasObject):
(TemplateCanvasObject.prototype._draw): Draws the objects on the canvas context.
(TemplateCanvasObject.prototype.animate): Moves and redraws the object.
(TemplateCanvasStage): A stage to create and animate drawing elements.
(TemplateCanvasStage.prototype.tune): hanges the test by adding or removing elements.
(TemplateCanvasStage.prototype.animate):  Animates the test elements.
(TemplateCanvasAnimator.prototype.animate): Starts the animation every frame.
(TemplateCanvasBenchmark):
(TemplateCanvasBenchmark.prototype.createStage): Creates a stage of type TemplateCanvasStage.
(TemplateCanvasBenchmark.prototype.createAnimator): Creates a animator of type TemplateCanvasAnimator.
(window.benchmarkClient.create): Creates a benchmark of type TemplateCanvasBenchmark.

* Animometer/tests/template/resources/template-svg.js: Added.
(TemplateSvgStage): A stage to create and animate SVGElements.
(TemplateSvgStage.prototype.tune): Changes the test by adding or removing elements.
(TemplateSvgStage.prototype.animate): Animates the test elements.
(TemplateSvgBenchmark.prototype.createStage): Creates a stage of type TemplateSvgStage.
(window.benchmarkClient.create): Creates a benchmark of type TemplateSvgBenchmark.

* Animometer/tests/text: Added.
* Animometer/tests/text/resources: Added.
This directory includes the text animating tests which currently runs
on CSS stage only.

* Animometer/tests/text/layering-text.html: Added.
Text test page.

* Animometer/tests/text/resources/layering-text.js: Added.
(LayeringTextStage): Represents the container of all the stacked text layers.
(LayeringTextStage.parseTextItem): Parses a textItem which may be an opening tag, a closing tag or a self-closing tag.
(LayeringTextStage.isOpeningTextItem): Returns true if the textItem is an opening tag e.g. '<ol>'.
(LayeringTextStage.isClosingTextItem): Returns true if  the textItem is an closing tag e.g. '</ol>.
(LayeringTextStage.textItemsFlags.LayeringTextStage.textItems.map): Calculates and stores isOpening and isClosing flags for each textItem.
(LayeringTextStage.isColorableTextItem): Returns true if the textItem is self-closing tag e.g. '<p>...</p>'.
(LayeringTextStage.isInsertableTextItem): Returns true if the textItems causes a new element to be added to the text layers.
(LayeringTextStage.colorableTextItems.LayeringTextStage.textItemsFlags.filter): Number of colorable textItems.
(LayeringTextStage.insertableTextItems.LayeringTextStage.textItemsFlags.filter): Number of insertable textItems.
(LayeringTextStage.colorIndexToTextElementIndex): Maps from colorIndex [0..colorableTextItems-1] to textElementIndex [0..insertableTextItems-1].
(LayeringTextStage.prototype._nextTextItem): Moves the _textItemIndex one step forward in a loop [0..LayeringTextStage.textItems.length-1].
(LayeringTextStage.prototype._previousTextItem): Moves the _textItemIndex one step backward in a loop.
(LayeringTextStage.prototype._pushTextElement): Creates a new textItemElement and adds it to the topmost container <div>.
(LayeringTextStage.prototype._popTextElement): Removes the last textItemElement from the topmost container <div>.
(LayeringTextStage.prototype._colorTextItem): Changes the background color of a single colorable textElement. The index advances in a circle [0..colorableTextItems-1].
(LayeringTextStage.prototype.animate): Changes the background color and the text color of the textElements such that a redraw is enforced.
(LayeringTextStage.prototype.tune): Adds or removes textElements to the stage.

(LayeringTextBenchmark): Runs the benchmark for the layering text test.
(LayeringTextBenchmark.prototype.createStage): Creates a stage of type LayeringTextStage.
(window.benchmarkClient.create): Creates a benchmark of type LayeringTextBenchmark.

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

4 years agoCompress snapshots on iOS
bdakin@apple.com [Mon, 5 Oct 2015 20:35:28 +0000 (20:35 +0000)]
Compress snapshots on iOS
https://bugs.webkit.org/show_bug.cgi?id=149814
-and corresponding-
rdar://problem/22976230

Reviewed by Simon Fraser.

Source/WebCore:

Though the default is still RGBA, it is now possible to create an IOSurface
that uses the YUV422 pixel format.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::surfaceFromPool):
(IOSurface::create):
(IOSurface::createFromImage):
(IOSurface::IOSurface):
(IOSurface::releaseGraphicsContext):

In order to have a YUV IOSurface, we actually have to create an RGBA surface
first and then convert it to YUV, so this class method will handle that.
(IOSurface::convertToFormat):

Necessary SPI.
* platform/spi/cocoa/IOSurfaceSPI.h:

Source/WebKit2:

Compress the snapshot.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):

Since the snapshots are converted to YUV asynchronously, it is possible to
get here and have a snapshot that does not yet have an image, so we have to
relax this constraint.
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::recordSnapshot):

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

4 years agoFix the iOS 8 build again, where -[UIApplication _enqueueHIDEvent:] is not
simon.fraser@apple.com [Mon, 5 Oct 2015 20:33:56 +0000 (20:33 +0000)]
Fix the iOS 8 build again, where -[UIApplication _enqueueHIDEvent:] is not
available.

* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator _sendMarkerHIDEventWithCompletionBlock:]):

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

4 years agoAllow WKRetainPtrs to be used as keys in hashing data structures
mmaxfield@apple.com [Mon, 5 Oct 2015 20:31:41 +0000 (20:31 +0000)]
Allow WKRetainPtrs to be used as keys in hashing data structures
https://bugs.webkit.org/show_bug.cgi?id=149762

Reviewed by Anders Carlsson.

Source/WebKit2:

Use RefPtr as a model.

* UIProcess/API/cpp/WKRetainPtr.h:
(WebKit::WKRetainPtr::WKRetainPtr):
(WebKit::WKRetainPtr::isHashTableDeletedValue):
(WebKit::WKRetainPtr::hashTableDeletedValue):
(WTF::HashTraits<WKRetainPtr<P>>::emptyValue):
(WTF::HashTraits<WKRetainPtr<P>>::peek):

Tools:

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/WKRetainPtr.cpp: Added.
(TestWebKitAPI::TEST):

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

4 years agoWeb Inspector: Error displayed as an object when passed as a second argument to conso...
nvasilyev@apple.com [Mon, 5 Oct 2015 20:00:24 +0000 (20:00 +0000)]
Web Inspector: Error displayed as an object when passed as a second argument to console.log
https://bugs.webkit.org/show_bug.cgi?id=149799

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._appendExtraParameters):
Don't format errors as objects.

(WebInspector.ConsoleMessageView.prototype._formatParameter):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsValue):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsString):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsNode):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsObject):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsError):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsArray):
Replace an unnecessary span element with a document fragment.

* UserInterface/Views/ErrorObjectView.css:
(.error-object):
Display an error object on the same line as a list bullet.

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

4 years agoMark the line dirty when RenderQuote's text changes.
zalan@apple.com [Mon, 5 Oct 2015 19:55:24 +0000 (19:55 +0000)]
Mark the line dirty when RenderQuote's text changes.
https://bugs.webkit.org/show_bug.cgi?id=149784
rdar://problem/22558169

Reviewed by Antti Koivisto.

When quotation mark changes ( " -> ' or empty string), we
need to mark the line dirty to ensure its content gets laid out properly.

Source/WebCore:

Test: fast/inline/quotation-text-changes-dynamically.html

* rendering/RenderQuote.cpp:
(WebCore::quoteTextRenderer):
(WebCore::RenderQuote::updateText):
(WebCore::fragmentChild): Deleted.

LayoutTests:

* fast/inline/quotation-text-changes-dynamically-expected.txt: Added.
* fast/inline/quotation-text-changes-dynamically.html: Added.

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

4 years agoAllow an object's marking state to track The Three Colors
fpizlo@apple.com [Mon, 5 Oct 2015 19:35:32 +0000 (19:35 +0000)]
Allow an object's marking state to track The Three Colors
https://bugs.webkit.org/show_bug.cgi?id=149654

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

I want to make GC marking concurrent (see https://bugs.webkit.org/show_bug.cgi?id=149432).
Concurrent GC require barriers to be executed during certain heap operations. We already have a
generational GC. Generational GCs also need barriers, and we already have those. The generational
GC barrier that we use is the "sticky mark bit" barrier. Ordinarily, mark bits get reset after a
collection. In our collector, there is a secondary mark bit that "sticks" - i.e. it does not get
reset. If the sticky mark bit is set in between two collections, then we know that the object is in
old space. This is sufficient to determine when to put things into remembered sets. Additionally,
the sticky mark bit is actually a tri-state that can also tell us if the object has been placed on
a remembered set.

This is awfully similar to what you want in a concurrent GC. Concurrent GCs typically want writes
to the heap that change the object graph to do different things depending on an object's marking
state, which is usually referred to as its color. White means that the object has never been seen
by the collector. All white objects are presumed dead at the flip. Grey objects are those that are
known to the collector but have not been scanned. Black objects are those that have been scanned,
and will not be scanned again. White is exactly just "not being marked", and both grey and black
mean "marked" - with "black" meaning "marked but not on any worklist". That's quite a bit like the
current "Marked" and "MarkedAndRemembered" states that we have for generational GC.
"MarkedAndRemembered" is a lot like "grey", and "Marked" is a lot like "black".

I want to make a concurrent GC that unifies the generational and concurrent barriers into a single
fast path check. Even better if the two barriers are entirely identical. You can do this using
Pirinen's technique #2 [1], originally due to Guy Steele [2]: when doing o.f=v where o is black and
v is white, turn o grey again. This is like remembering an object, in the sense that our gen GC
"rememberes" o when o is old and v is new. It remembers objects by putting them on the mark stack,
setting the generational state to MarkedAndRemembered, and doing nothing to the primary mark bit.

This makes our concurrent GC approach pretty obvious. We want to use one barrier for concurrent and
generational, and we want to basically keep our current barriers unchanged. The only things missing
are just some small changes to allow the concurrent GC to know precisely when an object is black,
and to know during object visiting if we are visiting the object for the first time during a
collection or a subsequent time due to barrier re-greying (concurrent GC) or barrier remembering
(generational GC). So, this patch does the following:

- Changes the terminology used for the gcData header byte in JSCell. This changes the name of this
  to cellState, and introduces a new enumeration called CellState. This new enumeration behaves a
  lot like the old GCData did. It has the following members, with the following correspondence to
  the old GCData:

  OldBlack: this is like Marked, with the exception that we ensure that an object becomes OldBlack
      as soon as the object starts to be scanned. Previously, an object might be
      MarkedAndRemembered during scanning and we'd turn all MarkedAndRemembered objects into Marked
      objects during a post-processing step at the end of GC. This patch gets rid of that
      post-processing. The act of visiting an object unconditionally makes it OldBlack. Note that
      our definition of "black" is not that the object is done being scanned, but that it is either
      being scanned right now or it has already been scanned. This is like a combination of
      Siebert's anthracite and black states [3].

  NewWhite: this is exactly NotMarked. It's the state that objects get when they are allocated.
      It's impossible for an object to return to this state.

  OldGrey: the object is on the mark stack and will be scanned at some point in the future. This
      also means that this isn't the first time in this cycle that the object has been grey. In an
      eden collection, an old object that has been remembered is thought of as being OldGrey, even
      if this is the first time during this eden collection that it is grey. That's because an eden
      collection must behave "as if" the grey->black transition for old objects magically happened
      at the start of GC. Remembered objects are like old objects that underwent a concurrent
      barrier re-greying just after the magical old object grey->black transition at the start of
      GC. This state is almost exactly like MarkedAndRemembered, except that an object now
      transitions from OldGrey to OldBlack at the beginning of visiting, rather than how previously
      we transitioned from MarkedAndRemembered to Marked at the bitter end of GC.

  NewGray: the object is on the mark stack and will be scanned at some point in the future. This
      state has no clear relative in the old state system. It means that the object became grey due
      to ordinary marking. Previously, ordinary marking would make the object Marked.

- Removal of the post-processing phase that "clears" the remembered set by moving all remembered
  objects to the Marked state. This now happens magically during visiting, as described above.

- SlotVisitor now remembers the state that the object did have just before visiting. While visiting
  that object, it's possible to query what the state was. This is used for copy space decisions and
  for extra memory usage accounting. We don't want to put the backing store on the copy worklist,
  and we don't want to count extra memory usage, if the object was OldGrey at the start of
  visiting. Previously, we would be able to just ask if the object was MarkedAndRemembered since
  that state wouldn't get cleared until after all marking finished. This change also simplifies
  some APIs, because there is no need to pass the JSCell* pointer, since these SlotVisitor methods
  no longer ask the cell for its state - instead they use the saved pre-visiting state.

- Removal of a bunch of helpers and abstractions. Previously we had various methods for asking if
  an object was "marked" and if an object was "remembered". We had helpers for adjusting these
  states, and those helpers would assert that they were being used the right way. This is not very
  useful for concurrent GC, since now the set of possible state transitions is much larger. Also,
  the previous use of the word "marked" was pretty bad - for example in Heap, "marked" refers to
  the primary mark bit (that gets cleared at the flip), while in JSCell, "marked" refers to the
  sticky mark bit (that does not get cleared, ever). This change gets rid of a lot of those helpers
  and inlines their logic. This actually makes the code easier and more fun to read, since you can
  now look at the marking and barrier code and see how that code uses the four CellStates. For
  example, it's fun to see that the barrier gets fired for o.f=v exactly when o is OldBlack and v
  is NewWhite.

This change shouldn't have any effect on performance or GC behavior. It does put our code in a
weird state where we now have states and comments referencing a concurrent GC that doesn't exist
yet.

Finally, some thoughts about the concurrent GC barrier and its implications for performance. This
barrier exhibits very poor guarantees about collector progress, but maximizes throughput by just
reusing the existing barrier code we already emit and optimize. I believe that even our epoch-based
barrier insertion DFG phase is correct for the concurrent interpretation of our existing barrier.
But, the barrier can regress the progress that the collector has made for two reasons:

Incremental update: you don't want to use this barrier with a black stack, since that would mean
that heap loads of white objects will have to explicitly re-grey the stack. The way you implement
this kind of collector is that collector termination will rescan the stack. Termination is reached
only if the at-termination re-scan greys no objects. This means that the collector is a fixpoint.
Luckily, our collector is already a fixpoint because of opaque roots and structure transitions.

Marking ain't monotonic: normally, once an object is black, it stays that way. In this collector,
black objects may become grey again. I don't have personal experience with such concurrent GCs, but
I suspect that this will basically be fine. Concurrent collections finish pretty quickly, and the
mutator usually touches only a subset of the heap. Only that subset of the heap that the mutator is
touching could be re-greyed. Probably, the GC will have to be hybrid incremental and concurrent,
and towards the end of GC when we do the termination stack re-scan, we can ensure that the
collector does some minimal amount of marking. If the minimal amount of marking done by the
collector is large enough, we can ensure that we reach termination before the mutator can regress
progress. The barrier cannot un-terminate the collector; if the collector reaches termination and
the barrier re-greys an object then it's actually doing a generational remembering rather than a
concurrent re-greying.

That's sort of the cute thing about the barrier - it is exactly a re-greying barrier during GC and
it is exactly a remembering barrier in between GCs.

[1] http://www.cs.utexas.edu/ftp/garbage/submit/readable/ppirinen11.ps
[2] http://dl.acm.org/citation.cfm?id=361005
[3] http://www.aicas.com/papers/ISMM132-siebert.pdf

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitChildren):
* ftl/FTLAbstractHeapRepository.cpp:
(JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::masqueradesAsUndefinedWatchpointIsStillValid):
(JSC::FTL::DFG::LowerDFGToLLVM::loadCellState):
(JSC::FTL::DFG::LowerDFGToLLVM::emitStoreBarrier):
(JSC::FTL::DFG::LowerDFGToLLVM::loadMarkByte): Deleted.
* heap/CellState.h: Added.
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::rememberCurrentlyExecutingCodeBlocks):
* heap/CopiedBlock.h:
* heap/CopiedBlockInlines.h:
(JSC::CopiedBlock::reportLiveBytes):
(JSC::CopiedBlock::shouldReportLiveBytes): Deleted.
* heap/GCLogging.cpp:
(JSC::LoggingFunctor::reviveCells):
* heap/Heap.cpp:
(JSC::Heap::markRoots):
(JSC::Heap::visitWeakHandles):
(JSC::Heap::updateObjectCounts):
(JSC::Heap::addToRememberedSet):
(JSC::Heap::clearRememberedSet): Deleted.
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::isLive):
(JSC::Heap::isMarked):
(JSC::Heap::writeBarrier):
(JSC::Heap::reportExtraMemoryAllocated):
(JSC::Heap::reportExtraMemoryVisited):
(JSC::Heap::isRemembered): Deleted.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::append):
(JSC::SlotVisitor::visitChildren):
(JSC::SlotVisitor::donateKnownParallel):
(JSC::SlotVisitor::drain):
(JSC::visitChildren): Deleted.
* heap/SlotVisitor.h:
(JSC::SlotVisitor::childCount):
(JSC::SlotVisitor::incrementChildCount):
(JSC::SlotVisitor::dataBeforeVisitingCurrentObject):
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::internalAppend):
(JSC::SlotVisitor::copyLater):
(JSC::SlotVisitor::reportExtraMemoryVisited):
(JSC::SlotVisitor::heap):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::jumpIfIsRememberedOrInEden):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSCell.h:
(JSC::JSCell::cellState):
(JSC::JSCell::setCellState):
(JSC::JSCell::structureIDOffset):
(JSC::JSCell::indexingTypeOffset):
(JSC::JSCell::cellStateOffset):
(JSC::JSCell::setMarked): Deleted.
(JSC::JSCell::setRemembered): Deleted.
(JSC::JSCell::isMarked): Deleted.
(JSC::JSCell::isRemembered): Deleted.
(JSC::JSCell::gcDataOffset): Deleted.
* runtime/JSCellInlines.h:
(JSC::JSCell::JSCell):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren):
* runtime/JSObject.cpp:
(JSC::JSObject::copyBackingStore):
* runtime/JSString.cpp:
(JSC::JSString::visitChildren):
* runtime/StructureIDBlob.h:
(JSC::StructureIDBlob::StructureIDBlob):
(JSC::StructureIDBlob::operator=):
* runtime/WeakMapData.cpp:
(JSC::WeakMapData::visitChildren):
(JSC::WeakMapData::set):
* tests/stress/basic-eden-gc-test.js: Added.
    Hilariously, an earlier version of this patch that didn't have the NewGrey/OldGrey distinction
    would only crash super-big tests that GCd twice but it didn't crash any small focused test. All
    it took to show the need for the NewGrey/OldGrey distinction was this super simple test.

Source/WebCore:

No new tests because no new behavior.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

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

4 years agoCannot select certain text on Wikipedia homepage even when zoomed in.
enrica@apple.com [Mon, 5 Oct 2015 18:49:54 +0000 (18:49 +0000)]
Cannot select certain text on Wikipedia homepage even when zoomed in.
https://bugs.webkit.org/show_bug.cgi?id=149758
rdar://problem/22407947

Reviewed by Dan Bernstein.

Several functions that handle gestures for text selection are used for both
editable and non editable content. When used on editable content, the point
where the gesture occurs needs to be constrained within the boundaries of the
editable element. In the WebProcess we decide whether to constrain the point or not only based
on the presence of the assisted node.
That unfortunately does not guarantee that the user is actually editing the element,
but only that the element is focused. Since the knowledge about the interaction exists reliably
in the UI process, this patch adds a parameter to each gesture handler that tries to clip
the point, to indicate whether the user is actually interacting with the element so that
in the WebProcess the assisted node information can be used to constrain the point.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::deviceOrientation):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _isInteractingWithAssistedNode]):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
(-[WKContentView selectPositionAtPoint:completionHandler:]):
(-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
(-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
(-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
(-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::rangeForGranularityAtPoint):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPage::updateSelectionWithExtentPoint):

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

4 years agoUpdate setImageSmoothingQuality for additional reviews.
commit-queue@webkit.org [Mon, 5 Oct 2015 18:31:38 +0000 (18:31 +0000)]
Update setImageSmoothingQuality for additional reviews.
https://bugs.webkit.org/show_bug.cgi?id=149541

Patch by Katlyn Graff <kgraff@apple.com> on 2015-10-05
Reviewed by Chris Dumez.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setImageSmoothingQuality):

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

4 years agoRemove unused HistoryItem::targetItem()
akling@apple.com [Mon, 5 Oct 2015 18:13:15 +0000 (18:13 +0000)]
Remove unused HistoryItem::targetItem()
<https://webkit.org/b/149803>

Reviewed by Anders Carlsson.

Source/WebCore:

This is ancient code with no remaining clients since 2010 (r53650)

* history/HistoryItem.cpp:
(WebCore::HistoryItem::findTargetItem): Deleted.
(WebCore::HistoryItem::targetItem): Deleted.
* history/HistoryItem.h:

Source/WebKit/mac:

Remove the only (unused) client of HistoryItem::targetItem().

* History/WebHistoryItem.mm:
* History/WebHistoryItemPrivate.h:

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

4 years agoFix the iOS 8 build, where -[UIApplication _enqueueHIDEvent:] is not
simon.fraser@apple.com [Mon, 5 Oct 2015 17:58:59 +0000 (17:58 +0000)]
Fix the iOS 8 build, where -[UIApplication _enqueueHIDEvent:] is not
available, and tidy up the #ifdefs in the UIKitSPI header.

* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator _sendHIDEvent:]):
* WebKitTestRunner/ios/UIKitSPI.h:

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

4 years agoUnprefix -webkit-font-feature-settings
mmaxfield@apple.com [Mon, 5 Oct 2015 17:27:16 +0000 (17:27 +0000)]
Unprefix -webkit-font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=149722

Reviewed by Sam Weinig.

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFontFeatureSettings):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialFontFeatureSettings):
(WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings):
(WebCore::StyleBuilderCustom::applyInitialWebkitFontFeatureSettings): Deleted.
(WebCore::StyleBuilderCustom::applyInheritWebkitFontFeatureSettings): Deleted.

Source/WebInspectorUI:

* UserInterface/Models/CSSKeywordCompletions.js:

LayoutTests:

* css3/font-feature-settings-parsing.html:
* css3/font-feature-settings-preinstalled-fonts.html:
* css3/font-feature-settings-rendering-2.html:
* css3/font-feature-settings-rendering.html:
* fast/css/inherited-properties-rare-text-expected.txt:
* fast/css/inherited-properties-rare-text.html:
* fast/text/shaping/shaping-script-order.html:
* fast/text/shaping/shaping-selection-rect.html:
* fonts/unicode-character-font-crash.html:
* scrollbars/scrollbar-scrollbarparts-repaint-crash.html:

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

4 years agoJSC::SlotVisitor should not be a hot mess
ggaren@apple.com [Mon, 5 Oct 2015 17:22:20 +0000 (17:22 +0000)]
JSC::SlotVisitor should not be a hot mess
https://bugs.webkit.org/show_bug.cgi?id=149798

Reviewed by Andreas Kling.

I had to debug JSC::SlotVisitor the other day. It was hard to follow.
Let's make it easy to follow.

* heap/Heap.cpp:
(JSC::Heap::markRoots):
(JSC::Heap::resetVisitors):
(JSC::Heap::objectCount):
(JSC::Heap::addToRememberedSet):
(JSC::Heap::collectAndSweep):
* heap/Heap.h: Deleted the string hash-consing code. It
was dead code.

Since no benchmark noticed the commit that broke this feature, perhaps
it's not worth having.

Either way, the best thing to do with dead code is to delete it.
It's still there in svn if we ever want to pick it up again.

* heap/HeapRootVisitor.h:
(JSC::HeapRootVisitor::visit):
(JSC::HeapRootVisitor::visitor): Removed the private append functions
for unsafe pointers and switched HeapRootVisitor over to the public
specially named functions for unsafe pointers.

In future, we should either remove the public specially named functions
or remove HeapRootVisitor, since they serve the same purpose. At least
for now we don't have pairs of functions on SlotVisitor that do the
exact same thing.

* heap/SlotVisitor.cpp:
(JSC::validate): Moved this static function to the top of the file.

(JSC::SlotVisitor::SlotVisitor):
(JSC::SlotVisitor::didStartMarking):
(JSC::SlotVisitor::reset): More hash cons removal.

(JSC::SlotVisitor::append):

(JSC::SlotVisitor::setMarkedAndAppendToMarkStack):
(JSC::SlotVisitor::appendToMarkStack): Renamed these functions to
distinguish them from the up-front helper functions that just do type
conversions. These are the functions that actually do stuff.

Moved these functions out of line to make it easier to set breakpoints,
and to enable code changes for debugging, like printf and synchronous
marking, without recompiling the world.

setMarkedAndAppendToMarkStack is roughly 258 bytes long (not including
function prologue and epilogue), so inlining it was probably not a
great idea in the first place.

(JSC::SlotVisitor::donateKnownParallel):
(JSC::SlotVisitor::drain):
(JSC::SlotVisitor::drainFromShared): Removed some stack probing code.
It was also dead.

(JSC::SlotVisitor::addOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRootTriState):
(JSC::SlotVisitor::opaqueRootCount):
(JSC::SlotVisitor::mergeOpaqueRootsIfNecessary):
(JSC::SlotVisitor::mergeOpaqueRootsIfProfitable):
(JSC::SlotVisitor::donate):
(JSC::SlotVisitor::donateAndDrain):
(JSC::SlotVisitor::copyLater):
(JSC::SlotVisitor::mergeOpaqueRoots):
(JSC::SlotVisitor::harvestWeakReferences):
(JSC::SlotVisitor::finalizeUnconditionalFinalizers):
(JSC::SlotVisitor::dump): Moved more code out-of-line. These code paths
are not hot and/or not small, so we need more evidence before we inline
them. The SlotVisitor headers are included everywhere, so we should
make them include less.

Removed "internal" from all function names because it wasn't applied in
any consistent way that would mean anything.

(JSC::JSString::tryHashConsLock): Deleted.
(JSC::JSString::releaseHashConsLock): Deleted.
(JSC::JSString::shouldTryHashCons): Deleted.
(JSC::SlotVisitor::internalAppend): Deleted.
(JSC::SlotVisitor::validate): Deleted.

* heap/SlotVisitor.h:
(JSC::SlotVisitor::resetChildCount): Deleted.
(JSC::SlotVisitor::childCount): Deleted.
(JSC::SlotVisitor::incrementChildCount): Deleted. Removed this child
count thing. It was dead code.

* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::appendUnbarrieredPointer):
(JSC::SlotVisitor::appendUnbarrieredReadOnlyPointer):
(JSC::SlotVisitor::appendUnbarrieredValue):
(JSC::SlotVisitor::appendUnbarrieredReadOnlyValue): Some renaming and un-inlining.

(JSC::SlotVisitor::appendUnbarrieredWeak): Don't null check our input.
The one true place where null checking happens is our out-of-line
code. All inline functions do only type conversions.

(JSC::SlotVisitor::append):
(JSC::SlotVisitor::appendValues):
(JSC::SlotVisitor::addWeakReferenceHarvester):
(JSC::SlotVisitor::addUnconditionalFinalizer):
(JSC::SlotVisitor::reportExtraMemoryVisited): Some renaming and un-inlining.

(JSC::SlotVisitor::internalAppend): Deleted.
(JSC::SlotVisitor::unconditionallyAppend): Deleted.
(JSC::SlotVisitor::addOpaqueRoot): Deleted.
(JSC::SlotVisitor::containsOpaqueRoot): Deleted.
(JSC::SlotVisitor::containsOpaqueRootTriState): Deleted.
(JSC::SlotVisitor::opaqueRootCount): Deleted.
(JSC::SlotVisitor::mergeOpaqueRootsIfNecessary): Deleted.
(JSC::SlotVisitor::mergeOpaqueRootsIfProfitable): Deleted.
(JSC::SlotVisitor::donate): Deleted.
(JSC::SlotVisitor::donateAndDrain): Deleted.
(JSC::SlotVisitor::copyLater): Deleted.

* runtime/JSString.h:
(JSC::JSString::finishCreation):
(JSC::JSString::setIs8Bit):
(JSC::JSString::isHashConsSingleton): Deleted.
(JSC::JSString::clearHashConsSingleton): Deleted.
(JSC::JSString::setHashConsSingleton): Deleted. More hash cons removal.

* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::currentThreadIsHoldingAPILock):
(JSC::VM::apiLock):
(JSC::VM::haveEnoughNewStringsToHashCons): Deleted.
(JSC::VM::resetNewStringsSinceLastHashCons): Deleted. More hash cons removal.

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

4 years ago[GStreamer] Replace uses of std::bind() with lambdas
zandobersek@gmail.com [Mon, 5 Oct 2015 17:18:26 +0000 (17:18 +0000)]
[GStreamer] Replace uses of std::bind() with lambdas
https://bugs.webkit.org/show_bug.cgi?id=149802

Reviewed by Carlos Garcia Campos.

Instead of std::bind(), use C++ lambdas to create std::function<>
wrappers in GStreamer-related class implementations.

Ref-counted classes are protected by capturing a RefPtr object.
GstObject-derived objects are protected by capturing a GRefPtr object.
Necessary specializations for WebKitVideoSink and WebKitWebSrc are added.

* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::createBus):
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef):
(WTF::refGPtr<WebKitVideoSink>):
(WTF::derefGPtr<WebKitVideoSink>):
(WTF::refGPtr<WebKitWebSrc>):
(WTF::derefGPtr<WebKitWebSrc>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::handleSample):
(WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::videoChanged):
(WebCore::MediaPlayerPrivateGStreamer::videoCapsChanged):
(WebCore::MediaPlayerPrivateGStreamer::audioChanged):
(WebCore::MediaPlayerPrivateGStreamer::textChanged):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChanged):
(WebCore::MediaPlayerPrivateGStreamerBase::muteChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::activeChanged):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(webkitVideoSinkRender):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcChangeState):
(webKitWebSrcNeedDataCb):
(webKitWebSrcEnoughDataCb):
(webKitWebSrcSeekDataCb):

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

4 years agoInline cache repatching should be throttled if it happens a lot
fpizlo@apple.com [Mon, 5 Oct 2015 17:05:24 +0000 (17:05 +0000)]
Inline cache repatching should be throttled if it happens a lot
https://bugs.webkit.org/show_bug.cgi?id=149796
rdar://problem/22674436

Reviewed by Saam Barati.

Source/JavaScriptCore:

We noticed a slight PLT regression from http://trac.webkit.org/changeset/189586. It's because
some pages do things that our inline caches mishandle, in the sense that some ICs end up
repatching themselves very frequently. The cost of repatching outweighs the speed-up on those
pages. There are probably super smart things we could do to tune the IC heuristics to make the
ICs do the right thing on those pages. But more fundamentally, we should ensure that our ICs
back off from continuous repatching if they repatch a lot. That's what this change does.

With this change, StructureStubInfo counts the number of repatchings. If that exceeds a
threshold, we put the IC into a cool-down mode, where some number of future repatch events do
nothing but decrement the cool-down counter. The duration of cool-down increases exponentially
every time we have to do it.

This change also outlines a lot of code. The fact that StructureStubInfo had a lot of inline
methods was starting to get on my nerves. Now it only has inline methods for things that need
to be inlined. Also, I changed StructureStubInfo to be a class rather than a struct. Maybe
with enough such incremental changes, eventually StructureStubInfo will actually behave like a
proper class.

This has no effect on JSC benchmarks. It progresses one of the pages that was hit by the
regression by 15%. It's hard to see if this totally fixes the entire PLT regression since the
geomean regression was very close to noise.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::printGetByIdCacheStatus):
(JSC::CodeBlock::printPutByIdCacheStatus):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::checkIfOptimizationThresholdReached):
* bytecode/CodeBlock.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::GetByIdStatus::computeFor):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* bytecode/PolymorphicAccess.h:
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeForStubInfo):
* bytecode/StructureStubClearingWatchpoint.h:
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::StructureStubInfo):
(JSC::StructureStubInfo::~StructureStubInfo):
(JSC::StructureStubInfo::initGetByIdSelf):
(JSC::StructureStubInfo::initPutByIdReplace):
(JSC::StructureStubInfo::initStub):
(JSC::StructureStubInfo::deref):
(JSC::StructureStubInfo::addAccessCase):
* bytecode/StructureStubInfo.h:
(JSC::StructureStubInfo::considerCaching):
(JSC::StructureStubInfo::willRepatch):
(JSC::StructureStubInfo::willCoolDown):
(JSC::getStructureStubInfoCodeOrigin):
(JSC::StructureStubInfo::StructureStubInfo): Deleted.
(JSC::StructureStubInfo::initGetByIdSelf): Deleted.
(JSC::StructureStubInfo::initPutByIdReplace): Deleted.
(JSC::StructureStubInfo::initStub): Deleted.
(JSC::StructureStubInfo::seenOnce): Deleted.
(JSC::StructureStubInfo::setSeen): Deleted.
* jit/JIT.h:
* jit/JITOperations.cpp:
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):
(JSC::tryRepatchIn):
* runtime/Options.h:

Source/WTF:

Add some helpers for saturated math.

* wtf/MathExtras.h:
(WTF::incrementWithSaturation):
(WTF::leftShiftWithSaturation):

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

4 years agoRemove CancelResourceLoader message
antti@apple.com [Mon, 5 Oct 2015 15:12:27 +0000 (15:12 +0000)]
Remove CancelResourceLoader message
https://bugs.webkit.org/show_bug.cgi?id=149801

Reviewed by Andreas Kling.

It has no clients.

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::messageSenderDestinationID):
(WebKit::WebResourceLoader::detachFromCoreLoader):
(WebKit::WebResourceLoader::cancelResourceLoader): Deleted.
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:

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

4 years agoRemove unused HistoryItem::parent
akling@apple.com [Mon, 5 Oct 2015 14:38:50 +0000 (14:38 +0000)]
Remove unused HistoryItem::parent
<https://webkit.org/b/149803>

Reviewed by Anders Carlsson.

Source/WebCore:

Remove the effectively-unused "parent" field from HistoryItem.
This also allows us to get rid of a HistoryItem constructor.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem): Deleted.
(WebCore::HistoryItem::reset): Deleted.
(WebCore::HistoryItem::parent): Deleted.
(WebCore::HistoryItem::setParent): Deleted.
* history/HistoryItem.h:
(WebCore::HistoryItem::create): Deleted.
* loader/HistoryController.cpp:
(WebCore::HistoryController::initializeItem): Deleted.

Source/WebKit/mac:

Remove the only (unused) client of HistoryItem's with-parent constructor.

* History/WebHistoryItem.mm:
(-[WebHistoryItem initWithURL:target:parent:title:]): Deleted.
* History/WebHistoryItemInternal.h:

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

4 years agoGLContext should control ownership of context-related objects
zandobersek@gmail.com [Mon, 5 Oct 2015 07:13:50 +0000 (07:13 +0000)]
GLContext should control ownership of context-related objects
https://bugs.webkit.org/show_bug.cgi?id=149794

Reviewed by Martin Robinson.

Creation of GLContext objects can depend on various platform-specific
objects like native window representations. Since these objects are
used solely for the GLContext purposes, it would make sense to allow
GLContext to provide an extensible way to impose ownership on these
objects and control their lifetime.

GLContext::Data is declared with a defaulted virtual destructor.
Users of these implementations can declare classes that derive from
GLContext::Data and store context-related objects in instances of the
derived class, and ensure that these objects are properly cleaned up
when GLContext destroys the Data object.

The GLContext::Data object is managed through a protected
std::unique_ptr<> member in the GLContext class. For now the member
is only set in GLContextEGL::createWindowContext() and is destroyed
during the GLContext destruction.

The local OffscreenContextData class in
PlatformDisplayWayland::createSharingGLContext() derives from
GLContext::Data and is used to store the wl_surface and
EGLNativeWindowType (aka wl_egl_window) objects for offscreen
GLContexts under the Wayland platform that are used for the sharing
context and WebGL, effectively avoiding the leak that would further
propagate problems into the compositor and the graphics library.
(Such offscreen contexts are actually mimicked via a 1x1px
wl_egl_window object that acts as a dummy base for the related
wl_surface object).

* platform/graphics/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::createSharingGLContext):

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

4 years agoMake gdk.h inclusion in FontPlatformDataFreeType.cpp properly GTK-specific
zandobersek@gmail.com [Mon, 5 Oct 2015 07:04:44 +0000 (07:04 +0000)]
Make gdk.h inclusion in FontPlatformDataFreeType.cpp properly GTK-specific
https://bugs.webkit.org/show_bug.cgi?id=149793

Reviewed by Carlos Garcia Campos.

* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
Instead of including <gdk/gdk.h> header for all platforms but EFL, only
include it for the GTK platform, since no other platform depends on the
GDK library.

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

4 years ago[GTK] Remove duplicate entries in WebKitTestRunner_SOURCES
zandobersek@gmail.com [Mon, 5 Oct 2015 05:55:37 +0000 (05:55 +0000)]
[GTK] Remove duplicate entries in WebKitTestRunner_SOURCES
https://bugs.webkit.org/show_bug.cgi?id=149792

Reviewed by Martin Robinson.

* WebKitTestRunner/PlatformGTK.cmake: Don't list build targets
for WebKitTestRunner multiple times.

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

4 years agoCodeBlock.h shouldn't be included from everywhere
fpizlo@apple.com [Sun, 4 Oct 2015 23:25:44 +0000 (23:25 +0000)]
CodeBlock.h shouldn't be included from everywhere
https://bugs.webkit.org/show_bug.cgi?id=149785

Reviewed by Andreas Kling.

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp:
* dfg/DFGAdaptiveStructureWatchpoint.cpp:
* interpreter/CallFrame.cpp:
(JSC::CallFrame::callSiteBitsAreBytecodeOffset):
(JSC::CallFrame::callSiteBitsAreCodeOriginIndex):
(JSC::CallFrame::callSiteAsRawBits):
(JSC::CallFrame::callSiteIndex):
(JSC::CallFrame::hasActivation):
(JSC::CallFrame::uncheckedActivation):
(JSC::CallFrame::stack):
* interpreter/CallFrameInlines.h: Removed.
* interpreter/Interpreter.cpp:
* interpreter/StackVisitor.cpp:
* runtime/DirectArguments.cpp:
* runtime/ErrorInstance.cpp:
* runtime/JSArray.cpp:
* runtime/JSCInlines.h:
* runtime/LiteralParser.cpp:
* runtime/NullSetterFunction.cpp:
* tools/JSDollarVMPrototype.cpp:

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

4 years agoFix the Apple Internal iOS build after <http://trac.webkit.org/changeset/190515>
dbates@webkit.org [Sun, 4 Oct 2015 22:30:17 +0000 (22:30 +0000)]
Fix the Apple Internal iOS build after <trac.webkit.org/changeset/190515>
(https://bugs.webkit.org/show_bug.cgi?id=149753)

For now, support calling build-layouttestrelay without --ios-simulator so long
as we are building on a Mac.

* Scripts/build-layouttestrelay:

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

4 years agoFix a typo in ChangeLog.
ap@apple.com [Sun, 4 Oct 2015 20:49:17 +0000 (20:49 +0000)]
Fix a typo in ChangeLog.

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

4 years agoMark tests as flay for
ap@apple.com [Sun, 4 Oct 2015 20:47:01 +0000 (20:47 +0000)]
Mark tests as flay for
https://bugs.webkit.org/show_bug.cgi?id=148890

http/tests/contentfiltering/load-substitute-data-from-appcache.html and
http/tests/appcache/decide-navigation-policy-after-delay.html crash
in DocumentLoader::dataReceived sometimes

* platform/wk2/TestExpectations:

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

4 years agoWeb Inspector: Wrong column numbers in error object views
nvasilyev@apple.com [Sun, 4 Oct 2015 18:33:21 +0000 (18:33 +0000)]
Web Inspector: Wrong column numbers in error object views
https://bugs.webkit.org/show_bug.cgi?id=149795

Source/WebInspectorUI:

Convert columnNumber and lineNumber properties from strings to numbers
to prevent accidental string concatenations.

Reviewed by Timothy Hatcher.

* UserInterface/Models/StackTrace.js:
(WebInspector.StackTrace._parseStackTrace):

LayoutTests:

Reviewed by Timothy Hatcher.

* inspector/debugger/js-stacktrace-expected.txt:

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

4 years agoSupport Trac 1.0.x XML timeline link format
ap@apple.com [Sun, 4 Oct 2015 17:49:08 +0000 (17:49 +0000)]
Support Trac 1.0.x XML timeline link format
https://bugs.webkit.org/show_bug.cgi?id=149786

Reviewed by Lucas Forschler.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
(Trac.prototype._convertCommitInfoElementToObject):

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

4 years agoFix some errors on bot watcher's dashboard
ap@apple.com [Sun, 4 Oct 2015 17:01:01 +0000 (17:01 +0000)]
Fix some errors on bot watcher's dashboard
https://bugs.webkit.org/show_bug.cgi?id=149789

Reviewed by Lucas Forschler.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js:
(BuildbotTesterQueueView.prototype.appendBuilderQueueStatus): We may not get to layout
tests step, in which case layoutTestResults.tooManyFailures would raise an exception.

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

4 years agoBot watcher's dashboard builders should turn yellow when svn fails
ap@apple.com [Sun, 4 Oct 2015 16:57:08 +0000 (16:57 +0000)]
Bot watcher's dashboard builders should turn yellow when svn fails
https://bugs.webkit.org/show_bug.cgi?id=149791

Reviewed by Lucas Forschler.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js:
(BuildbotBuilderQueueView.prototype.appendBuilderQueueStatus):
(BuildbotBuilderQueueView.prototype.update):

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

4 years ago"Plug-in is blocked" message doesn't draw correctly
commit-queue@webkit.org [Sun, 4 Oct 2015 02:38:19 +0000 (02:38 +0000)]
"Plug-in is blocked" message doesn't draw correctly
https://bugs.webkit.org/show_bug.cgi?id=149741
<rdar://problem/22920949>

Patch by Conrad Shultz and Ricky Mondello.

Patch by Ricky Mondello <rmondello@apple.com> on 2015-10-03
Reviewed by Anders Carlsson.

Source/WebCore:

No new tests are added.

Add PluginData API to check whether a MIME type is supported, regardless of plug-in visibility.

* plugins/PluginData.cpp:
(WebCore::PluginData::getWebVisibleMimesAndPluginIndices): Adopt getMimesAndPluginIndiciesForPlugins.
(WebCore::PluginData::getMimesAndPluginIndices): Added.
(WebCore::PluginData::getMimesAndPluginIndiciesForPlugins): Essentially factored out of
    getWebVisibleMimesAndPluginIndices.
(WebCore::PluginData::supportsMimeType): Added. Somewhat similar to preexisting supportsWebVisibleMimeType.
* plugins/PluginData.h: Declare supportsMimeType.

Source/WebKit2:

If a WebKit client sets plug-in X to not be visible to the web, that doesn't mean we shouldn't consult
that plug-in when determining what kind of object type an object is. Properly classifying a non-web-visible
Netscape plug-in as such allows its bounds to properly measured, allowing it to be drawn properly.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::objectContentType): Use PluginData's supportsMimeType, rather than its
    supportsWebVisibleMimeType, when determining the ObjectContentType for a MIME type on a url.

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

4 years agoUnreviewed, rolling out r190522.
commit-queue@webkit.org [Sun, 4 Oct 2015 01:45:21 +0000 (01:45 +0000)]
Unreviewed, rolling out r190522.
https://bugs.webkit.org/show_bug.cgi?id=149787

Caused a lot of leaks (Requested by ap on #webkit).

Reverted changeset:

"Unreviewed, rolling back in r190450"
https://bugs.webkit.org/show_bug.cgi?id=149727
http://trac.webkit.org/changeset/190522

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

4 years agofast/events/overflow-scroll-fake-mouse-move.html is flaky
ap@apple.com [Sun, 4 Oct 2015 00:43:03 +0000 (00:43 +0000)]
fast/events/overflow-scroll-fake-mouse-move.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=138697

Reviewed by Brent Fulgham.

* fast/events/overflow-scroll-fake-mouse-move.html:

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

4 years agoMake the test added in r190530 not time out on the ports that don't enable shadow...
rniwa@webkit.org [Sat, 3 Oct 2015 10:13:40 +0000 (10:13 +0000)]
Make the test added in r190530 not time out on the ports that don't enable shadow DOM.

Call waitUntilDone after calling attachShadow so that an exception thrown by calling attachShadow
will prevent waitUntilDone from getting called on those ports.

* fast/shadow-dom/insert-child-to-assigned-node.html:

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

4 years agoAdd iOS 9 Simulator builders and testers to WebKit Bot Watcher's Dashboard
dbates@webkit.org [Sat, 3 Oct 2015 05:04:48 +0000 (05:04 +0000)]
Add iOS 9 Simulator builders and testers to WebKit Bot Watcher's Dashboard
https://bugs.webkit.org/show_bug.cgi?id=149769

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS9Simulator.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS9Simulator@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
(table.queue-grid tr.platform.ios-simulator-9 img.logo):

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

4 years agoWeb Inspector: Add breakpoint option to ignore n times before stopping
mattbaker@apple.com [Sat, 3 Oct 2015 03:18:19 +0000 (03:18 +0000)]
Web Inspector: Add breakpoint option to ignore n times before stopping
https://bugs.webkit.org/show_bug.cgi?id=147664

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* debugger/Breakpoint.h:
(JSC::Breakpoint::Breakpoint):
Added ignoreCount and hitCount fields. Cleaned up initializers.

* debugger/Debugger.cpp:
(JSC::Debugger::hasBreakpoint):
If a breakpoint matches the current text position, increment breakpoint hit count and
compare with ignore count before testing the breakpoint condition.

* inspector/ScriptBreakpoint.h:
(Inspector::ScriptBreakpoint::ScriptBreakpoint):
Added ignoreCount field. Cleaned up initializers.

* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::setBreakpoint):
Added ignoreCount field.

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::buildObjectForBreakpointCookie):
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
(Inspector::InspectorDebuggerAgent::setBreakpoint):
(Inspector::InspectorDebuggerAgent::continueToLocation):
(Inspector::InspectorDebuggerAgent::didParseSource):
Plumbing for ignoreCount property.

* inspector/protocol/Debugger.json:
Added optional ignoreCount property to BreakpointOptions object.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New strings for breakpoint popover labels.

* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
Add ignoreCount UI to popover, if backend support exists. UI based on same
feature in Xcode's breakpoint editing dialog.
(WebInspector.BreakpointPopoverController.prototype._popoverIgnoreInputChanged):
User input sanity checks on numeric input.

* UserInterface/Controllers/DebuggerManager.js:
Listen for changes to breakpoint ignoreCount property.

* UserInterface/Models/Breakpoint.js:
(WebInspector.Breakpoint):
(WebInspector.Breakpoint.prototype.get ignoreCount):
(WebInspector.Breakpoint.prototype.set ignoreCount):
New property for ignoreCount.
(WebInspector.Breakpoint.prototype.get options):
Added ignoreCount to options object.
(WebInspector.Breakpoint.prototype.get info):
Added ignoreCount to info object.

* UserInterface/Views/BreakpointPopoverController.css:
(#edit-breakpoint-popover-ignore):
New styles for breakpoint popover.

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

4 years agoAdd shared code for a new a graphics benchmark
commit-queue@webkit.org [Sat, 3 Oct 2015 03:10:13 +0000 (03:10 +0000)]
Add shared code for a new a graphics benchmark
https://bugs.webkit.org/show_bug.cgi?id=149691

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-10-02
Reviewed by Ryosuke Niwa.

This set of classes will be shared and used by the tests and the runner
of a new graphics benchmark.

* Animometer/resources: Added.
* Animometer/resources/algorithm.js: Added.
(Array.prototype.swap): Swaps two elements in an array.
(Heap): Binary Min/Max Heap object
(Heap.prototype._parentIndex): Given the child node index, it returns the parent index.
(Heap.prototype._leftIndex): Given the parent node index, it returns the left node index.
(Heap.prototype._rightIndex): Given the parent node index, it returns the right node index.
(Heap.prototype._childIndex): Given the parent node index, it returns the child index that may violate the heap property.
(Heap.prototype.init): Initializes the heap state.
(Heap.prototype.top): Returns the value stored at the top of the heap.
(Heap.prototype.push): Pushes a new node at the top of the heap.
(Heap.prototype.pop): Extracts the top node of the heap.
(Heap.prototype._bubble): Fixes the heap property by moving upward.
(Heap.prototype._sink): Fixes the heap property by moving downward.
(Heap.prototype.str): Prints the nodes of the heap to a string.
(Heap.prototype.values): Returns the last "size" heap elements values.

(Algorithm.createMinHeap): Creates a size-bounded min-heap object.
(Algorithm.createMaxHeap): Creates a size-bounded max-heap object.

* Animometer/resources/extensions.js: Added.
(Point): Point object but can be used as size also.
(Point.pointOnCircle): Given, the radius of the circle and the angle of the point, it returns a point object.
(Point.pointOnEllipse): Given, the radiuses of the ellipse and the angle of the point, it returns a point object.
(Point.prototype.get width): Should be called when the point is used as size.
(Point.prototype.get height): Should be called when the point is used as size.
(Point.prototype.get center): Should be called when the point is used as size.
(Point.prototype.add): Returns a new point = this + other.
(Point.prototype.subtract): Returns a new point = this - other.
(Point.prototype.multiply): Returns a new point = this * other.
(Point.prototype.move): Moves the point in a given direction, velocity, time period.

(Insets): Represents borders of a container.
(Insets.prototype.get width): Returns left + right.
(Insets.prototype.get height): Returns top + bottom.

(SimplePromise):
(SimplePromise.prototype.then):
(SimplePromise.prototype.resolve):
Moved from Animometer/runner/resources/benchmark-runner.js since tests also need it.

(Options): Benchmark running options as they are set by the user.

(ProgressBar): Manages a progress bar element. The progress bar is divided into equal length ranges.
(ProgressBar.prototype._progressToPercent): Converts the progress into a percentage.
(ProgressBar.prototype.incRange): Moves to the next range (a range is the running time of a single test).
(ProgressBar.prototype.setPos): Draws the current progress in the current range.

(RecordTable): Shows the results of running a benchmark in a tabular form.
(RecordTable.prototype.clear): Clears the results table.
(RecordTable.prototype._showTitles): Shows the header titles and appends the sub-titles to a queue.
(RecordTable.prototype._showHeader): Shows the table header titles.
(RecordTable.prototype._showEmpty): Shows an empty table cell.
(RecordTable.prototype._showValue): Shows a number value in the results table.
(RecordTable.prototype._showSamples): Shows a button for the sampled data graph.
(RecordTable.prototype._showTest): Shows the results of a single test.
(RecordTable.prototype._showSuite): Shows the results of a single suite.
(RecordTable.prototype.showRecord): Shows a single iteration for a single test.
(RecordTable.prototype.showIterations): Shows the results of all the suites of the iterations.

* Animometer/resources/sampler.js: Added.
(Statistics.sampleMean): Returns the sample mean.
(Statistics.unbiasedSampleStandardDeviation): Returns the unbiased sample variance (i.e. with Bessel's correction)
(Statistics.geometricMean): Returns the geometric mean.

(Experiment): Represents a sampling experiment.
(Experiment.prototype._init): Called when the object is created and when startSampling() is called.
(Experiment.prototype.startSampling): Called after warmup period. Restarts collecting sampled data points.
(Experiment.prototype.sample): Add a new data point.
(Experiment.prototype.mean): Returns the sample mean for the current sampled data points.
(Experiment.prototype.standardDeviation): Returns the sample standard deviation for the current sampled data points.
(Experiment.prototype.percentage): Returns the percentage of the standard deviation divided to the mean.
(Experiment.prototype.confidenceIntervalDelta): Calculates the confidence delta for the current sampled data given a confidence level.
(Experiment.prototype.concern): Returns the average of the worst given percentage from the sampled data.
(Experiment.prototype.score): Returns a score for the sampled data. It is the geometric mean of sampleMean and concern.

(Sampler): Represents a compound experiment. It manages sampling multiple data points at the same time offset.
(Sampler.prototype.startSampling): Called after warming up period. Restarts collecting sampled data points.
(Sampler.prototype.sample): Add a new data vector at a given time offset.

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