WebKit-https.git
5 years agoWeb Inspector: Debugger sidebar should have a filter button for breakpoints
jonowells@apple.com [Mon, 23 Mar 2015 22:00:19 +0000 (22:00 +0000)]
Web Inspector: Debugger sidebar should have a filter button for breakpoints
https://bugs.webkit.org/show_bug.cgi?id=142779

Reviewed by Timothy Hatcher.

Add the infrastructure for activation filter buttons that can appear next to the text filters at the bottom
of any navigation sidebar panel. These filter bar buttons have defined within them a function that returns
a boolean value that indicates whether the input, typically a tree element, should be filtered or not.

This infrastructure is then used to create a filter for the debugger sidebar that, when applied, only shows
scripts that have breakpoints set on them.

* Localizations/en.lproj/localizedStrings.js: Updated.
* UserInterface/Main.html: Files added.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.showResourcesWithChildrenOnlyFilterFunction):
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint): Drive-by fix.
Add filter button to filter bar.

* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item):
Style filter button.

* UserInterface/Views/FilterBar.js:
(WebInspector.FilterBar):
(WebInspector.FilterBar.prototype.get filters):
(WebInspector.FilterBar.prototype.set filters):
(WebInspector.FilterBar.prototype.hasActiveFilters):
(WebInspector.FilterBar.prototype._handleFilterChanged):
(WebInspector.FilterBar.prototype._inputFieldChanged): Deleted.
Create space for filter bar buttons and set up event handlers to deal with them.

* UserInterface/Views/FilterBarButton.js: Copied from Source/WebInspectorUI/UserInterface/Views/FilterBar.css.
(WebInspector.FilterBarButton):
(WebInspector.FilterBarButton.prototype.get filterFunction):
(WebInspector.FilterBarButton.prototype.toggle):
Create class for a filter bar button that stores a filter function.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype.matchTreeElementAgainstFilterFunctions):
(WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
(WebInspector.NavigationSidebarPanel.prototype._filterDidChange):
(WebInspector.NavigationSidebarPanel.prototype._updateFilter):
(WebInspector.NavigationSidebarPanel.prototype._textFilterDidChange): Deleted.
Add functionality to support button filters and process their corresponding functions correctly when filtering.

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

5 years agoES7: Implement Array.prototype.includes
dino@apple.com [Mon, 23 Mar 2015 21:37:53 +0000 (21:37 +0000)]
ES7: Implement Array.prototype.includes
https://bugs.webkit.org/show_bug.cgi?id=142707

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Add support for the ES7 includes method on Arrays.
https://github.com/tc39/Array.prototype.includes

* builtins/Array.prototype.js:
(includes): Implementation in JS.
* runtime/ArrayPrototype.cpp: Add 'includes' to the lookup table.

LayoutTests:

* js/array-includes-expected.txt: Added.
* js/array-includes.html: Added.
* js/script-tests/array-includes.js: Added.
* js/script-tests/Object-getOwnPropertyNames.js: Add 'includes'.
* js/Object-getOwnPropertyNames-expected.txt: Add 'includes'.

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

5 years agokCTFontSystemFontType is deprecated in CoreText
dino@apple.com [Mon, 23 Mar 2015 21:32:38 +0000 (21:32 +0000)]
kCTFontSystemFontType is deprecated in CoreText
https://bugs.webkit.org/show_bug.cgi?id=142981
<rdar://problem/20261171>

Reviewed by Beth Dakin.

Update to the non-deprecated version.

* rendering/RenderThemeIOS.mm: kCTFontSystemFontType -> kCTFontUIFontSystem
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):

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

5 years ago[iOS] WebContent crash attempting to select text with a gesture at RenderObject:...
enrica@apple.com [Mon, 23 Mar 2015 20:52:28 +0000 (20:52 +0000)]
[iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
https://bugs.webkit.org/show_bug.cgi?id=142913
rdar://problem/16400033

Reviewed by Sam Weinig.

When looking for the best candidate range at the given position,
we should skip nodes that don't have a renderer.
This is a speculative fix.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rangeForWebSelectionAtPosition):

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

5 years ago__defineGetter__/__defineSetter__ should throw exceptions
joepeck@webkit.org [Mon, 23 Mar 2015 20:48:21 +0000 (20:48 +0000)]
__defineGetter__/__defineSetter__ should throw exceptions
https://bugs.webkit.org/show_bug.cgi?id=142934

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
Throw exceptions when these functions are used directly.

LayoutTests:

* js/property-getters-and-setters-expected.txt:
* js/script-tests/property-getters-and-setters.js:

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

5 years agoFix DO_PROPERTYMAP_CONSTENCY_CHECK enabled build
joepeck@webkit.org [Mon, 23 Mar 2015 20:48:18 +0000 (20:48 +0000)]
Fix DO_PROPERTYMAP_CONSTENCY_CHECK enabled build
https://bugs.webkit.org/show_bug.cgi?id=142952

Reviewed by Geoffrey Garen.

* runtime/Structure.cpp:
(JSC::PropertyTable::checkConsistency):
The check offset method doesn't exist in PropertyTable, it exists in Structure.

(JSC::Structure::checkConsistency):
So move it here, and always put it at the start to match normal behavior.

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

5 years agoREGRESSION (Yosemite): WKView visibility notifications are messed up
ap@apple.com [Mon, 23 Mar 2015 20:42:03 +0000 (20:42 +0000)]
REGRESSION (Yosemite): WKView visibility notifications are messed up
https://bugs.webkit.org/show_bug.cgi?id=142945

Reviewed by Tim Horton.

As these notifications cannot be used by NSView subclasses, create a separate
object for observing them.

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
(-[WebView addWindowObserversForWindow:]):
(-[WebView removeWindowObservers]):
(-[WebView viewWillMoveToWindow:]): Make sure that observers are removed even
if -[WebView close] is called manually.
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebWindowVisibilityObserver initWithView:]):
(-[WebWindowVisibilityObserver startObserving:]):
(-[WebWindowVisibilityObserver stopObserving:]):
(-[WebWindowVisibilityObserver _windowVisibilityChanged:]):

Source/WebKit2:

* UIProcess/API/mac/WKView.mm:
(-[WKWindowVisibilityObserver initWithView:]):
(-[WKWindowVisibilityObserver startObserving:]):
(-[WKWindowVisibilityObserver stopObserving:]):
(-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]):
(-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]):
(-[WKView addWindowObserversForWindow:]):
(-[WKView removeWindowObservers]): Also, don't try to remove NSWindowWillOrderOffScreenNotification,
which we never start to observe.
(-[WKView initWithFrame:processPool:configuration:webView:]):
* UIProcess/API/mac/WKViewInternal.h:

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

5 years ago[Mac] Enable fullscreen for MSE-based videos
eric.carlson@apple.com [Mon, 23 Mar 2015 20:35:17 +0000 (20:35 +0000)]
[Mac] Enable fullscreen for MSE-based videos
https://bugs.webkit.org/show_bug.cgi?id=142971

Reviewed by Jer Noble.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Return true;

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

5 years agoSource/WebKit2:
andersca@apple.com [Mon, 23 Mar 2015 20:34:52 +0000 (20:34 +0000)]
Source/WebKit2:
Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
https://bugs.webkit.org/show_bug.cgi?id=133692
rdar://problem/17255947

Reviewed by Alexey Proskuryakov.

Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript
where we need the plug-in to stay around after the call.

* Shared/Plugins/NPObjectMessageReceiver.cpp:
(WebKit::NPObjectMessageReceiver::invoke):
(WebKit::NPObjectMessageReceiver::invokeDefault):
(WebKit::NPObjectMessageReceiver::getProperty):
(WebKit::NPObjectMessageReceiver::setProperty):
(WebKit::NPObjectMessageReceiver::construct):

LayoutTests:
Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again
https://bugs.webkit.org/show_bug.cgi?id=133692
rdar://problem/17255947

Reviewed by Alexey Proskuryakov.

* platform/mac-wk2/TestExpectations:
Unskip test.

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

5 years ago[MediaFoundation] Implement seek.
achristensen@apple.com [Mon, 23 Mar 2015 20:31:56 +0000 (20:31 +0000)]
[MediaFoundation] Implement seek.
https://bugs.webkit.org/show_bug.cgi?id=142594

Reviewed by Darin Adler.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::seeking):
(WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
(WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

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

5 years agoFixed the build.
mitz@apple.com [Mon, 23 Mar 2015 20:17:32 +0000 (20:17 +0000)]
Fixed the build.

* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformBoundsForGlyph): Switched to non-deprecated CTFontOrientation values.
(WebCore::Font::platformWidthForGlyph): Ditto.

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

5 years agoaccessibility/textarea-selected-text-range.html is flaky
ap@apple.com [Mon, 23 Mar 2015 20:06:02 +0000 (20:06 +0000)]
accessibility/textarea-selected-text-range.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=142976

* platform/mac/TestExpectations: Marking as such.

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

5 years ago[iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
jer.noble@apple.com [Mon, 23 Mar 2015 19:20:24 +0000 (19:20 +0000)]
[iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
https://bugs.webkit.org/show_bug.cgi?id=142970

Reviewed by Eric Carlson.

Return early after synchronously calling to the main thread to allocate the volume
view, to avoid re-allocating the volume view again on the web thread.

* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper allocateVolumeView]):

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

5 years agoPut the WK_NULLABLE_SPECIFIER in the right place for block parameters
andersca@apple.com [Mon, 23 Mar 2015 19:13:29 +0000 (19:13 +0000)]
Put the WK_NULLABLE_SPECIFIER in the right place for block parameters
https://bugs.webkit.org/show_bug.cgi?id=142975
rdar://problem/19863930

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKWebView.h:

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

5 years agoAdd a share item to the link action menu
timothy_horton@apple.com [Mon, 23 Mar 2015 18:39:13 +0000 (18:39 +0000)]
Add a share item to the link action menu
https://bugs.webkit.org/show_bug.cgi?id=142961
<rdar://problem/19198374>

Reviewed by Beth Dakin.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _hitLinkURL]):
Factor out _hitLinkURL from various places.

(-[WKActionMenuController _openURLFromActionMenu:]):
(-[WKActionMenuController _addToReadingListFromActionMenu:]):
(-[WKActionMenuController _defaultMenuItemsForVideo]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _createActionMenuItemForTag:]):
(-[WKActionMenuController _createShareActionMenuItemForTag:withItems:]):
Adopt -[NSMenuItem standardShareMenuItemWithItems].
All of the null-checking is unnecessary as it's impossible to enter
these functions with a null image/etc.

(-[WKActionMenuController _defaultMenuItemsForLink]):
* Shared/API/c/WKActionMenuItemTypes.h:
Add a 'Share' item to the link menu.

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItemsForImage]):
(-[WebActionMenuController _defaultMenuItemsForVideo]):
(-[WebActionMenuController _createActionMenuItemForTag:]):
(-[WebActionMenuController _createShareActionMenuItemForTag:withItems:]):
Adopt -[NSMenuItem standardShareMenuItemWithItems].
All of the null-checking is unnecessary as it's impossible to enter
these functions with a null image/etc.
Also, remove a duplicate isDownloadableMedia check for the 'save to downloads' item.

(-[WebActionMenuController _defaultMenuItemsForLink]):
* WebView/WebUIDelegatePrivate.h:
Add a 'Share' item to the link menu.

* English.lproj/Localizable.strings:
Remove some now-unused strings.

* platform/spi/mac/NSMenuSPI.h:
Add some SPI.

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

5 years ago[iOS] Build fix: CoreText deprecated kCTFontSystemFontType
ddkilzer@apple.com [Mon, 23 Mar 2015 18:18:49 +0000 (18:18 +0000)]
[iOS] Build fix: CoreText deprecated kCTFontSystemFontType

Fix tracked by:  <rdar://problem/20261171>

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
Add clang pragmas.

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

5 years agoUnreviewed test fix.
bfulgham@apple.com [Mon, 23 Mar 2015 18:07:01 +0000 (18:07 +0000)]
Unreviewed test fix.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseScrollSnapDestination): Remove new assertion.

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

5 years agoscroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
bfulgham@apple.com [Mon, 23 Mar 2015 16:57:06 +0000 (16:57 +0000)]
scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
https://bugs.webkit.org/show_bug.cgi?id=142552
<rdar://problem/20114743>

Reviewed by Dean Jackson.

Revise the snap point logic as follows:
(1) Put the snap point destination handling in a helper function to make the rest of the code
    easier to read.
(2) Make sure we always have a left-hand snap point (i.e., position 0), but don't add multiple
    left-hand snap points.
(3) Create a helper function to determine if we should be working with the scroll snap 'elements'
    behavior. We want to use this for scroll-snap-destination/scroll-snap-coordinate markup.
(4) Create per-element snap point offsets when using scroll-snap-destination/scroll-snap-coordinate.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseScrollSnapDestination): Add assertion to try to catch bad parser state.
* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::destinationOffsetForViewSize): Added helper function to consolidate logic for handling
destination coordinates.
(WebCore::updateFromStyle): Make sure a left-hand snap point is always provided.
(WebCore::styleUsesElements): Added helper function.
(WebCore::updateSnapOffsetsForScrollableArea): Revise logic to generate 'per-element' snap point
offsets.

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

5 years ago[CMake][EFL] Put failure API test excutables into failure directory
gyuyoung.kim@samsung.com [Mon, 23 Mar 2015 11:17:40 +0000 (11:17 +0000)]
[CMake][EFL] Put failure API test excutables into failure directory
https://bugs.webkit.org/show_bug.cgi?id=142965

Reviewed by Csaba Osztrogonác.

Move failing WK2 API test executables to *bin/TestWebKitAPI/WebKit2/failure* directory.

* TestWebKitAPI/CMakeLists.txt: Fix a typo. Change *testBaseName* with *testName*.
* TestWebKitAPI/PlatformEfl.cmake: Additionally remove unnecessary SHARED_CORE and comment for SeccompFilters test.

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

5 years ago[GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent()
zandobersek@gmail.com [Mon, 23 Mar 2015 10:05:12 +0000 (10:05 +0000)]
[GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent()
https://bugs.webkit.org/show_bug.cgi?id=142964

Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(ClickCounter::currentClickCountForGdkButtonEvent): Use the STL's std::abs()
instead of C's abs(). The templated nature of std::abs() ensures the proper
computation that matches the types of the passed-in values, and shuts down
a warning when compiling with Clang.

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

5 years ago[GTK][WK2] webkitBackForwardListChanged() should operate on a Vector reference
zandobersek@gmail.com [Mon, 23 Mar 2015 10:02:08 +0000 (10:02 +0000)]
[GTK][WK2] webkitBackForwardListChanged() should operate on a Vector reference
https://bugs.webkit.org/show_bug.cgi?id=142963

Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitBackForwardList.cpp:
(webkitBackForwardListChanged): This function only reads from the passed-in
Vector of removed items, so only a const lvalue reference to the Vector
is needed.
* UIProcess/API/gtk/WebKitBackForwardListPrivate.h:

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

5 years agoRefactor ImageLoader's setting of CachedImage
yoav@yoav.ws [Mon, 23 Mar 2015 09:14:19 +0000 (09:14 +0000)]
Refactor ImageLoader's setting of CachedImage
https://bugs.webkit.org/show_bug.cgi?id=142825

Reviewed by Chris Dumez.

No new tests, since there's no functional change.

setImage and setImageWithoutConsideringPendingLoadEvent were not called with new
CachedImages and were not used as originally intended. That resulted in some dead code,
and confusion when going over the code.
This patch renames these methods into equivalent clearImage* methods, and deletes resulting dead code.

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::renderFallbackContent): Changed setImage call to clearImage.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::clearImage):
(WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::elementDidMoveToNewDocument):
(WebCore::ImageLoader::setImage): Deleted.
(WebCore::ImageLoader::setImageWithoutConsideringPendingLoadEvent): Deleted.
* loader/ImageLoader.h:

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

5 years ago[GTK] Add a configure option to build without Redirected XComposite Window
carlosgc@webkit.org [Mon, 23 Mar 2015 08:06:02 +0000 (08:06 +0000)]
[GTK] Add a configure option to build without Redirected XComposite Window
https://bugs.webkit.org/show_bug.cgi?id=142865

Reviewed by Žan Doberšek.

.:

The Redirected XComposite Window was added to support some
features like GtkOverlay, but in cases where we don't need such
features, it's more efficient to use the XID of the WebKitWebView
window as the native surface handle for the accelerated
compositing. This patch adds USE_REDIRECTED_XCOMPOSITE_WINDOW,
that is enabled by default for X11 target when OpenGL is enabled.

* Source/cmake/OptionsGTK.cmake:

Source/WebKit2:

Use USE(REDIRECTED_XCOMPOSITE_WINDOW) instead of
USE(TEXTURE_MAPPER_GL) && PLATFORM(X11).

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize): Use the XID of the WebKitWebView
window as native surface handle when REDIRECTED_XCOMPOSITE_WINDOW
is disabled.
(webkitWebViewRenderAcceleratedCompositingResults):
(resizeWebKitWebViewBaseFromAllocation):
(webkitWebViewBaseEnterAcceleratedCompositingMode):
(webkitWebViewBaseExitAcceleratedCompositingMode):
* UIProcess/gtk/RedirectedXCompositeWindow.cpp:
* UIProcess/gtk/RedirectedXCompositeWindow.h:

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

5 years agoBuild fix.
ap@apple.com [Mon, 23 Mar 2015 06:58:35 +0000 (06:58 +0000)]
Build fix.

* WebView/WebView.mm: (-[WebView _showPlaybackTargetPicker:hasVideo:]):

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

5 years agoCSS Selectors: fix attribute case-insensitive matching of Contain and List
benjamin@webkit.org [Mon, 23 Mar 2015 05:04:46 +0000 (05:04 +0000)]
CSS Selectors: fix attribute case-insensitive matching of Contain and List
https://bugs.webkit.org/show_bug.cgi?id=142932

Reviewed by Darin Adler.

Source/WebCore:

Fix the last two attribute selectors that were using full case-insensitive
match:
    -Contain ([foo*=bar]).
    -List (foo~=bar]).

Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
       fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html

* css/SelectorChecker.cpp:
(WebCore::attributeValueMatches):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::attributeValueContains):
(WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):

Source/WTF:

Add some utility functions to the string classes to find substrings
using ASCII case-insensitive comparisons.

* wtf/text/AtomicString.h:
(WTF::AtomicString::contains):
Add the light version that only lock one register.

(WTF::AtomicString::containsIgnoringASCIICase):
(WTF::AtomicString::findIgnoringASCIICase):

* wtf/text/StringCommon.h:
(WTF::findIgnoringASCIICase):
This is the common implementation used by StringView and StringImpl.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::findIgnoringASCIICase):
* wtf/text/StringImpl.h:
* wtf/text/StringView.cpp:
(WTF::StringView::containsIgnoringASCIICase):
(WTF::StringView::findIgnoringASCIICase):
* wtf/text/StringView.h:
* wtf/text/WTFString.h:
(WTF::String::findIgnoringASCIICase):
(WTF::String::contains):
(WTF::String::containsIgnoringASCIICase):

Tools:

Add tests for the new features and fix some existing tests using the
stringFromUTF8() utility recently added by Dhi.

* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::stringFromUTF8):
* TestWebKitAPI/Tests/WTF/StringView.cpp:

LayoutTests:

* fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive-expected.txt: Added.
* fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html: Added.
* fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive-expected.txt: Added.
* fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html: Added.

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

5 years agoWeb Inspector: Adopt ES6 Class Syntax for all Controller Objects
commit-queue@webkit.org [Mon, 23 Mar 2015 05:02:29 +0000 (05:02 +0000)]
Web Inspector: Adopt ES6 Class Syntax for all Controller Objects
https://bugs.webkit.org/show_bug.cgi?id=142890

Patch by Matt Baker <mattbaker@apple.com> on 2015-03-22
Reviewed by Joseph Pecoraro.

- Convert all UserInterface/Controllers objects to classes
- Convert constructor functions to constructor methods
- Convert "constructor.method" to class static methods where possible
- Convert all methods to method syntax, eliminate commas between methods
- Convert all superclass calls in classes to use "super"
- Removed FIXME from WebInspector.Object subclasses, added calls to super.
- Fixed strict mode issues now that classes enforce strict mode (see below).

* Tools/PrettyPrinting/Formatter.js:
* Tools/PrettyPrinting/FormatterContentBuilder.js:
Updated to match corresponding files in UserInterface/Controllers.

* UserInterface/Controllers/*.js:
Many files modified mostly mechanically (regex find-replace).

* UserInterface/Controllers/CodeMirrorCompletionController.js:
* UserInterface/Controllers/FormatterContentBuilder.js:
Replaced const usage with var. Use of const is prohibited in strict mode, which is implicit within a class.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
* UserInterface/Controllers/DOMTreeManager.js:
Moved function declarations out of if statements. Strict mode does not allow function declarations in a lexically nested statement.

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

5 years ago[GTK] install-dependencies should install orc
commit-queue@webkit.org [Mon, 23 Mar 2015 03:41:21 +0000 (03:41 +0000)]
[GTK] install-dependencies should install orc
https://bugs.webkit.org/show_bug.cgi?id=142955

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-03-22
Reviewed by Martin Robinson.

Install orc, needed by openwebrtc

* gtk/install-dependencies:

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

5 years ago[EFL] Update new flaky tests and remove duplicated failure test.
gyuyoung.kim@samsung.com [Mon, 23 Mar 2015 02:47:14 +0000 (02:47 +0000)]
[EFL] Update new flaky tests and remove duplicated failure test.

Unreviewed EFL gardening.

* platform/efl/TestExpectations:
Remove duplicted attachment tests, and add new flaky tests regarding svg clip-path, pattern scale.

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

5 years agoRemove DFG::ValueRecoveryOverride; it's been dead since we removed forward speculations
fpizlo@apple.com [Mon, 23 Mar 2015 02:18:36 +0000 (02:18 +0000)]
Remove DFG::ValueRecoveryOverride; it's been dead since we removed forward speculations
https://bugs.webkit.org/show_bug.cgi?id=142956

Rubber stamped by Gyuyoung Kim.

Just removing dead code.

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGOSRExit.h:
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGValueRecoveryOverride.h: Removed.

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

5 years agoDetect when url filter pattern with groups match the empty string
benjamin@webkit.org [Mon, 23 Mar 2015 02:04:11 +0000 (02:04 +0000)]
Detect when url filter pattern with groups match the empty string
https://bugs.webkit.org/show_bug.cgi?id=142930

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-03-22
Reviewed by Sam Weinig.

Source/WebCore:

The previous test was only accounting for simple atoms. This patch extends
it to groups.

* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::Term::quantify):
(WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
(WebCore::ContentExtensions::GraphBuilder::finalize):
(WebCore::ContentExtensions::Term::quantifier): Deleted.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:

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

5 years ago[EFL] Unreviewed EFL gradening on 23th Mar.
gyuyoung.kim@samsung.com [Mon, 23 Mar 2015 01:28:33 +0000 (01:28 +0000)]
[EFL] Unreviewed EFL gradening on 23th Mar.

Skip attachment tests, unskip passing tests related with writing, webaudio.
Add new flaky tests.

* platform/efl/TestExpectations:

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

5 years ago[Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
eric.carlson@apple.com [Mon, 23 Mar 2015 01:08:42 +0000 (01:08 +0000)]
[Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
https://bugs.webkit.org/show_bug.cgi?id=142940

Reviewed by Sam Weinig.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
* dom/Document.h:

* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
* html/HTMLMediaSession.h:

* page/Page.cpp:
(WebCore::Page::didChoosePlaybackTarget):  Ditto.
* page/Page.h:

* platform/audio/MediaSession.h:
* platform/graphics/MediaPlaybackTargetPickerClient.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::showPlaybackTargetPicker): New.
(WebChromeClient::startingMonitoringPlaybackTargets): New.
(WebChromeClient::stopMonitoringPlaybackTargets): New.

* WebView/WebView.mm:
(-[WebView _close]): Invalidate and free the target picker.
(-[WebView _devicePicker]): New.
(-[WebView _showPlaybackTargetPicker:hasVideo:]): New.
(-[WebView _startingMonitoringPlaybackTargets]): New.
(-[WebView _stopMonitoringPlaybackTargets]): New.

* WebView/WebMediaPlaybackTargetPicker.h:
* WebView/WebMediaPlaybackTargetPicker.mm:
(WebMediaPlaybackTargetPicker::create): New.
(WebMediaPlaybackTargetPicker::WebMediaPlaybackTargetPicker): New.
(WebMediaPlaybackTargetPicker::showPlaybackTargetPicker): New.
(WebMediaPlaybackTargetPicker::startingMonitoringPlaybackTargets): New.
(WebMediaPlaybackTargetPicker::stopMonitoringPlaybackTargets): New.
(WebMediaPlaybackTargetPicker::didChoosePlaybackTarget): New.
(WebMediaPlaybackTargetPicker::externalOutputDeviceAvailableDidChange): New.
(WebMediaPlaybackTargetPicker::invalidate): New.
(WebMediaPlaybackTargetPicker::targetPicker): New.

* WebView/WebViewData.h:
(WebMediaPlaybackTargetPicker::~WebMediaPlaybackTargetPicker):
* WebView/WebViewData.mm:
* WebView/WebViewInternal.h:

Source/WebKit2:

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::playbackTargetSelected): Argument to didChoosePlaybackTarget is now const.

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

5 years ago_WKWebsiteDataStore should clear WebSQL databases
andersca@apple.com [Sun, 22 Mar 2015 22:50:23 +0000 (22:50 +0000)]
_WKWebsiteDataStore should clear WebSQL databases
https://bugs.webkit.org/show_bug.cgi?id=142947
Source/WebCore:

Reviewed by Sam Weinig.

* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::trackerWithDatabasePath):
Add a hack so we can get at a tracker from the UI process.

(WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
New function that deletes all databases modified after a given time.

* Modules/webdatabase/DatabaseTracker.h:
Add new members and export the ones we want to call from WebKit2.

* Modules/webdatabase/OriginLock.h:
Export the destructor.

Source/WebKit2:

rdar://problem/20242174

Reviewed by Sam Weinig.

* Shared/WebsiteData/WebsiteDataTypes.h:
Add WebsiteDataTypeWebSQLDatabases.

* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultDataStoreConfiguration):
Initialize configuration.webSQLDatabaseDirectory.

* UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
Add WKWebsiteDataTypeWebSQLDatabases.

* UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
(dataTypesToString):
Handle WKWebsiteDataTypeWebSQLDatabases.

* UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataTypes):
(WebKit::toWKWebsiteDataTypes):
Handle WKWebsiteDataTypeWebSQLDatabases and WebsiteDataTypes::WebsiteDataTypeWebSQLDatabases.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
Initialize m_webSQLDatabaseDirectory and add a queue member variable.

(WebKit::WebsiteDataStore::fetchData):
Fetch database origins.

(WebKit::WebsiteDataStore::removeData):
Remove databases.

* UIProcess/WebsiteData/WebsiteDataStore.h:
Add new members.

Tools:

Reviewed by Sam Weinig.

Add a variable that keeps track of the types of data we want to operate on, for easier debugging.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController fetchWebsiteData:]):
(-[WK2BrowserWindowController fetchAndClearWebsiteData:]):
(-[WK2BrowserWindowController clearWebsiteData:]):

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

5 years ago[iOS] Expose WebPageProxy::setInitialFocus as SPI
mitz@apple.com [Sun, 22 Mar 2015 21:44:50 +0000 (21:44 +0000)]
[iOS] Expose WebPageProxy::setInitialFocus as SPI
https://bugs.webkit.org/show_bug.cgi?id=142951

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): New SPI.
Just calls through to WKWebContentView, but allows a nil completion handler.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/API/mac/WKView.mm:
(-[WKView becomeFirstResponder]): Pass an empty lambda for the new callback parameter to
WebPageProxy::setInitialFocus.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setInitialFocus): Added a void callback parameter and made sure to
call it.
* UIProcess/WebPageProxy.h:

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
Added. Calls WebPageProxy::setInitialFocus, and once that completes, checks if anything was
focused and if so, becomes first responder, then calls the completion handler.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setInitialFocus): Added a callbackID parameter, and made sure to send the
callback message. Added a temporary change of m_userIsInteracting to true, so that the UI
process won’t ignore any StartAssistingNode message resulting from the focus change.
* WebProcess/WebPage/WebPage.h:

* WebProcess/WebPage/WebPage.messages.in: Added a callbackID parameter to SetInitialFocus.

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

5 years agoDFG OSR exit shouldn't assume that the frame count for exit is greater than the frame...
fpizlo@apple.com [Sun, 22 Mar 2015 19:35:26 +0000 (19:35 +0000)]
DFG OSR exit shouldn't assume that the frame count for exit is greater than the frame count in DFG
https://bugs.webkit.org/show_bug.cgi?id=142948

Reviewed by Sam Weinig.

It's necessary to ensure that the stack pointer accounts for the extent of our stack usage
since a signal may clobber the area below the stack pointer. When the DFG is executing,
the stack pointer accounts for the DFG's worst-case stack usage. When we OSR exit back to
baseline, we will use a different amount of stack. This is because baseline is a different
compiler. It will make different decisions. So it will use a different amount of stack.

This gets tricky when we are in the process of doing an OSR exit, because we are sort of
incrementally transforming the stack from how it looked in the DFG to how it will look in
baseline. The most conservative approach would be to set the stack pointer to the max of
DFG and baseline.

When this code was written, a reckless assumption was made: that the stack usage in
baseline is always at least as large as the stack usage in DFG. Based on this incorrect
assumption, the code first adjusts the stack pointer to account for the baseline stack
usage. This sort of usually works, because usually baseline does happen to use more stack.
But that's not an invariant. Nobody guarantees this. We will never make any changes that
would make this be guaranteed, because that would be antithetical to how optimizing
compilers work. The DFG should be allowed to use however much stack it decides that it
should use in order to get good performance, and it shouldn't try to guarantee that it
always uses less stack than baseline.

As such, we must always assume that the frame size for DFG execution (i.e.
frameRegisterCount) and the frame size in baseline once we exit (i.e.
requiredRegisterCountForExit) are two independent quantities and they have no
relationship.

Fortunately, though, this code can be made correct by just moving the stack adjustment to
just before we do conversions. This is because we have since changed the OSR exit
algorithm to first lift up all state from the DFG state into a scratch buffer, and then to
drop it out of the scratch buffer and into the stack according to the baseline layout. The
point just before conversions is the point where we have finished reading the DFG frame
and will not read it anymore, and we haven't started writing the baseline frame. So, at
this point it is safe to set the stack pointer to account for the frame size at exit.

This is benign because baseline happens to create larger frames than DFG.

* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::adjustAndJumpToTarget):

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

5 years agoShorten the number of iterations to 10,000 since that's enough to test all tiers.
fpizlo@apple.com [Sun, 22 Mar 2015 19:09:34 +0000 (19:09 +0000)]
Shorten the number of iterations to 10,000 since that's enough to test all tiers.

Rubber stamped by Sam Weinig.

* tests/stress/equals-masquerader.js:

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

5 years agotests/stress/*tdz* tests do 10x more iterations than necessary
fpizlo@apple.com [Sun, 22 Mar 2015 18:25:16 +0000 (18:25 +0000)]
tests/stress/*tdz* tests do 10x more iterations than necessary
https://bugs.webkit.org/show_bug.cgi?id=142946

Reviewed by Ryosuke Niwa.

The stress test harness runs all of these tests in various configurations. This includes
no-cjit, which has tier-up heuristics locked in such a way that 10,000 iterations is
enough to get to the highest tier. The only exceptions are very large functions or
functions that have some reoptimizations. That happens rarely, and when it does happen,
usually 20,000 iterations is enough.

Therefore, these tests use 10x too many iterations. This is bad, since these tests
allocate on each iteration, and so they run very slowly in debug mode.

* tests/stress/class-syntax-no-loop-tdz.js:
* tests/stress/class-syntax-no-tdz-in-catch.js:
* tests/stress/class-syntax-no-tdz-in-conditional.js:
* tests/stress/class-syntax-no-tdz-in-loop-no-inline-super.js:
* tests/stress/class-syntax-no-tdz-in-loop.js:
* tests/stress/class-syntax-no-tdz.js:
* tests/stress/class-syntax-tdz-in-catch.js:
* tests/stress/class-syntax-tdz-in-conditional.js:
* tests/stress/class-syntax-tdz-in-loop.js:
* tests/stress/class-syntax-tdz.js:

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

5 years agoRemove the prefix for CSS Transforms
dino@apple.com [Sun, 22 Mar 2015 04:55:33 +0000 (04:55 +0000)]
Remove the prefix for CSS Transforms
https://bugs.webkit.org/show_bug.cgi?id=142927
<rdar://problem/11568151>

Reviewed by Simon Fraser.

Source/WebCore:

Support the bare form of:
- transform
- transform-style
- transform-origin
- perspective
- perspective-origin

For transform-style, we also still differentiate the prefixed property
because we may want to use that as an indicator of legacy content.

This is mostly a find and replace, but with some related naming
changes. The DOM interface for WebKitCSSTransformValue remains
unchanged.

Tests: transforms/2d/transform-2d-prefixed.html
       transforms/3d/general/prefixed-3dtransform-values.html

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::propertyChangeMayRepaintNonDescendants):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isLayoutDependent):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::parseTranslateTransformValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseTransformOrigin):
(WebCore::CSSParser::parsePerspectiveOrigin):
* css/CSSPropertyNames.in:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::asText):
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
(WebCore::KeyframeAnimation::validateTransformFunctionList):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::validateTransformOperations):
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::propertyIdToString):
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::isRunningTransformAnimation):
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::addAnimation):
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::applyInternal):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
(WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
(WebCore::CoordinatedGraphicsLayer::addAnimation):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::startTransition):
(WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
(WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
(WebCore::RenderLayerCompositor::isRunningTransformAnimation):
* svg/SVGElement.cpp:
(WebCore::populateAttributeNameToCSSPropertyIDMap):

Source/WebKit2:

Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<TextureMapperAnimation>::encode):

LayoutTests:

Convert the helper functions for transforms to use the unprefixed
form, and copy some tests to make sure the prefixed form still works.

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/getComputedStyle/resources/property-names.js:
* svg/css/getComputedStyle-basic-expected.txt:
* transforms/2d/computed-style-origin-expected.txt:
* transforms/2d/computed-style-origin.html:
* transforms/2d/resources/prefixed-transform-test-utils.js: Copied from LayoutTests/transforms/2d/resources/transform-test-utils.js.
(floatingPointEqual):
(compareMatrices):
(testTransforms):
* transforms/2d/resources/transform-test-utils.js:
(testTransforms):
* transforms/2d/transform-2d-prefixed-expected.txt: Added.
* transforms/2d/transform-2d-prefixed.html: Added.
* transforms/3d/general/prefixed-3dtransform-values-expected.txt: Added.
* transforms/3d/general/prefixed-3dtransform-values.html: Added.
* transitions/transition-end-event-multiple-04-expected.txt:
* transitions/transition-end-event-multiple-04.html:
* transitions/transition-end-event-transform-expected.txt:
* transitions/transition-end-event-transform.html:

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

5 years agoFix a typo in Parser error message
commit-queue@webkit.org [Sun, 22 Mar 2015 04:08:23 +0000 (04:08 +0000)]
Fix a typo in Parser error message
https://bugs.webkit.org/show_bug.cgi?id=142942

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-21
Reviewed by Alexey Proskuryakov.

Source/JavaScriptCore:

* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitSlow_op_resolve_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitSlow_op_resolve_scope):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseClass):
Fix a common identifier typo.

LayoutTests:

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

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

5 years ago[Win] Try to get debug bots green.
bfulgham@apple.com [Sun, 22 Mar 2015 03:47:04 +0000 (03:47 +0000)]
[Win] Try to get debug bots green.

* platform/win/TestExpectations:

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

5 years agoComputed Property names should allow only AssignmentExpressions not any Expression
joepeck@webkit.org [Sun, 22 Mar 2015 03:14:47 +0000 (03:14 +0000)]
Computed Property names should allow only AssignmentExpressions not any Expression
https://bugs.webkit.org/show_bug.cgi?id=142902

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseProperty):
Limit computed expressions to just assignment expressions instead of
any expression (which allowed comma expressions).

LayoutTests:

* js/basic-computed-property-name-expected.txt:
* js/object-literal-computed-methods-expected.txt:
* js/script-tests/basic-computed-property-name.js:
(runTest.runTest.runTest.runTest.runTest.runTest.runTest.runTestThrow):
* js/script-tests/object-literal-computed-methods.js:
Test that comma expressions are not allowed in computed property/method names.

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

5 years agoMake UnlinkedFunctionExecutable fit in a 128-byte cell.
akling@apple.com [Sun, 22 Mar 2015 00:07:46 +0000 (00:07 +0000)]
Make UnlinkedFunctionExecutable fit in a 128-byte cell.
<https://webkit.org/b/142939>

Reviewed by Mark Hahnenberg.

Re-arrange the members of UnlinkedFunctionExecutable so it can fit inside
a 128-byte heap cell instead of requiring a 256-byte one.

Threw in a static_assert to catch anyone pushing it over the limit again.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedFunctionExecutable::functionMode):

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

5 years agoImport the blink test fast/css/currentcolor-strict-mode.html
benjamin@webkit.org [Sat, 21 Mar 2015 19:34:31 +0000 (19:34 +0000)]
Import the blink test fast/css/currentcolor-strict-mode.html
https://bugs.webkit.org/show_bug.cgi?id=142838

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-03-21
Reviewed by Darin Adler.

* fast/css/currentcolor-strict-mode-expected.html: Added.
* fast/css/currentcolor-strict-mode.html: Added.

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

5 years ago[EFL][GTK] Make WebKit2's generate-forwarding-headers.pl less verbose
ossy@webkit.org [Sat, 21 Mar 2015 15:48:24 +0000 (15:48 +0000)]
[EFL][GTK] Make WebKit2's generate-forwarding-headers.pl less verbose
https://bugs.webkit.org/show_bug.cgi?id=142908

Reviewed by Žan Doberšek.

* Scripts/generate-forwarding-headers.pl:
(createForwardingHeadersForFramework):

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

5 years agoUnreviewed, rolling out r181824.
commit-queue@webkit.org [Sat, 21 Mar 2015 07:37:07 +0000 (07:37 +0000)]
Unreviewed, rolling out r181824.
https://bugs.webkit.org/show_bug.cgi?id=142935

Broke Windows build (Requested by ap on #webkit).

Reverted changeset:

"Remove the prefix for CSS Transforms"
https://bugs.webkit.org/show_bug.cgi?id=142927
http://trac.webkit.org/changeset/181824

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

5 years agoRemove the prefix for CSS Transforms
dino@apple.com [Sat, 21 Mar 2015 06:54:14 +0000 (06:54 +0000)]
Remove the prefix for CSS Transforms
https://bugs.webkit.org/show_bug.cgi?id=142927
<rdar://problem/11568151>

Reviewed by Simon Fraser.

Source/WebCore:

Support the bare form of:
- transform
- transform-style
- transform-origin
- perspective
- perspective-origin

For transform-style, we also still differentiate the prefixed property
because we may want to use that as an indicator of legacy content.

This is mostly a find and replace, but with some related naming
changes. The DOM interface for WebKitCSSTransformValue remains
unchanged.

Tests: transforms/2d/transform-2d-prefixed.html
       transforms/3d/general/prefixed-3dtransform-values.html

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::propertyChangeMayRepaintNonDescendants):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isLayoutDependent):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::parseTranslateTransformValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseTransformOrigin):
(WebCore::CSSParser::parsePerspectiveOrigin):
* css/CSSPropertyNames.in:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::asText):
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
(WebCore::KeyframeAnimation::validateTransformFunctionList):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::validateTransformOperations):
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::propertyIdToString):
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::isRunningTransformAnimation):
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::addAnimation):
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::applyInternal):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
(WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
(WebCore::CoordinatedGraphicsLayer::addAnimation):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::startTransition):
(WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
(WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
(WebCore::RenderLayerCompositor::isRunningTransformAnimation):
* svg/SVGElement.cpp:
(WebCore::populateAttributeNameToCSSPropertyIDMap):

Source/WebKit2:

Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<TextureMapperAnimation>::encode):

LayoutTests:

Convert the helper functions for transforms to use the unprefixed
form, and copy some tests to make sure the prefixed form still works.

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/getComputedStyle/resources/property-names.js:
* svg/css/getComputedStyle-basic-expected.txt:
* transforms/2d/computed-style-origin-expected.txt:
* transforms/2d/computed-style-origin.html:
* transforms/2d/resources/prefixed-transform-test-utils.js: Copied from LayoutTests/transforms/2d/resources/transform-test-utils.js.
(floatingPointEqual):
(compareMatrices):
(testTransforms):
* transforms/2d/resources/transform-test-utils.js:
(testTransforms):
* transforms/2d/transform-2d-prefixed-expected.txt: Added.
* transforms/2d/transform-2d-prefixed.html: Added.
* transforms/3d/general/prefixed-3dtransform-values-expected.txt: Added.
* transforms/3d/general/prefixed-3dtransform-values.html: Added.
* transitions/transition-end-event-multiple-04-expected.txt:
* transitions/transition-end-event-multiple-04.html:
* transitions/transition-end-event-transform-expected.txt:
* transitions/transition-end-event-transform.html:

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

5 years ago[Win] Additional debug assertion documentation.
bfulgham@apple.com [Sat, 21 Mar 2015 04:20:29 +0000 (04:20 +0000)]
[Win] Additional debug assertion documentation.

* platform/win/TestExpectations:

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

5 years agoGCTimer should know keep track of nested GC phases
mhahnenb@gmail.com [Sat, 21 Mar 2015 02:02:44 +0000 (02:02 +0000)]
GCTimer should know keep track of nested GC phases
https://bugs.webkit.org/show_bug.cgi?id=142675

Reviewed by Darin Adler.

Source/JavaScriptCore:

This improves the GC phase timing output in Heap.cpp by linking
phases nested inside other phases together, allowing tools
to compute how much time we're spending in various nested phases.

* heap/Heap.cpp:

Tools:

Adds a tool to aid in parsing the GC phase timing output into a
tree-like structure based on the parent-child relationships
of nested GC phases.

* Scripts/parse-gc-phase-timings: Added.
(Timing):
(Timing.__init__):
(Timing.__unicode__):
(Timing.__str__):
(Timing.__repr__):
(parse_input):
(print_timing_node):
(print_timing_tree):
(link_parents):
(main):

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

5 years ago[Win] More debug assertions. Almost there!
bfulgham@apple.com [Sat, 21 Mar 2015 00:07:17 +0000 (00:07 +0000)]
[Win] More debug assertions. Almost there!

* platform/win/TestExpectations:

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

5 years agoWeb Inspector: Fast typing lags in the Styles sidebar or Console
nvasilyev@apple.com [Fri, 20 Mar 2015 23:38:03 +0000 (23:38 +0000)]
Web Inspector: Fast typing lags in the Styles sidebar or Console
https://bugs.webkit.org/show_bug.cgi?id=142919

Asynchronous autocomplete causes a race condition in CodeMirror,
which results in skipped characters in while typing. Completing immediately
fixes the issues.

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WebInspector.CodeMirrorCompletionController.prototype.hideCompletions):
(WebInspector.CodeMirrorCompletionController.prototype._completeAtCurrentPosition):
(WebInspector.CodeMirrorCompletionController.prototype.):

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

5 years agoFunctionBodyNode should known where its parameters started
ggaren@apple.com [Fri, 20 Mar 2015 23:37:51 +0000 (23:37 +0000)]
FunctionBodyNode should known where its parameters started
https://bugs.webkit.org/show_bug.cgi?id=142926

Reviewed by Ryosuke Niwa.

This will allow us to re-parse parameters instead of keeping the
parameters piece of the AST around forever.

I also took the opportunity to initialize most FunctionBodyNode data
members at construction time, to help clarify that they are set right.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionExpr): No need to pass
functionKeywordStart here; we now provide it at FunctionBodyNode
creation time.

(JSC::ASTBuilder::createFunctionBody): Require everything we need at
construction time, including the start of our parameters.

(JSC::ASTBuilder::createGetterOrSetterProperty):
(JSC::ASTBuilder::createFuncDeclStatement):  No need to pass
functionKeywordStart here; we now provide it at FunctionBodyNode
creation time.

(JSC::ASTBuilder::setFunctionNameStart): Deleted.

* parser/Nodes.cpp:
(JSC::FunctionBodyNode::FunctionBodyNode): Initialize everything at
construction time.

* parser/Nodes.h: Added a field for the location of our parameters.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parseGetterSetter):
(JSC::Parser<LexerType>::parsePrimaryExpression):
* parser/Parser.h: Refactored to match above interface changes.

* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createFunctionExpr):
(JSC::SyntaxChecker::createFunctionBody):
(JSC::SyntaxChecker::createFuncDeclStatement):
(JSC::SyntaxChecker::createGetterOrSetterProperty): Refactored to match
above interface changes.

(JSC::SyntaxChecker::setFunctionNameStart): Deleted.

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

5 years agoObservably effectful nodes in DFG IR should come last in their bytecode instruction...
fpizlo@apple.com [Fri, 20 Mar 2015 23:26:26 +0000 (23:26 +0000)]
Observably effectful nodes in DFG IR should come last in their bytecode instruction (i.e. forExit section), except for Hint nodes
https://bugs.webkit.org/show_bug.cgi?id=142920

Reviewed by Oliver Hunt, Geoffrey Garen, and Mark Lam.

Observably effectful, n.: If we reexecute the bytecode instruction after this node has
executed, then something other than the bytecode instruction's specified outcome will
happen.

We almost never had observably effectful nodes except at the end of the bytecode
instruction.  The exception is a lowered transitioning PutById:

PutStructure(@o, S1 -> S2)
PutByOffset(@o, @o, @v)

The PutStructure is observably effectful: if you try to reexecute the bytecode after
doing the PutStructure, then we'll most likely crash.  The generic PutById handling means
first checking what the old structure of the object is; but if we reexecute, the old
structure will seem to be the new structure.  But the property ensured by the new
structure hasn't been stored yet, so any attempt to load it or scan it will crash.

Intriguingly, however, none of the other operations involved in the PutById are
observably effectful.  Consider this example:

PutByOffset(@o, @o, @v)
PutStructure(@o, S1 -> S2)

Note that the PutStructure node doesn't reallocate property storage; see further below
for an example that does that. Because no property storage is happening, we know that we
already had room for the new property.  This means that the PutByOffset is no observable
until the PutStructure executes and "reveals" the property.  Hence, PutByOffset is not
observably effectful.

Now consider this:

b: AllocatePropertyStorage(@o)
PutByOffset(@b, @o, @v)
PutStructure(@o, S1 -> S2)

Surprisingly, this is also safe, because the AllocatePropertyStorage is not observably
effectful. It *does* reallocate the property storage and the new property storage pointer
is stored into the object. But until the PutStructure occurs, the world will just think
that the reallocation didn't happen, in the sense that we'll think that the property
storage is using less memory than what we just allocated. That's harmless.

The AllocatePropertyStorage is safe in other ways, too. Even if we GC'd after the
AllocatePropertyStorage but before the PutByOffset (or before the PutStructure),
everything could be expected to be fine, so long as all of @o, @v and @b are on the
stack. If they are all on the stack, then the GC will leave the property storage alone
(so the extra memory we just allocated would be safe). The GC will not scan the part of
the property storage that contains @v, but that's fine, so long as @v is on the stack.

The better long-term solution is probably bug 142921.

But for now, this:

- Fixes an object materialization bug, exemplified by the two tests, that previously
  crashed 100% of the time with FTL enabled and concurrent JIT disabled.

- Allows us to remove the workaround introduced in r174856.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handlePutById):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::emitPutByOffset):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::insertCheck):
(JSC::DFG::FixupPhase::indexOfNode): Deleted.
(JSC::DFG::FixupPhase::indexOfFirstNodeOfExitOrigin): Deleted.
* dfg/DFGInsertionSet.h:
(JSC::DFG::InsertionSet::insertOutOfOrder): Deleted.
(JSC::DFG::InsertionSet::insertOutOfOrderNode): Deleted.
* tests/stress/materialize-past-butterfly-allocation.js: Added.
(bar):
(foo0):
(foo1):
(foo2):
(foo3):
(foo4):
* tests/stress/materialize-past-put-structure.js: Added.
(foo):

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

5 years ago[WK2] NetworkCache retrievals sometimes fail on browser startup
cdumez@apple.com [Fri, 20 Mar 2015 23:09:56 +0000 (23:09 +0000)]
[WK2] NetworkCache retrievals sometimes fail on browser startup
https://bugs.webkit.org/show_bug.cgi?id=142925
<rdar://problem/20245368>

Reviewed by Antti Koivisto.

NetworkCache retrievals sometimes fail on browser startup for resources
that are actually cached. The reason is that we are using a bloom filter
for performance reasons to avoid unnecessary disk I/O and this bloom
filter is populated on start up in a background thread by traversing the
cache files on disk. However, when restoring the tabs on start-up we
sometimes query this bloom filter before it is completely populated and
we thus fail to retrieve cached entries because we think they don't
exist and don't check the disk.

This patch adds an "isPopulatingContentsFilter" flag that is turned ON
on start up while we are populating the bloon filter. We then bypass
the bloom filter and send queries directly to disk on start up if this
flag is ON.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::initialize):
(WebKit::NetworkCache::Storage::retrieve):
(WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
(WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::cacheMayContain):

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

5 years ago[WK2] Allow stale content when restoring the browser's session state
cdumez@apple.com [Fri, 20 Mar 2015 22:45:14 +0000 (22:45 +0000)]
[WK2] Allow stale content when restoring the browser's session state
https://bugs.webkit.org/show_bug.cgi?id=142916
<rdar://problem/20243493>

Reviewed by Darin Adler.

Allow stale content when restoring the browser's session state
(restoring all tabs from previous session), e.g.
- Via History > Reopen All windows from previous session on Safari
- Happens on startup for MobileSafari

I have verified that using "Open in tabs" on a bookmarks folder
still does fresh loads (rdar://problem/8131355) as it is not using
the restoreFromSessionState() code path.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::goForward):
(WebKit::WebPageProxy::goBack):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::restoreFromSessionState):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

5 years agoREGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl...
utatane.tea@gmail.com [Fri, 20 Mar 2015 21:35:17 +0000 (21:35 +0000)]
REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83
https://bugs.webkit.org/show_bug.cgi?id=142410

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Before this patch, added function JSValue::toPropertyKey returns PropertyName.
Since PropertyName doesn't have AtomicStringImpl ownership,
if Identifier is implicitly converted to PropertyName and Identifier is destructed,
PropertyName may refer freed AtomicStringImpl*.

This patch changes the result type of JSValue::toPropertyName from PropertyName to Identifier,
to keep AtomicStringImpl* ownership after the toPropertyName call is done.
And receive the result value as Identifier type to keep ownership in the caller side.

To catch the result of toPropertyKey as is, we catch the result of toPropertyName as auto.

However, now we don't need to have both Identifier and PropertyName.
So we'll merge PropertyName to Identifier in the subsequent patch.

* dfg/DFGOperations.cpp:
(JSC::DFG::operationPutByValInternal):
* jit/JITOperations.cpp:
(JSC::getByVal):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::getByVal):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::opIn):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::toPropertyKey):
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncPropertyIsEnumerable):

Source/WebCore:

The same issues are found in the existing code; PropertyName does not have ownership.
This patch rewrite the point that should have ownership to Identifier.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSDOMWindow::putByIndex):
* bindings/js/ReadableStreamJSSource.cpp:
(WebCore::getInternalSlotFromObject):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::putByIndex):

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

5 years agoLog the slow-scrolling reasons (if any) on first commit of a ScrollingTreeFrameScroll...
simon.fraser@apple.com [Fri, 20 Mar 2015 21:32:28 +0000 (21:32 +0000)]
Log the slow-scrolling reasons (if any) on first commit of a ScrollingTreeFrameScrollingNodeMac
https://bugs.webkit.org/show_bug.cgi?id=142917

Reviewed by Beth Dakin.

The scrollperf test would fail to detect transitions between slow and fast scrolling
for new pages, because there was no logging when slow-scrolling scrolling tree was
torn down, and a new fast-scrolling tree constructed.

Fix by always logging the slow-scrolling reasons in the first update of the
ScrollingTreeFrameScrollingNodeMac, even when the slow-scrolling reasons haven't
changed.

* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):

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

5 years ago[Immediate Actions] Should re-enable immediate actions for iBooks
bdakin@apple.com [Fri, 20 Mar 2015 21:23:21 +0000 (21:23 +0000)]
[Immediate Actions] Should re-enable immediate actions for iBooks
https://bugs.webkit.org/show_bug.cgi?id=142915
-and corresponding-
rdar://problem/19585689

Reviewed by Tim Horton.

* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processPool:configuration:webView:]):

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

5 years ago[Win] Attempting to get EWS green.
bfulgham@apple.com [Fri, 20 Mar 2015 21:16:51 +0000 (21:16 +0000)]
[Win] Attempting to get EWS green.

* platform/win/TestExpectations:

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

5 years agoFunction.prototype.toString should not decompile the AST
ggaren@apple.com [Fri, 20 Mar 2015 20:12:10 +0000 (20:12 +0000)]
Function.prototype.toString should not decompile the AST
https://bugs.webkit.org/show_bug.cgi?id=142853

Reviewed by Sam Weinig.

Source/JavaScriptCore:

To recover the function parameter string, Function.prototype.toString
decompiles the function parameters from the AST. This is bad for a few
reasons:

(1) It requires us to keep pieces of the AST live forever. This is an
awkward design and a waste of memory.

(2) It doesn't match Firefox or Chrome (because it changes whitespace
and ES6 destructuring expressions).

(3) It doesn't scale to ES6 default argument parameters, which require
arbitrarily complex decompilation.

(4) It can counterfeit all the line numbers in a function (because
whitespace can include newlines).

(5) It's expensive, and we've seen cases where websites invoke
Function.prototype.toString a lot by accident.

The fix is to do what we do for the rest of the function: Just quote the
original source text.

Since this change inevitably changes some function stringification, I
took the opportunity to make our stringification match Firefox's and
Chrome's.

* API/tests/testapi.c:
(assertEqualsAsUTF8String): Be more informative when this fails.

(main): Updated to match new stringification rules.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::paramString): Deleted. Yay!
* bytecode/UnlinkedCodeBlock.h:

* parser/Nodes.h:
(JSC::StatementNode::isFuncDeclNode): New helper for constructing
anonymous functions.

* parser/SourceCode.h:
(JSC::SourceCode::SourceCode): Allow zero because WebCore wants it.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getFunctionExecutableFromGlobalCode): Updated for use
of function declaration over function expression.

* runtime/Executable.cpp:
(JSC::FunctionExecutable::paramString): Deleted. Yay!
* runtime/Executable.h:
(JSC::FunctionExecutable::parameterCount):

* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck): Added a newline after
the opening brace to match Firefox and Chrome, and a space after the comma
to match Firefox and WebKit coding style. Added the function name to
the text of the function so it would look right when stringify-ing. Switched
from parentheses to braces to produce a function declaration instead of
a function expression because we are required to exclude the function's
name from its scope, and that's what a function declaration does.

* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString): Removed an old workaround because the
library it worked around doesn't really exist anymore, and the behavior
doesn't match Firefox or Chrome. Use type profiling offsets instead of
function body offsets because we want to include the function name and
the parameter string, rather than stitching them in manually by
decompiling the AST.

(JSC::insertSemicolonIfNeeded): Deleted.

* tests/mozilla/js1_2/function/tostring-1.js:
* tests/mozilla/js1_5/Scope/regress-185485.js:
(with.g): Updated these test results for formatting changes.

Source/WebCore:

* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction): Adjust the line
number of attribute event listeners to account for the leading newline
now added by JavaScriptCore.

This solution is not perfect, but there are a lot of pre-existing problems
with line and column reporting for attribute event listeners, and this
preserves existing behavior with reasonable reliability.

LayoutTests:

Updated test results to match new rules for Function.prototype.toString.

* fast/dom/TreeWalker/acceptNode-filter-expected.txt: Removed a space
because it was not in the original source.

* fast/events/window-onerror2-expected.txt: Column number changed because
the event listener body starts on its own line now. This was a bit wrong
before and is still a bit wrong now in a different way.

* fast/profiler/dead-time-expected.txt:
* fast/profiler/inline-event-handler-expected.txt:
* fast/profiler/stop-profiling-after-setTimeout-expected.txt: Line number
changed because WebCore shifts line nubmers on attribute event listeners
by one.

* js/class-syntax-default-constructor-expected.txt: Constructor name
is not present now because it is not present in the source text. This
test failed before and it still fails now in a slightly different way.

* js/destructuring-assignment-expected.txt: Destructuring arguments now
match their source text faithfully.

* js/dfg-redundant-load-of-captured-variable-proven-constant-expected.txt:
Removed a space because it was not present in the original source text.

* js/dfg-resolve-global-specific-dictionary-expected.txt: Ditto.

* js/function-toString-semicolon-insertion-expected.txt: Removed.
* js/script-tests/function-toString-semicolon-insertion.js: Removed.
* js/function-toString-semicolon-insertion.html: Removed. This test checked
for a work-around that I have removed.

* js/object-literal-computed-methods-expected.txt:
* js/object-literal-methods-expected.txt: These tests fail because object
literal methods do not register their function names appropriately. This
was a pre-existing failure that is now more explicit.

* js/dom/JSON-parse-expected.txt:
* js/dom/JSON-stringify-expected.txt: Whitespace removed because it was
not present in the original.

* js/dom/dfg-strcat-over-objects-then-exit-on-it-expected.txt: Ditto.

* js/dom/function-prototype-expected.txt:
* js/dom/function-prototype.html: Ditto.

* js/dom/parse-error-external-script-in-new-Function-expected.txt: Line
changed by one due to new extra newline.

* js/dom/script-start-end-locations-expected.txt: Lines and columns
changed due to new extra newline.

* js/dom/toString-and-valueOf-override-expected.txt: Whitespace removed
because it was not present in the original.

* js/dom/script-tests/dfg-strcat-over-objects-then-exit-on-it.js: Ditto.

* js/kde/lval-exceptions-expected.txt: Ditto.

* js/script-tests/dfg-redundant-load-of-captured-variable-proven-constant.js: Ditto.

* js/script-tests/dfg-resolve-global-specific-dictionary.js: Ditto.

* platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt: Ditto.

* storage/domstorage/localstorage/string-conversion-expected.txt: Ditto.

* storage/domstorage/sessionstorage/string-conversion-expected.txt: Ditto.

* userscripts/window-onerror-for-isolated-world-1-expected.txt:
* userscripts/window-onerror-for-isolated-world-2-expected.txt: Line numbers
changed because of new anonymous function formatting. These line numbers
were wrong before and they are still wrong now.

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

5 years ago[Win] Add some skips to support EWS use.
bfulgham@apple.com [Fri, 20 Mar 2015 19:14:00 +0000 (19:14 +0000)]
[Win] Add some skips to support EWS use.

* platform/win/TestExpectations:

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

5 years agoProgress towards CMake on Mac.
achristensen@apple.com [Fri, 20 Mar 2015 18:18:41 +0000 (18:18 +0000)]
Progress towards CMake on Mac.
https://bugs.webkit.org/show_bug.cgi?id=136003

Reviewed by Chris Dumez.

Source/WebCore:

* PlatformMac.cmake:
Added some directories to create forwarding headers from.
Generate ObjC bindings.

Source/WebKit:

* CMakeLists.txt:
* PlatformMac.cmake: Added.

Source/WebKit2:

* PlatformMac.cmake:
Add include directories and forwarding headers.
* Shared/API/APIObject.h:
(API::ObjectImpl::operator new):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
Fix some unused parameter warnings.

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

5 years agoSyntaxChecker assertion is trapped with computed property name and getter
commit-queue@webkit.org [Fri, 20 Mar 2015 18:10:17 +0000 (18:10 +0000)]
SyntaxChecker assertion is trapped with computed property name and getter
https://bugs.webkit.org/show_bug.cgi?id=142863

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-20
Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::getName):
Remove invalid assert. Computed properties will not have a name
and the calling code is checking for null expecting it. The
AST path (non-CheckingPath) already does this without the assert
so it is well tested.

LayoutTests:

* js/basic-computed-property-name-expected.txt:
* js/script-tests/basic-computed-property-name.js:
(a.string_appeared_here.runTest):
Add tests that wrap the expression in a function, this
will test the syntax checker.

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

5 years agoJSCallbackObject<JSGlobalObject> should not destroy its JSCallbackObjectData before...
mark.lam@apple.com [Fri, 20 Mar 2015 18:08:29 +0000 (18:08 +0000)]
JSCallbackObject<JSGlobalObject> should not destroy its JSCallbackObjectData before all its finalizers have been called.
<https://webkit.org/b/142846>

Reviewed by Geoffrey Garen.

Currently, JSCallbackObject<JSGlobalObject> registers weak finalizers via 2 mechanisms:
1. JSCallbackObject<Parent>::init() registers a weak finalizer for all JSClassRef
   that a JSCallbackObject references.
2. JSCallbackObject<JSGlobalObject>::create() registers a finalizer via
   vm.heap.addFinalizer() which destroys the JSCallbackObject.

The first finalizer is implemented as a virtual function of a JSCallbackObjectData
instance that will be destructed if the 2nd finalizer is called.  Hence, if the
2nd finalizer if called first, the later invocation of the 1st finalizer will
result in a crash.

This patch fixes the issue by eliminating the finalizer registration in init().
Instead, we'll have the JSCallbackObject destructor call all the JSClassRef finalizers
if needed.  This ensures that these finalizers are called before the JSCallbackObject
is destructor.

Also added assertions to a few Heap functions because JSCell::classInfo() expects
all objects that are allocated from MarkedBlock::Normal blocks to be derived from
JSDestructibleObject.  These assertions will help us catch violations of this
expectation earlier.

* API/JSCallbackObject.cpp:
(JSC::JSCallbackObjectData::finalize): Deleted.
* API/JSCallbackObject.h:
(JSC::JSCallbackObjectData::~JSCallbackObjectData):
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::~JSCallbackObject):
(JSC::JSCallbackObject<Parent>::init):
* API/tests/GlobalContextWithFinalizerTest.cpp: Added.
(finalize):
(testGlobalContextWithFinalizer):
* API/tests/GlobalContextWithFinalizerTest.h: Added.
* API/tests/testapi.c:
(main):
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj:
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/HeapInlines.h:
(JSC::Heap::allocateObjectOfType):
(JSC::Heap::subspaceForObjectOfType):
(JSC::Heap::allocatorForObjectOfType):

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

5 years ago[WinCairo] Crash when leaving page while video is playing.
peavo@outlook.com [Fri, 20 Mar 2015 17:53:31 +0000 (17:53 +0000)]
[WinCairo] Crash when leaving page while video is playing.
https://bugs.webkit.org/show_bug.cgi?id=142578

Reviewed by Alex Christensen.

This can happen when there is an asynchronous event invoked from a video worker
thread, accessing the media player object after it has been deleted.
This is solved by resetting the media player pointer in the event object,
when the media player is deleted.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
(WebCore::MediaPlayerPrivateMediaFoundation::addListener):
(WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
(WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AsyncCallback):
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback):
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::MediaPlayerListener):
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::~MediaPlayerListener):
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::onMediaPlayerDeleted):

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

5 years agoRegression(r181782): Caused WebKit2.RestoreSessionStateContainingFormData API test...
cdumez@apple.com [Fri, 20 Mar 2015 17:18:52 +0000 (17:18 +0000)]
Regression(r181782): Caused WebKit2.RestoreSessionStateContainingFormData API test to crash
https://bugs.webkit.org/show_bug.cgi?id=142911

Reviewed by Antti Koivisto.

Drop the isBackForwardLoadType(m_loadType) assertion in
FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad(). This assertion
used to hold true when goToBackForwardItem() was only called with
history navigation load types. However, after r181782, we use a Standard
load in the cases where we do not wish to display stale content (e.g.
restoring session state).

The assertion comment says "We only use cache-only loads to avoid
resubmitting forms". However, we then call loadDifferentDocumentItem()
which already takes care of using the ReturnCacheDataElseLoad cache
policy as the HistoryItem has form data and we pass
MayNotAttemptCacheOnlyLoadForFormSubmissionItem as parameter.

No new tests, covered by WebKit2.RestoreSessionStateContainingFormData
API test.

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

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

5 years agoplatform/mac/fast/loader/file-url-mimetypes-3.html fails when MS Office is installed
ap@apple.com [Fri, 20 Mar 2015 17:07:18 +0000 (17:07 +0000)]
platform/mac/fast/loader/file-url-mimetypes-3.html fails when MS Office is installed
https://bugs.webkit.org/show_bug.cgi?id=142884

Reviewed by Tim Horton.

Disable a test for .xls until rdar://problem/20232251 is fixed. It is not particularly
relevant to a web browser which MIME type local Excel files get anyway.

* platform/mac/fast/loader/file-url-mimetypes-3-expected.txt:
* platform/mac/fast/loader/file-url-mimetypes-3.html:

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

5 years ago[Mac] svg/text/non-bmp-positioning-lists.svg fails when MS Office is installed
ap@apple.com [Fri, 20 Mar 2015 16:47:38 +0000 (16:47 +0000)]
[Mac] svg/text/non-bmp-positioning-lists.svg fails when MS Office is installed
https://bugs.webkit.org/show_bug.cgi?id=142861

Reviewed by Tim Horton.

Converted into a reftest. It would be nice to make tests not depend on installed
fonts in general, but that doesn't seem very feasible (rdar://problem/20000350).

* platform/efl/svg/text/non-bmp-positioning-lists-expected.png: Removed.
* platform/efl/svg/text/non-bmp-positioning-lists-expected.txt: Removed.
* platform/gtk/svg/text/non-bmp-positioning-lists-expected.png: Removed.
* platform/gtk/svg/text/non-bmp-positioning-lists-expected.txt: Removed.
* platform/ios-sim-deprecated/svg/text/non-bmp-positioning-lists-expected.txt: Removed.
* platform/ios-simulator/svg/text/non-bmp-positioning-lists-expected.txt: Removed.
* platform/mac/svg/text/non-bmp-positioning-lists-expected.png: Removed.
* platform/mac/svg/text/non-bmp-positioning-lists-expected.txt: Removed.
* platform/win/svg/text/non-bmp-positioning-lists-expected.txt: Removed.
* svg/text/non-bmp-positioning-lists-expected.svg: Added.

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

5 years ago[Win] Temporarily turn of EWS Windows tests while I debug the test failure.
bfulgham@apple.com [Fri, 20 Mar 2015 15:57:44 +0000 (15:57 +0000)]
[Win] Temporarily turn of EWS Windows tests while I debug the test failure.

* Scripts/webkitpy/common/config/ews.json:

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

5 years ago[CMake] Remove duplicated cmake function calls in WebKit2/CMakeLists.txt
gyuyoung.kim@samsung.com [Fri, 20 Mar 2015 11:26:13 +0000 (11:26 +0000)]
[CMake] Remove duplicated cmake function calls in WebKit2/CMakeLists.txt
https://bugs.webkit.org/show_bug.cgi?id=142901

Reviewed by Csaba Osztrogonác.

add_depencencies(), install() can support multiple targets or location.
We don't need to call it twice.

* CMakeLists.txt: Additionaly move -DBUILDING_WEBKIT to PlatformGTK.cmake,
because it is only used by GTK port.

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

5 years ago[GTK] Disable accelerated compositing on Wayland
zandobersek@gmail.com [Fri, 20 Mar 2015 10:38:19 +0000 (10:38 +0000)]
[GTK] Disable accelerated compositing on Wayland
https://bugs.webkit.org/show_bug.cgi?id=142877

Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreateWebPage): As was done in the past, we should disable
accelerated compositing on Wayland until the proper support for it lands.

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

5 years agoUnreviewed EFL gardening. Update attachment-foo tests to failure.
commit-queue@webkit.org [Fri, 20 Mar 2015 10:09:26 +0000 (10:09 +0000)]
Unreviewed EFL gardening. Update attachment-foo tests to failure.
https://bugs.webkit.org/show_bug.cgi?id=142653

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-03-20

* platform/efl/TestExpectations:

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

5 years agoUnreviewed EFL gardening. Remove duplicate or ambiguous entry lines.
commit-queue@webkit.org [Fri, 20 Mar 2015 09:40:38 +0000 (09:40 +0000)]
Unreviewed EFL gardening. Remove duplicate or ambiguous entry lines.
https://bugs.webkit.org/show_bug.cgi?id=142775

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-03-20

* platform/efl/TestExpectations:

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

5 years ago[Content Filtering] Adopt NEFilterSource unblock handling
aestes@apple.com [Fri, 20 Mar 2015 09:36:21 +0000 (09:36 +0000)]
[Content Filtering] Adopt NEFilterSource unblock handling
https://bugs.webkit.org/show_bug.cgi?id=142904

Reviewed by Andreas Kling.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::unblockHandler):
Returned an unblock handler that calls -[NEFilterSource remediateWithDecisionHandler:].
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::unblockHandler): Used ASCIILiteral.

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

5 years ago[GTK] Search for the Wayland dependency when enabling Wayland target
zandobersek@gmail.com [Fri, 20 Mar 2015 09:23:40 +0000 (09:23 +0000)]
[GTK] Search for the Wayland dependency when enabling Wayland target
https://bugs.webkit.org/show_bug.cgi?id=142876

Reviewed by Carlos Garcia Campos.

* Source/cmake/OptionsGTK.cmake: The Wayland dependency isn't a public
requirement of either the GTK+ or GDK pkg-config files, so we have to
search for it ourselves when WebKitGTK+ has been configured to support
the Wayland windowing target.

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

5 years ago[GTK][jhbuild] Fix flakey failures due to unstable googlecode repository
philn@webkit.org [Fri, 20 Mar 2015 09:00:49 +0000 (09:00 +0000)]
[GTK][jhbuild] Fix flakey failures due to unstable googlecode repository
https://bugs.webkit.org/show_bug.cgi?id=142867

Rubber-stamped by Csaba Osztrogon.

* gtk/jhbuild.modules: Use Ossy's libusrsctp Github fork. Also use
a fixed revision for the openwebrtc-gst-plugins.

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

5 years ago[Content Filtering] Add tests for unblock requests
aestes@apple.com [Fri, 20 Mar 2015 08:42:59 +0000 (08:42 +0000)]
[Content Filtering] Add tests for unblock requests
https://bugs.webkit.org/show_bug.cgi?id=142900

Reviewed by Andreas Kling.

Source/WebCore:

Currently the iOS Parental Controls content filter has a mechanism for requesting that a page be unblocked.
WebKit implements this by listening for navigations originating from the filter's error page to a special URL,
and requesting the page be unblocked via platform API, which might cause UI to be displayed. If the unblock is
successful then we schedule a reload of the frame in order to display the unblocked document.

NetworkExtension also supports unblock requests, so in preparation for adopting its API, this patch allows
content filters to specify their own unblock request method, teaches MockContentFilter to provide such a method,
and writes tests to cover both allowed and denied unblock requests.

The content filter that blocks a load creates a ContentFilterUnblockHandler, passing it a lambda that is executed
when a navigation matches the filter's special unblock URL. Filters can also specify that a script be executed in
the context of its error page if the unblock is denied.

All platform content filters can handle unblock requests like this with the exception of iOS Parental Controls in WebKit2.
Since UI can be displayed by the system in this case, the request must be made from within the UI process. Therefore the
existing method is retained of serializing a WebFilterEvaluator and intercepting navigation policy calls in the UI process.

Tests: contentfiltering/allow-after-unblock-request.html
       contentfiltering/block-after-unblock-request.html

* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::decisionPoint): Added some using statements for clarity.
(WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
(WebCore::toJSValue): Returns a JSValue from a Decision.
(WebCore::toDecision): Returns a Decision from a JSValue.
(WebCore::JSMockContentFilterSettings::decision): Used toJSValue.
(WebCore::JSMockContentFilterSettings::setDecision): Used toDecision.
(WebCore::JSMockContentFilterSettings::unblockRequestDecision): Used toJSValue.
(WebCore::JSMockContentFilterSettings::setUnblockRequestDecision): Used toDecision.
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::createIfNeeded): Passed a reference to the owning DocumentLoader.
(WebCore::ContentFilter::ContentFilter): Ditto.
(WebCore::ContentFilter::unblockHandler): If the unblockHandler requests that a script be executed when an
unblock request is denied, create a wrapper unblockHandler that executes that script in m_documentLoader's frame.
* loader/ContentFilter.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Passed this to ContentFilter::createIfNeeded.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::prepareForLoadStart): Called PolicyChecker::prepareForLoadStart.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::prepareForLoadStart): Reset m_contentFilterUnblockHandler.
(WebCore::PolicyChecker::checkNavigationPolicy): Moved logic to here from WebKit1's WebFrameLoaderClient.
Placing it here allows it to be shared between WebKit1 and WebKit2 (when the unblock handler does not need to
be called in the UI process).
* loader/PolicyChecker.h:
(WebCore::PolicyChecker::setContentFilterUnblockHandler): Added.
* page/Frame.h: Made Frame ThreadSafeRefCounted, since RefPtr<Frames> are captured in lambdas that can be
copied by background threads managed by the underlying platform.
* platform/ContentFilterUnblockHandler.h:
(WebCore::ContentFilterUnblockHandler::unblockURLScheme): Returned the Apple content filter scheme.
(WebCore::ContentFilterUnblockHandler::unblockURLHost): Returned the unblock URL host.
(WebCore::ContentFilterUnblockHandler::clear): Deleted.
* platform/PlatformContentFilter.h:
(WebCore::PlatformContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler): Added a constructor that takes an
unblockURLHost and a UnblockRequesterFunction. Added an alternate constructor for iOS Parental Controls on
WebKit2 that takes an unblockURLHost and a WebFilterEvaluator.
(WebCore::ContentFilterUnblockHandler::needsUIProcess): Returned true if m_webFilterEvaluator is non-null.
(WebCore::ContentFilterUnblockHandler::encode): Encoded m_unblockURLHost in addition to m_webFilterEvaluator.
(WebCore::ContentFilterUnblockHandler::decode): Decoded m_unblockURLHost in addition to m_webFilterEvaluator.
(WebCore::ContentFilterUnblockHandler::canHandleRequest): Returned true if there is a either a m_unblockRequester
or a m_webFilterEvaluator and the request's host and scheme match those of the unblock request URL.
(WebCore::dispatchToMainThread): Added a helper to dispatch a block to the main thread. Then if the web thread
is enabled on iOS, dispatch it there.
(WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Renamed from handleUnblockRequestAndDispatchIfSuccessful.
Requested an unblock using either m_unblockRequester or m_webFilterEvaluator, then called decisionHandler with the response.
(WebCore::scheme): Moved to ContentFilterUnblockHandler::unblockURLScheme.
(WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful): Renamed to requestUnblockAsync.
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::unblockHandler): Returned an unblock handler using the WebFilterEvaluator constructor.
* testing/MockContentFilter.cpp: Added using statments for clarity.
(WebCore::settings): Added a helper to get MockContentFilterSettings::singleton().
(WebCore::MockContentFilter::canHandleResponse): Used the helper.
(WebCore::MockContentFilter::MockContentFilter): Took advantage of the using statements.
(WebCore::MockContentFilter::addData): Ditto.
(WebCore::MockContentFilter::finishedAddingData): Ditto.
(WebCore::MockContentFilter::unblockHandler): Returned a ContentFilterUnblockHandler that checks settings() for its decision.
(WebCore::MockContentFilter::unblockRequestDeniedScript): Returned the script to execute in MockContentFilter's
error page when an unblock request is denied.
(WebCore::MockContentFilter::maybeDetermineStatus): Took advantage of settings() and using statements.
* testing/MockContentFilterSettings.cpp:
(WebCore::MockContentFilterSettings::unblockRequestURL): Constructed a static unblock URL and returned it.
* testing/MockContentFilterSettings.h:
(WebCore::MockContentFilterSettings::unblockURLHost): Returned the filter's unblock URL host.
(WebCore::MockContentFilterSettings::unblockRequestDecision): Returns the decision to make for an unblock request.
(WebCore::MockContentFilterSettings::setUnblockRequestDecision): Sets the decision to make for an unblock request.
* testing/MockContentFilterSettings.idl: Added the unblockRequestDecision and unblockRequestURL attributes.

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidStartProvisionalLoad): This now happens in PolicyChecker.
(WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
* WebView/WebFrame.mm:
(-[WebFrame _contentFilterDidHandleNavigationAction:]): Deleted.
* WebView/WebFrameInternal.h: Removed contentFilterUnblockHandler from WebFramePrivate.

Source/WebKit2:

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::contentFilterDidBlockLoad.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didStartProvisionalLoad): Assigned a default-constructed ContentFilterUnblockHandler instead of calling clear().
(WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Renamed from contentFilterDidHandleNavigationAction.
Updated to use ContentFilterUnblockHandler's new API.
(WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Deleted.
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::contentFilterDidBlockLoad): Renamed from setContentFilterUnblockHandler.
(WebKit::WebFrameProxy::setContentFilterUnblockHandler): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Called WebFrameProxy::didHandleContentFilterUnblockNavigation.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): If the unblock handler needs the UI process,
send WebPageProxy::ContentFilterDidBlockLoadForFrame. Oterwise, call PolicyChecker::setContentFilterUnblockHandler.

LayoutTests:

Taught contentfiltering.js how to perform an unblock request test, and added tests for both allowed and blocked requests.

* contentfiltering/allow-after-unblock-request-expected.html: Added.
* contentfiltering/allow-after-unblock-request.html: Added.
* contentfiltering/block-after-unblock-request-expected.html: Added.
* contentfiltering/block-after-unblock-request.html: Added.
* contentfiltering/resources/contentfiltering.js:
(testContentFiltering): Added an argument specifying if the decision applies to the initial load or the unblock request.
(_doTest): When testing unblock handling, navigate the test iframe to settings.unblockRequestURL when the error page is displayed.
If the unblock is denied, the test harness will call window.unblockRequestDenied(). If the unblock is successful,
the iframe will reload, which we detect by listening for its load event.

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

5 years ago[GTK] Properly guard X11-specific code in BackingStore::createBackend()
zandobersek@gmail.com [Fri, 20 Mar 2015 08:24:42 +0000 (08:24 +0000)]
[GTK] Properly guard X11-specific code in BackingStore::createBackend()
https://bugs.webkit.org/show_bug.cgi?id=142875

Reviewed by Martin Robinson.

* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::createBackend): Guard the GTK- and X11-specific
bit of code with PLATFORM(GTK) and PLATFORM(X11). Testing GDK_WINDOWING_X11
ensures that the GTK+ dependency has X11 support, but does not ensure
that WebKitGTK+ has been configured to build for X11 environments (which
is what PLATFORM(X11) ensures).

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

5 years ago[GTK] Crash due to empty drag image during drag-and-drop
carlosgc@webkit.org [Fri, 20 Mar 2015 08:04:37 +0000 (08:04 +0000)]
[GTK] Crash due to empty drag image during drag-and-drop
https://bugs.webkit.org/show_bug.cgi?id=142671

Reviewed by Philippe Normand.

Return early from ImageBuffer constructor if an empty size is
given. This is a speculative fix for a crash while starting a drag
and drop operation, that I haven't been able to reproduce.

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer):

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

5 years agoUnreviewed, kick the GTK bots to regenerate makefile.
ossy@webkit.org [Fri, 20 Mar 2015 08:02:13 +0000 (08:02 +0000)]
Unreviewed, kick the GTK bots to regenerate makefile.
https://bugs.webkit.org/show_bug.cgi?id=137394

* Source/cmake/OptionsEfl.cmake: Revert my last accidenatal change.
* Source/cmake/OptionsGTK.cmake: Really kick the GTK bots.

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

5 years agoUnreviewed, kick the GTK bots to regenerate makefile.
ossy@webkit.org [Fri, 20 Mar 2015 07:52:25 +0000 (07:52 +0000)]
Unreviewed, kick the GTK bots to regenerate makefile.
https://bugs.webkit.org/show_bug.cgi?id=137394

* Source/cmake/OptionsEfl.cmake:

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

5 years agoFixed a ChangeLog misspelling pointed out by Andreas.
aestes@apple.com [Fri, 20 Mar 2015 06:01:11 +0000 (06:01 +0000)]
Fixed a ChangeLog misspelling pointed out by Andreas.

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

5 years ago[Content Filtering] Give contentfiltering tests a JavaScript harness
aestes@apple.com [Fri, 20 Mar 2015 05:58:32 +0000 (05:58 +0000)]
[Content Filtering] Give contentfiltering tests a JavaScript harness
https://bugs.webkit.org/show_bug.cgi?id=142899

Reviewed by Andreas Kling.

Create a JavaScript function to run the contentfiltering/ tests. This consolodates shared logic and will make
it easier to write new tests.

* TestExpectations: Skipped a test that times out with the new harness (but it also failed before).
* contentfiltering/allow-after-add-data.html: Called testContentFiltering().
* contentfiltering/allow-after-finished-adding-data.html: Ditto.
* contentfiltering/allow-after-response.html: Ditto.
* contentfiltering/block-after-add-data.html: Ditto.
* contentfiltering/block-after-finished-adding-data.html: Ditto.
* contentfiltering/block-after-response.html: Ditto.
* contentfiltering/resources/contentfiltering.js: Added.

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

5 years ago[WK2] We should allow stale content when restoring a killed / crashed WebProcess
cdumez@apple.com [Fri, 20 Mar 2015 05:45:38 +0000 (05:45 +0000)]
[WK2] We should allow stale content when restoring a killed / crashed WebProcess
https://bugs.webkit.org/show_bug.cgi?id=142893
<rdar://problem/19633737>
<rdar://problem/19869257>

Reviewed by Antti Koivisto.

Source/WebCore:

Always use ReturnCacheDataElseLoad cache policy for history navigations.
Previously, we would use the default protocol cache policy for history
navigations if m_stateMachine.committedFirstRealDocumentLoad() returned
false so that we do not display stale content when restoring the session
state of Safari statup (rdar://problem/8131355). This is now handled
before reaching this method by no longer using "IndexedBackForward"
FrameLoadType when restoring session tabs, and using "Standard" load
type instead.

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

Source/WebKit2:

Allow stale content when restoring a killed / crashed WebProcess
(similarly to a history navigation). This is actually what was intended
as we call WebPage::goToBackForwardItem() in this case, which uses
IndexedBackForward load type. However, this value was then ignored in
FrameLoader::loadDifferentDocumentItem().

This patch gets rid of the special casing in
FrameLoader::loadDifferentDocumentItem() and makes it clear at call
sites when calling goToBackForwardItem() if we should allow stale
content or not. If goToBackForwardItem() is called with the
allowStaleContent flag off, we'll keep using the IndexedBackForward
frame load type. However, if the flag is on, we'll use the Standard
frame load type and do a fresh load.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessForReload):
Set allowStaleContent flag to true as we want to allow stale content
when reloading a WebProcess after it crashed or was killed (behavior
change).

(WebKit::WebPageProxy::reattachToWebProcessWithItem):
Add allowStaleContent parameter so that call sites can decide which
policy to use.

(WebKit::WebPageProxy::goForward):
(WebKit::WebPageProxy::goBack):
Set allowStaleContent flag to true as this is our policy for history
navigations.

(WebKit::WebPageProxy::goToBackForwardItem):
Add allowStaleContent parameter so that the call site can let us know
what to do. This is useful as this is called not only for indexed
back / forward navigations (allowing stale content) but also for
restoring session state (forbidding state content:
<rdar://problem/8131355>).

(WebKit::WebPageProxy::restoreFromSessionState):
Call goToBackForwardItem() with allowStaleContent flag set to false
as users expect fresh contents in this case. This method is called
when:
- Tabs are restored on Safari / MobileSafari startup
- Tabs are restored via "History > Reopen All windows from last session"

* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem):
Add allowStaleContent parameter and use "Standard" frame load type
instead of "IndexedBackForward" if it is false. This is needed as
"IndexedBackForward" frame load type allows using stale content.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Add allowStaleContent flag to GoToBackForwardItem message.

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

5 years ago[Content Filtering] Move ContentFilter to from platform/ to loader/
aestes@apple.com [Fri, 20 Mar 2015 05:22:22 +0000 (05:22 +0000)]
[Content Filtering] Move ContentFilter to from platform/ to loader/
https://bugs.webkit.org/show_bug.cgi?id=142897

Reviewed by Dan Bernstein.

ContentFilterCollection never contained any platform code, so it doesn't make sense for it to be in platform.
Move it to loader/, since ContentFilters are owned by DocumentLoaders, and just call it ContentFilter. Extract
the abstract part of ContentFilter into a new base class called PlatformContentFilter that each of the
individual filters inherit from.

* WebCore.xcodeproj/project.pbxproj:
* loader/ContentFilter.cpp: Renamed from Source/WebCore/platform/ContentFilter.cpp.
(WebCore::ContentFilter::types): Moved from ContentFilterCollection.
(WebCore::ContentFilter::createIfNeeded): Ditto.
(WebCore::ContentFilter::ContentFilter): Ditto.
(WebCore::ContentFilter::addData): Ditto.
(WebCore::ContentFilter::finishedAddingData): Ditto.
(WebCore::ContentFilter::needsMoreData): Ditto.
(WebCore::ContentFilter::didBlockData): Ditto.
(WebCore::ContentFilter::getReplacementData): Ditto.
(WebCore::ContentFilter::unblockHandler): Ditto.
* loader/ContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
(WebCore::ContentFilter::type): Replaced a use of ContentFilterCollection.
* platform/PlatformContentFilter.h: Renamed from Source/WebCore/platform/ContentFilter.h.
* platform/cocoa/NetworkExtensionContentFilter.h: Inherited from PlatformContentFilter.
* platform/cocoa/ParentalControlsContentFilter.h: Ditto.
* testing/MockContentFilter.h: Ditto.

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

5 years ago[Win] Try to get the Debug bots green.
bfulgham@apple.com [Fri, 20 Mar 2015 05:06:40 +0000 (05:06 +0000)]
[Win] Try to get the Debug bots green.

* platform/win/TestExpectations:

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

5 years ago[Win] Skip an <attachment> test that times out on Windows.
bfulgham@apple.com [Fri, 20 Mar 2015 05:02:39 +0000 (05:02 +0000)]
[Win] Skip an <attachment> test that times out on Windows.

Also mark two flakes I noticed on the test bots.

* platform/win/TestExpectations:

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

5 years agoCSS Animations with triggers should map scroll position to duration
dino@apple.com [Fri, 20 Mar 2015 04:47:20 +0000 (04:47 +0000)]
CSS Animations with triggers should map scroll position to duration
https://bugs.webkit.org/show_bug.cgi?id=142870
<rdar://problem/20227244>

Reviewed by Simon Fraser.

Source/WebCore:

Expose a prototype implementation of what will eventually be called
animation-timebase, mapping the scroll location to the duration of an
animation. This only applies if the animation has a start and end
trigger.

Test: animations/trigger-container-scroll-boundaries.html
Test: animations/trigger-container-scroll-empty.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createAnimationTriggerValue): Change to downcast.

* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTrigger): Fix a bug where I wasn't
telling the ScrollAnimationTrigger object whether or not it had
an end value. This wasn't visible before because we were not using
the end value.

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::fireAnimationEventsIfNeeded): Add a comment and
change to using a downcast.
(WebCore::AnimationBase::timeToNextService): Change to downcast.
(WebCore::AnimationBase::freezeAtTime): Whitespace cleanup.
(WebCore::AnimationBase::getElapsedTime): Calculate the elapsedTime based
on the scroll position relative to the start and end trigger spots.

* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::updateAnimations): Since this
can potentially call into beginAnimationUpdateTime, it should have
an update blocker. This fixes the assert we were seeing in tests.
(WebCore::AnimationControllerPrivate::scrollWasUpdated): Keep track of the scroll
position so we don't need to ask for it all the time.
* page/animation/AnimationControllerPrivate.h:
(WebCore::AnimationControllerPrivate::scrollPosition): New accessor.

* platform/animation/AnimationTrigger.h: Add downcast macros.
(WebCore::ScrollAnimationTrigger::create): Calculate hasEndValue from the passed
parameters rather than a separate value.
(WebCore::ScrollAnimationTrigger::hasEndValue):
(WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
(WebCore::ScrollAnimationTrigger::setHasEndValue): Deleted.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated): If we have an
animation of this sort, we can't use a CAAnimation.

LayoutTests:

Add a new test that exercises an animation trigger over a scroll
region, and a test of the boundary condition. Also, unskip a test that
was failing due to a bug fixed in this patch.

* animations/trigger-container-scroll-boundaries-expected.txt: Added.
* animations/trigger-container-scroll-boundaries.html: Added.
* animations/trigger-container-scroll-empty-expected.txt: Added.
* animations/trigger-container-scroll-empty.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

5 years ago[Mac] Move MediaPlaybackTargetPicker
eric.carlson@apple.com [Fri, 20 Mar 2015 03:51:45 +0000 (03:51 +0000)]
[Mac] Move MediaPlaybackTargetPicker
https://bugs.webkit.org/show_bug.cgi?id=142889

Source/WebCore:

Move WebMediaPlaybackTargetPickerProxy from WK2 and rename as MediaPlaybackTargetPicker so it
can be used by both WK2 and WK1.

Reviewed by Tim Horton.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/MediaPlaybackTargetPicker.cpp: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp.
* platform/graphics/MediaPlaybackTargetPicker.h: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.h.
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h.
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm.

Source/WebKit2:

Move WebMediaPlaybackTargetPickerProxy to WebCore so it can be used by
both WK2 and WK1.

Reviewed by Tim Horton.

* UIProcess/PageClient.h:
* UIProcess/WebMediaPlaybackTargetPickerProxy.cpp: Removed.
* UIProcess/WebMediaPlaybackTargetPickerProxy.h: Removed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::devicePickerProxy):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createPlaybackTargetPicker):
* UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Removed.
* UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Removed.
* WebKit2.xcodeproj/project.pbxproj:

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

5 years ago32-bit build fix after r181770.
jberlin@webkit.org [Fri, 20 Mar 2015 01:52:57 +0000 (01:52 +0000)]
32-bit build fix after r181770.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController initWithWindow:webView:]):

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

5 years agoAdd support for deleting individual cache entries
andersca@apple.com [Fri, 20 Mar 2015 01:37:14 +0000 (01:37 +0000)]
Add support for deleting individual cache entries
https://bugs.webkit.org/show_bug.cgi?id=142886

Reviewed by Antti Koivisto.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
Remove an unnecessary call to cfURLCacheOrigins().

(WebKit::clearDiskCacheEntries):
Helper function for clearing disk cache entries. This handles both the old and new cache implementations.

(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
Call clearDiskCacheEntries if needed.

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

5 years agoUnreviewed build fix. Don't try to report stats for all benchmarks.
rniwa@webkit.org [Fri, 20 Mar 2015 00:53:33 +0000 (00:53 +0000)]
Unreviewed build fix. Don't try to report stats for all benchmarks.
Just report the geometric mean of preferred means.

* Scripts/run-jsc-benchmarks:

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

5 years agoSource/WebCore:
enrica@apple.com [Fri, 20 Mar 2015 00:47:32 +0000 (00:47 +0000)]
Source/WebCore:
REGRESSION (r109593): Clicking after last inline element could cause a crash.
https://bugs.webkit.org/show_bug.cgi?id=142880
rdar://problem/17222294

Reviewed by Ryosuke Niwa.

Test: editing/selection/click-after-last-inline-crash.html

* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):

LayoutTests:
Web Inspector: Adopt ES6 Class Syntax for all Model Objects
https://bugs.webkit.org/show_bug.cgi?id=142858

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

* inspector/model/parse-script-syntax-tree.html:
This test was calling a constructor without "new". Class
syntax enforces "new" and threw an exception.

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

5 years agoOne more build fix after r181760.
enrica@apple.com [Fri, 20 Mar 2015 00:44:12 +0000 (00:44 +0000)]
One more build fix after r181760.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleDrag):

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

5 years agoBuild fix after r181760.
jberlin@webkit.org [Fri, 20 Mar 2015 00:38:14 +0000 (00:38 +0000)]
Build fix after r181760.

* rendering/RenderAttachment.h:

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

5 years ago[WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
jer.noble@apple.com [Fri, 20 Mar 2015 00:20:52 +0000 (00:20 +0000)]
[WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
https://bugs.webkit.org/show_bug.cgi?id=142132

Reviewed by Tim Horton.

Source/WebCore:

Add a new utility method to calculate a rect with a specific aspect ratio wrapping a smaller one.

* platform/graphics/GeometryUtilities.cpp:
(WebCore::smallestRectWithAspectRatioAroundRect):
* platform/graphics/GeometryUtilities.h:

Source/WebKit2:

Use CALayer animations for the transition into and out of fullscreen.

The fullscreen transition consists of three separate animations:
1. An opacity animation for the black backdrop behind the fullscreen content
2. A scale/translation animation from fullscreen element's initial screen to its final one.
3. A clip animation from the fullscreen element's initial aspect ratio to its final one.

The opacity animation will apply to the fullscreen window's content view's layer's
background color. To separately animate the transform and mask of the web view's content, a
layer-backed subview is added to the content view, and the scale/translation & clip
animations are applied to its transform property and mask layer respectively.

Utility methods to create each animation have been added, and each includes a parameter for
the direction of the animation, so that the same methods can be used for entering and
exiting fullscreen transitions.

The user-visible changes to this new transition are when the aspect ratios of the initial
and final screen locations are different: previously the transition would use a scale
transform to "squish" the fullscreen content into the initial aspect ratio. The new
transition instead "clips" the fullscreen content to the initial aspect ratio. For common
operations such a <video> element with a different aspect ratio than the screen, this makes
the black letterbox "grow" during the transition, and makes the transition overall much
smoother.

* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController initWithWindow:webView:]): Create and initialze the clipping view.
(-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): _backgroundWindow was removed.
(-[WKFullScreenWindowController enterFullScreen:]): Add the webView to the _clipView, not the contentView.
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): _backgroundWindow,
        _fadeAnimation, and _scaleAnimation are all removed.
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.  Hide the contentView's
        layer. Pause visibility updates.
(-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Resume visibility updates.
(-[WKFullScreenWindowController close]): _fadeAnimation and _scaleAnimation are removed.
(-[WKFullScreenWindowController customWindowsToEnterFullScreenForWindow:]): Return only the fullscreen
        window.
(-[WKFullScreenWindowController customWindowsToExitFullScreenForWindow:]): Ditto.
(zoomAnimation): Added.
(maskAnimation): Added.
(fadeAnimation): Added.
(-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Use the utility
        methods above to set up the animation.
(-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
(createBackgroundFullscreenWindow): Deleted.
(windowFrameFromApparentFrames): Deleted.

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

5 years agoWeb Inspector: Adopt ES6 Class Syntax for all Model Objects
joepeck@webkit.org [Fri, 20 Mar 2015 00:18:15 +0000 (00:18 +0000)]
Web Inspector: Adopt ES6 Class Syntax for all Model Objects
https://bugs.webkit.org/show_bug.cgi?id=142858

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

  - Convert WebInspector.Object to a class
  - Convert all UserInterface/Models objects to classes
  - Convert constructor functions to constructor methods
  - Convert "constructor.method" to class static methods where possible
  - Convert all methods to method syntax, eliminate commas between methods
  - Convert all superclass calls in classes to use "super"
  - Workaround <https://webkit.org/b/142862> and add empty constructors
  - Added "deprecated" prefix to addConstructorFunctions, since it is not needed with classes
  - Added many missing calls to super in constructors
  - Added FIXME to WebInspector.Object subclasses not yet moved to classes.
  - Cleaned up SourceMap global properties, moved to constructor instead of prototype
  - Cleaned up Timeline factory constructor to static "create" factory method
  - Fixed any style issues noticed in the mass edit
  - Fixed strict mode issues now that classes enforce strict mode
      - RunLoopTimelineRecord.js was missing a `var` for a local variable
      - "const" is not allowed, converted to "var"
      - "arguments.callee" is not allowed in strict mode

* UserInterface/**/*.js:
Many files modified mostly mechanically.

LayoutTests:

* inspector/model/parse-script-syntax-tree.html:
This test was calling a constructor without "new". Class
syntax enforces "new" and threw an exception.

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

5 years agoWeb Inspector: Debugger sidebar header should say "Scripts" instead of "Breakpoints...
jonowells@apple.com [Thu, 19 Mar 2015 23:52:13 +0000 (23:52 +0000)]
Web Inspector: Debugger sidebar header should say "Scripts" instead of "Breakpoints", appear only on pause
https://bugs.webkit.org/show_bug.cgi?id=142847

Reviewed by Timothy Hatcher.

Add a `paused` class on the debugger sidebar panel. Use that class to adjust the sidebar styles so that, when
the debugger is not paused: there is no header for the scripts section, there is no border beneath the scripts
section, and the scripts section cannot be collapsed (which could be done while the debugger is paused). The
header has changed to say "Scripts" instead of "Breakpoints" when it is showing.

* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .details-section.scripts):
(.sidebar > .panel.navigation.debugger .details-section.scripts .header):
(.sidebar > .panel.navigation.debugger .details-section.scripts.collapsed > .content):
(.sidebar > .panel.navigation.debugger.paused .details-section.scripts):
(.sidebar > .panel.navigation.debugger.paused .details-section.scripts .header):
(.sidebar > .panel.navigation.debugger.paused .details-section.scripts.collapsed > .content):
Adjust styles to hide header and border.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerDidResume):
Add a `paused` class to the debugger sidebar when it is paused.

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

5 years agoGet rid of "CachePolicyCache" cache policy
cdumez@apple.com [Thu, 19 Mar 2015 23:26:08 +0000 (23:26 +0000)]
Get rid of "CachePolicyCache" cache policy
https://bugs.webkit.org/show_bug.cgi?id=142881

Reviewed by Antti Koivisto.

Get rid of "CachePolicyCache" cache policy as it is unused.

* loader/cache/CachePolicy.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::mustRevalidateIsExpiredKey): Deleted.
* page/DiagnosticLoggingKeys.h:

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

5 years agoJSCallee unnecessarily overrides a bunch of things in the method table.
akling@apple.com [Thu, 19 Mar 2015 23:01:14 +0000 (23:01 +0000)]
JSCallee unnecessarily overrides a bunch of things in the method table.
<https://webkit.org/b/142855>

Reviewed by Geoffrey Garen.

Remove JSCallee method table overrides that simply call to base class.
This makes JSFunction property slot lookups slightly more efficient since
they can take the fast path when passing over JSCallee in the base class chain.

* runtime/JSCallee.cpp:
(JSC::JSCallee::getOwnPropertySlot): Deleted.
(JSC::JSCallee::getOwnNonIndexPropertyNames): Deleted.
(JSC::JSCallee::put): Deleted.
(JSC::JSCallee::deleteProperty): Deleted.
(JSC::JSCallee::defineOwnProperty): Deleted.
* runtime/JSCallee.h:

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

5 years agorun-jsc-benchmarks should only report preferred mean
rniwa@webkit.org [Thu, 19 Mar 2015 22:46:56 +0000 (22:46 +0000)]
run-jsc-benchmarks should only report preferred mean
https://bugs.webkit.org/show_bug.cgi?id=142874

Reviewed by Geoffrey Garen.

Just collect statistics for the preferred mean.

* Scripts/run-jsc-benchmarks:

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