WebKit-https.git
5 years agoMake it possible for waitForAndDispatchImmediately to bail if a sync message comes...
timothy_horton@apple.com [Wed, 11 Jun 2014 20:37:59 +0000 (20:37 +0000)]
Make it possible for waitForAndDispatchImmediately to bail if a sync message comes in from the other direction
https://bugs.webkit.org/show_bug.cgi?id=133708

Reviewed by Anders Carlsson.

* Platform/IPC/Connection.cpp:
(IPC::WaitForMessageState):
(IPC::Connection::Connection):
(IPC::Connection::waitForMessage):
(IPC::Connection::processIncomingMessage):
(IPC::Connection::connectionDidClose):
* Platform/IPC/Connection.h:
(IPC::Connection::waitForAndDispatchImmediately):
Remove the waitForMessageMap, and assert that we're only ever waiting for one message at a time.
This simplifies this code a bit, and we never wait on more than one message at a time, so it was unnecessary.

Add a flag to waitForAndDispatchImmediately, InterruptWaitingIfSyncMessageArrives, which will cause
waitForAndDispatchImmediately to bail if a sync message arrives, to avoid pointlessly blocking both processes
for the entire timeout.

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

5 years agoTurning on DUMP_PROPERTYMAP_STATS causes a build failure
rniwa@webkit.org [Wed, 11 Jun 2014 20:21:34 +0000 (20:21 +0000)]
Turning on DUMP_PROPERTYMAP_STATS causes a build failure
https://bugs.webkit.org/show_bug.cgi?id=133673

Reviewed by Andreas Kling.

Source/JavaScriptCore:
Rewrote the property map statistics code because the old code wasn't building,
and it was also mixing numbers for lookups and insertions/removals.

New logging code records the number of calls to PropertyTable::find (finds) and
PropertyTable::get/PropertyTable::findWithString separately so that we can quantify
the number of probing during updates and lookups.

* jsc.cpp:
* runtime/PropertyMapHashTable.h:
(JSC::PropertyTable::find):
(JSC::PropertyTable::get):
(JSC::PropertyTable::findWithString):
(JSC::PropertyTable::add):
(JSC::PropertyTable::remove):
(JSC::PropertyTable::reinsert):
(JSC::PropertyTable::rehash):
* runtime/Structure.cpp:
(JSC::PropertyMapStatisticsExitLogger::PropertyMapStatisticsExitLogger):
(JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):

Source/WTF:
Added DEFINE_GLOBAL_FOR_LOGGING to allow running a destructor in logging code
that needs to be enabled in release builds (e.g. for JavaScriptCore).

* wtf/StdLibExtras.h:

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

5 years agoAlways inline JSValue::get() and Structure::get().
akling@apple.com [Wed, 11 Jun 2014 20:16:42 +0000 (20:16 +0000)]
Always inline JSValue::get() and Structure::get().
<https://webkit.org/b/133755>

Reviewed by Ryosuke Niwa.

These functions get really hot, so ask the compiler to be more
aggressive about inlining them.

~28% speed-up on Ryosuke's microbenchmark for accessing nextSibling
through GetByVal.

* runtime/JSArrayIterator.cpp:
* runtime/JSCJSValue.cpp:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::get):
* runtime/JSPromiseDeferred.cpp:
* runtime/StructureInlines.h:
(JSC::Structure::get):

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

5 years agoStructure::get should instantiate DeferGC only when materializing property map
rniwa@webkit.org [Wed, 11 Jun 2014 20:15:30 +0000 (20:15 +0000)]
Structure::get should instantiate DeferGC only when materializing property map
https://bugs.webkit.org/show_bug.cgi?id=133727

Rubber-stamped by Andreas Kling.

Make materializePropertyMapIfNecessary always inline.

This is ~12% improvement on the microbenchmark attached in the bug.

* runtime/Structure.h:
(JSC::Structure::materializePropertyMapIfNecessary):
(JSC::Structure::materializePropertyMapIfNecessaryForPinning):

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

5 years agoRestrict database process profile
oliver@apple.com [Wed, 11 Jun 2014 20:13:37 +0000 (20:13 +0000)]
Restrict database process profile
https://bugs.webkit.org/show_bug.cgi?id=133750

Reviewed by Alexey Proskuryakov.

Make the sandbox profile much more restrictive.

* Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:

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

5 years agoDon't snapshot offscreen plugins that would normally be considered primary plugins...
roger_fong@apple.com [Wed, 11 Jun 2014 19:59:24 +0000 (19:59 +0000)]
Don't snapshot offscreen plugins that would normally be considered primary plugins after they are moved in view.
https://bugs.webkit.org/show_bug.cgi?id=133667.
<rdar://problem/16743250>

Reviewed by Tim Horton.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::PluginView):
(WebKit::PluginView::pluginSnapshotTimerFired):
Set the display state to Playing if the following is true:
The plugin in question is large enough to be considered the primary snapshot and either:
a) The maximum number of snapshot retries has been reached and no good snapshot has been found.
b) The plugin is moved to be on-screen while the snapshot attempts are in progress.
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::plugInIntersectsSearchRect): Re-factor out intersection logic.
(WebKit::WebPage::plugInIsPrimarySize): Re-factor out primary plugin size logic.
(WebKit::WebPage::determinePrimarySnapshottedPlugIn): Use the above two methods here.
* WebProcess/WebPage/WebPage.h:

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

5 years agoMove more WKPreferences to WKWebViewConfiguration
andersca@apple.com [Wed, 11 Jun 2014 19:49:57 +0000 (19:49 +0000)]
Move more WKPreferences to WKWebViewConfiguration
https://bugs.webkit.org/show_bug.cgi?id=133756
<rdar://problem/17271468>

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setMinimumFontSize:]):
(-[WKPreferences suppressesIncrementalRendering]): Deleted.
(-[WKPreferences setSuppressesIncrementalRendering:]): Deleted.
(-[WKPreferences allowsInlineMediaPlayback]): Deleted.
(-[WKPreferences setAllowsInlineMediaPlayback:]): Deleted.
(-[WKPreferences mediaPlaybackRequiresUserAction]): Deleted.
(-[WKPreferences setMediaPlaybackRequiresUserAction:]): Deleted.
(-[WKPreferences mediaPlaybackAllowsAirPlay]): Deleted.
(-[WKPreferences setMediaPlaybackAllowsAirPlay:]): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoUpdate WKSI for <rdar://problem/17009091>.
jer.noble@apple.com [Wed, 11 Jun 2014 19:31:51 +0000 (19:31 +0000)]
Update WKSI for <rdar://problem/17009091>.

Rubber stamped by Eric Carlson.

* libWebKitSystemInterfaceMavericks.a:
* libWebKitSystemInterfaceMountainLion.a:

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

5 years agoStructure::get should instantiate DeferGC only when materializing property map
rniwa@webkit.org [Wed, 11 Jun 2014 19:29:51 +0000 (19:29 +0000)]
Structure::get should instantiate DeferGC only when materializing property map
https://bugs.webkit.org/show_bug.cgi?id=133727

Reviewed by Geoffrey Garen.

DeferGC instances in Structure::get was added in http://trac.webkit.org/r157539 in order to avoid
collecting the property table newly created by materializePropertyMapIfNecessary since GC can happen
when GCSafeConcurrentJITLocker goes out of scope.

However, always instantiating DeferGC inside Structure::get introduced a new performance bottleneck
in JSObject::getPropertySlot because frequently incrementing and decrementing a counter in vm.m_heap
and running a release assertion inside Heap::incrementDeferralDepth() is expensive.

Work around this by instantiating DeferGC only when we're actually calling materializePropertyMap,
and immediately storing a pointer to the newly created property table in the stack before DeferGC
goes out of scope so that the property table will be marked.

This shows 13-16% improvement on the microbenchmark attached in the bug.

* runtime/JSCJSValue.cpp:
* runtime/JSObject.h:
(JSC::JSObject::fastGetOwnPropertySlot):
* runtime/Structure.h:
(JSC::Structure::materializePropertyMapIfNecessary):
* runtime/StructureInlines.h:
(JSC::Structure::get):

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

5 years agoSome JSValue::get() micro-optimzations.
akling@apple.com [Wed, 11 Jun 2014 18:40:13 +0000 (18:40 +0000)]
Some JSValue::get() micro-optimzations.
<https://webkit.org/b/133739>

Tighten some of the property lookup code to improve performance of the
eagerly reified prototype attributes:

- Instead of converting the property name to an integer at every step
  in the prototype chain, move that to a separate pass at the end
  since it should be a rare case.

- Cache the StructureIDTable in a local instead of fetching it from
  the Heap on every step.

- Make fillCustomGetterPropertySlot inline. It was out-of-lined based
  on the assumption that clients would mostly be cacheable GetByIds,
  and it gets pretty hot (~1%) in GetByVal.

- Pass the Structure directly to fillCustomGetterPropertySlot instead
  of refetching it from the StructureIDTable.

Reviewed by Geoff Garen.

* runtime/JSObject.cpp:
(JSC::JSObject::fillCustomGetterPropertySlot): Deleted.
* runtime/JSObject.h:
(JSC::JSObject::inlineGetOwnPropertySlot):
(JSC::JSObject::fillCustomGetterPropertySlot):
(JSC::JSObject::getOwnPropertySlot):
(JSC::JSObject::fastGetOwnPropertySlot):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::getOwnPropertySlotSlow): Deleted.

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

5 years agoROLLOUT: r153510: Broke Table borders on Wikipedia
bfulgham@apple.com [Wed, 11 Jun 2014 18:36:07 +0000 (18:36 +0000)]
ROLLOUT: r153510: Broke Table borders on Wikipedia
https://bugs.webkit.org/show_bug.cgi?id=132802
<rdar://problem/16792562>

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintCollapsedBorders):
(WebCore::RenderTableCell::alignLeftRightBorderPaintRect): Deleted.
(WebCore::RenderTableCell::alignTopBottomBorderPaintRect): Deleted.
* rendering/RenderTableCell.h:

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

5 years agoWebKit2 iOS: Unable to open UI menu for "open in new tab" for links on yahoo.com.
enrica@apple.com [Wed, 11 Jun 2014 18:06:14 +0000 (18:06 +0000)]
WebKit2 iOS: Unable to open UI menu for "open in new tab" for links on yahoo.com.
https://bugs.webkit.org/show_bug.cgi?id=133749
<rdar://problem/17165992>

Reviewed by Brady Eidson.

The URL returned to the UIProcess as string needs to be encoded.

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

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

5 years agoMove suppressesIncrementalRendering to WKWebViewConfiguration
andersca@apple.com [Wed, 11 Jun 2014 17:44:56 +0000 (17:44 +0000)]
Move suppressesIncrementalRendering to WKWebViewConfiguration
https://bugs.webkit.org/show_bug.cgi?id=133707
<rdar://problem/17271468>

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKPreferences.h:
Get rid of suppressesIncrementalRendering.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Set the suppressesIncrementalRenderingKey key in webPageConfiguration.preferenceValues.

* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
Add suppressesIncrementalRendering.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
Assign suppressesIncrementalRendering.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
Copy webPageConfiguration.preferenceValues to m_configurationPreferenceValues.

(WebKit::WebPageProxy::preferencesStore):
If m_configurationPreferenceValues is empty, just return m_preferences->store(). Otherwise,
copy the store and apply the configuration preference values.

(WebKit::WebPageProxy::preferencesDidChange):
Call preferencesStore() so we'll get the configuration preference values as well.

(WebKit::WebPageProxy::creationParameters):
Ditto.

* UIProcess/WebPageProxy.h:

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

5 years ago[Curl] Empty headers in request response.
commit-queue@webkit.org [Wed, 11 Jun 2014 17:27:30 +0000 (17:27 +0000)]
[Curl] Empty headers in request response.
https://bugs.webkit.org/show_bug.cgi?id=133483

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-06-11
Reviewed by Brent Fulgham.

When a request is taken from the cache, its cached response headers are empty, if the cache entry was created in the same session.
It is only when the cache entry is loaded from disc, that the response headers are properly set.
We need to set the cached response headers in both cases.
There is also an issue if two jobs are loading the same url at the same time.
Both jobs will then write to the cache content file, and create invalid content.
This can be fixed by only letting the first request write to the content file.

* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::CurlCacheEntry):
(WebCore::CurlCacheEntry::isLoading): Added method to check if cache entry is loading the content.
(WebCore::CurlCacheEntry::saveResponseHeaders): Set the cached response headers when response is saved.
(WebCore::CurlCacheEntry::invalidate): To be on the safe side, close content file when entry is invalidated.
(WebCore::CurlCacheEntry::parseResponseHeaders): Made parameter const.
* platform/network/curl/CurlCacheEntry.h: Keep track of which job is creating this cache entry.
(WebCore::CurlCacheEntry::getJob):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::loadIndex): When cache entry is loaded from disc, there is no associated job.
(WebCore::CurlCacheManager::didReceiveResponse): Bail out if cache entry is already currently loading,
otherwise associate this job with the new cache entry.
(WebCore::CurlCacheManager::didFinishLoading): Changed parameter type.
(WebCore::CurlCacheManager::isCached): Don't report the url as cached if it's currently loading content.
(WebCore::CurlCacheManager::didReceiveData): Don't write to the content file if the entry is not associated with the job.
(WebCore::CurlCacheManager::didFail): Changed parameter type.
* platform/network/curl/CurlCacheManager.h: Changed parameter type.
* platform/network/curl/ResourceHandleManager.cpp: Ditto.
(WebCore::writeCallback):
(WebCore::ResourceHandleManager::downloadTimerCallback):

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

5 years agoREGRESSION (r133705): Layout Test js/dom/webidl-type-mapping.html is failing
weinig@apple.com [Wed, 11 Jun 2014 17:03:20 +0000 (17:03 +0000)]
REGRESSION (r133705): Layout Test js/dom/webidl-type-mapping.html is failing
https://bugs.webkit.org/show_bug.cgi?id=133736

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
Turns out we can't remove the HashTable yet after all, as JavaScriptCore
relies on hasSetterOrReadonlyProperties bit to make put work correctly. We
can, however, skip creating the table, and just use the value array during
reification.

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

5 years agoAX: iOS: VoiceOver ignores input type = date in Safari on iOS7
cfleizach@apple.com [Wed, 11 Jun 2014 16:12:56 +0000 (16:12 +0000)]
AX: iOS: VoiceOver ignores input type = date in Safari on iOS7
https://bugs.webkit.org/show_bug.cgi?id=133709

Reviewed by Mario Sanchez Prada.

The date field on iOS appears as a popup button, which is not a type we had encountered for <input> types.
This returns an appropriate role in that case.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):

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

5 years ago[EFL] Drop to maintain EFL 32bit release bot
gyuyoung.kim@samsung.com [Wed, 11 Jun 2014 15:37:31 +0000 (15:37 +0000)]
[EFL] Drop to maintain EFL 32bit release bot
https://bugs.webkit.org/show_bug.cgi?id=133710

Reviewed by Csaba Osztrogonác.

* BuildSlaveSupport/build.webkit.org-config/config.json: Removed EFL 32bit bot.

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

5 years agoWrap NSURLRequest in bundle API
antti@apple.com [Wed, 11 Jun 2014 15:36:58 +0000 (15:36 +0000)]
Wrap NSURLRequest in bundle API
https://bugs.webkit.org/show_bug.cgi?id=133732
<rdar://problem/17267217>

Reviewed by Andreas Kling.

Patch by Dan Bernstein.

We don't want to construct actual NSURLRequests in the web process side unless really needed as it is slow.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/Cocoa/WKNSURLRequest.h: Added.
(WebKit::wrapper):
* Shared/Cocoa/WKNSURLRequest.mm: Added.

    Add a wrapper object that initializes the underlying NSURLRequest on-demand.

(-[WKNSURLRequest _web_createTarget]):
(-[WKNSURLRequest URL]):
(-[WKNSURLRequest copyWithZone:]):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(willSendRequestForFrame):
(didInitiateLoadForResource):

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

5 years ago[GTK] Unreviewed GTK gardening
commit-queue@webkit.org [Wed, 11 Jun 2014 14:42:30 +0000 (14:42 +0000)]
[GTK] Unreviewed GTK gardening

Add missing GTK expectations file after test added at r169390, and removed specific
ones for tests now passing with default ones after r169403.

Patch by Lorenzo Tilve <ltilve@igalia.com> on 2014-06-11

* platform/gtk/fast/dom/webtiming-document-open-expected.txt: Removed.
* platform/gtk/fast/dom/webtiming-navigate-within-document-expected.txt: Removed.
* platform/gtk/fast/multicol/pagination/nested-transforms-expected.txt: Added.

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

5 years ago<rdar://problem/17218629> [Cocoa] WKWebView’s canGoBack and canGoForward properties...
mitz@apple.com [Wed, 11 Jun 2014 14:30:34 +0000 (14:30 +0000)]
<rdar://problem/17218629> [Cocoa] WKWebView’s canGoBack and canGoForward properties are not KVO-compliant
https://bugs.webkit.org/show_bug.cgi?id=133722

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
PageLoadStateObserver member functions.

* UIProcess/API/Cocoa/WKWebView.h: Documented the canGoBack and canGoForward properties as
being KVO-compliant.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canGoBack]): Changed to get the return value from the page load state.
(-[WKWebView canGoForward]): Ditto.

* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::willChangeCanGoBack): Override this new PageLoadStateObserver
member function by sending the appropriate KVO change message to the WKWebView.
(WebKit::NavigationState::didChangeCanGoBack): Ditto.
(WebKit::NavigationState::willChangeCanGoForward): Ditto.
(WebKit::NavigationState::didChangeCanGoForward): Ditto.

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::commitChanges): Check for changes to canGoBack and canGoForward
and call the observers if needed.
(WebKit::PageLoadState::canGoBack): Added. Returns the value from the committed state.
(WebKit::PageLoadState::setCanGoBack): Added. Sets the value in the uncommitted state.
(WebKit::PageLoadState::canGoForward): Added. Returns the value from the committed state.
(WebKit::PageLoadState::setCanGoForward): Added. Sets the value in the uncommitted state.
* UIProcess/PageLoadState.h:
(WebKit::PageLoadState::Data::Data): Added canGoBack and canGoForward boolean members.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChangeBackForwardList): Update the page load state with the new
state of canGoBack and canGoForward.
* UIProcess/WebPageProxy.h: Removed unused member variables m_canGoBack and m_canGoForward.

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

5 years ago[EFL] Updated expectations for accessibility/lists.html test
commit-queue@webkit.org [Wed, 11 Jun 2014 12:50:31 +0000 (12:50 +0000)]
[EFL] Updated expectations for accessibility/lists.html test
https://bugs.webkit.org/show_bug.cgi?id=132818

Patch by Rohit Kumar <kumar.rohit@samsung.com> on 2014-06-11
Reviewed by Mario Sanchez Prada.

* platform/efl-wk1/accessibility/lists-expected.txt:

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

5 years agoAvoid Vector copies in WebNotificationManagerProxy::providerDidCloseNotifications...
zandobersek@gmail.com [Wed, 11 Jun 2014 12:22:04 +0000 (12:22 +0000)]
Avoid Vector copies in WebNotificationManagerProxy::providerDidCloseNotifications(), FindController::findStringMatches()
https://bugs.webkit.org/show_bug.cgi?id=133676

Reviewed by Andreas Kling.

* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::providerDidCloseNotifications): Move the newly-created
Vector object into the HashMap<>::add() call.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::findStringMatches): Movethe newly-create Vector object into the
Vector<>::append() call.

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

5 years agoAvoid FontGlyphsCacheKey copy in FontGlyphsCacheEntry constructor
zandobersek@gmail.com [Wed, 11 Jun 2014 12:20:49 +0000 (12:20 +0000)]
Avoid FontGlyphsCacheKey copy in FontGlyphsCacheEntry constructor
https://bugs.webkit.org/show_bug.cgi?id=133674

Reviewed by Andreas Kling.

* platform/graphics/Font.cpp:
(WebCore::FontGlyphsCacheEntry::FontGlyphsCacheEntry): The FontGlyphsCacheKey
variable is already passed-in as an rvalue reference, so it should be moved
into the constructor of the corresponding member variable instead of copied.

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

5 years ago[EFL][WK2] Add missing test cases for EWK2ViewTest.
commit-queue@webkit.org [Wed, 11 Jun 2014 11:56:05 +0000 (11:56 +0000)]
[EFL][WK2] Add missing test cases for EWK2ViewTest.
https://bugs.webkit.org/show_bug.cgi?id=133715

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-06-11
Reviewed by Gyuyoung Kim.

Add missing test cases for ewk_view.h APIs, ewk_view_stop(), ewk_view_html_string_load(), ewk_view_theme_get(),
ewk_view_feed_touch_event(), ewk_view_text_find_highlight_clear(), ewk_view_text_find(), ewk_view_text_matches_count(),
ewk_view_page_contents_get(), ewk_view_script_execute().

* PlatformEfl.cmake:
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

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

5 years agoFix the build after after r169789 on platforms that build with -Wunused-const-variable
aestes@apple.com [Wed, 11 Jun 2014 10:46:24 +0000 (10:46 +0000)]
Fix the build after after r169789 on platforms that build with -Wunused-const-variable

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHashTable): Don't create the value array if it'll never be used.

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

5 years ago[GTK] Use a different user agent string depending on the site
carlosgc@webkit.org [Wed, 11 Jun 2014 07:38:35 +0000 (07:38 +0000)]
[GTK] Use a different user agent string depending on the site
https://bugs.webkit.org/show_bug.cgi?id=132681

Reviewed by Anders Carlsson.

Source/WebCore:
We have changed the user agent string several times to try to fix
broken websites that require specific things in the UA string to
properly work. But everytime we change the UA string to fix a
website we break others. We could use different UA string
depending on the website. UserAgentGtk code has also been cleaned
up, using NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
and avoiding unneeded conversions to UTF-8.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::UserAgentQuirks::UserAgentQuirks): New helper private
class to handle user agent quirks.
(WebCore::UserAgentQuirks::add):
(WebCore::UserAgentQuirks::contains):
(WebCore::UserAgentQuirks::isEmpty):
(WebCore::platformForUAString): Bring back this method that was
removed to always pretend to be Macintosh.
(WebCore::platformVersionForUAString): Return a different platform
version depending on the actual platform.
(WebCore::versionForUAString): Return the WebKit version.
(WebCore::buildUserAgentString): Helper function to build the user
agent taking into account the UserAgentQuirks received.
(WebCore::standardUserAgentStatic): Standard user agent string
when no quirks are present.
(WebCore::standardUserAgent):
(WebCore::standardUserAgentForURL): New method that returns the
user agent string for the given URL.
* platform/gtk/UserAgentGtk.h:

Source/WebKit2:
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init): Enable site specific quirks setting
by default.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::userAgent): Pass the given URL to WebPage.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userAgent): Try to get the user agent for the
URL received falling back to the current one otherwise.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::platformUserAgent): Added.
* WebProcess/WebPage/efl/WebPageEfl.cpp:
(WebKit::WebPage::platformUserAgent): Return null String.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformUserAgent): Use WebCore::standardUserAgentForURL() when site specific quirks
setting is enabled.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformUserAgent): Return null String.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformUserAgent): Return null String.

Tools:
Add a unit test to check user agent quirks.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp:
(testWebKitSettings): Site specific quirks setting is now enabled
by default.

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

5 years agoUnreviewed, EFL build fix. Treat literal-suffix error as build warning.
gyuyoung.kim@samsung.com [Wed, 11 Jun 2014 07:13:23 +0000 (07:13 +0000)]
Unreviewed, EFL build fix. Treat literal-suffix error as build warning.

* Source/cmake/WebKitHelpers.cmake:

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

5 years ago[Win] Unreviewed build fix.
achristensen@apple.com [Wed, 11 Jun 2014 07:02:23 +0000 (07:02 +0000)]
[Win] Unreviewed build fix.

Source/WebCore:
* platform/network/curl/ResourceRequest.h:
Include missing PassOwnPtr.h.

Source/WebKit:
* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
Fixed 64-bit linker symbol.

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

5 years agoActually only generate tables for History and Location.
weinig@apple.com [Wed, 11 Jun 2014 05:44:00 +0000 (05:44 +0000)]
Actually only generate tables for History and Location.

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

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

5 years agoUnreviewed, update my list of email addresses in contributors.json.
gyuyoung.kim@samsung.com [Wed, 11 Jun 2014 04:32:07 +0000 (04:32 +0000)]
Unreviewed, update my list of email addresses in contributors.json.

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

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

5 years agoAttempt to fix the tests.
weinig@apple.com [Wed, 11 Jun 2014 04:19:00 +0000 (04:19 +0000)]
Attempt to fix the tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
Keep generating HashTables for History and Location, since they use them in
their custom getOwnPropertySlot delegates.

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

5 years ago[iOS][WK2] ScrollingTreeOverflowScrollingNode does not use asynchronous touch dispatch
benjamin@webkit.org [Wed, 11 Jun 2014 03:52:25 +0000 (03:52 +0000)]
[iOS][WK2] ScrollingTreeOverflowScrollingNode does not use asynchronous touch dispatch
https://bugs.webkit.org/show_bug.cgi?id=133702

Source/WebCore:

Reviewed by Simon Fraser.

* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):

Source/WebKit2:
<rdar://problem/17259261>

Reviewed by Simon Fraser.

Notify the WKWebView and the TouchGestureRecognizer when on of the internal UIScrollView
starts scrolling in response to a gesture.

* UIProcess/PageClient.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartPanGesture):
* UIProcess/Scrolling/RemoteScrollingTree.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::scrollViewWillStartPanGesture):
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::scrollViewWillStartPanGesture):

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

5 years agoReduce the overhead of updating the animatable style on ARMv7
benjamin@webkit.org [Wed, 11 Jun 2014 03:35:43 +0000 (03:35 +0000)]
Reduce the overhead of updating the animatable style on ARMv7
https://bugs.webkit.org/show_bug.cgi?id=133618

Reviewed by Simon Fraser.

While updating the style for animations, most of the time spent was pure calling overhead.

This patch should reduce this a bit on ARMv7:
1) Get the frame directly from the document instead of document->view->framview->frame.
2) Inline RenderObject::animation(). This is just 3 loads, setting up the registers on the call
   site is more expensive than loading the values directly.
3) Inline RenderElement::setAnimatableStyle(). It has only one call site and the call is mostly
   overhead.

* css/CSSComputedStyleDeclaration.cpp:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::setAnimatableStyle): Deleted.
* rendering/RenderElement.h:
(WebCore::RenderElement::setAnimatableStyle):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::adjustRectForOutlineAndShadow):
(WebCore::RenderObject::animation): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::animation):
* rendering/RenderView.h:
(WebCore::RenderObject::frame):

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

5 years agoDon't create a HashTable for JSObjects that use eager reification
weinig@apple.com [Wed, 11 Jun 2014 03:09:22 +0000 (03:09 +0000)]
Don't create a HashTable for JSObjects that use eager reification
https://bugs.webkit.org/show_bug.cgi?id=133705

Reviewed by Geoffrey Garen.

../JavaScriptCore:
* runtime/Lookup.h:
(JSC::reifyStaticProperties):
Add a version of reifyStaticProperties that takes an array of HashTableValues
rather than a HashTable.

../WebCore:
It is unnecessary to create the CompactHashIndex or HashTable for JSObjects
that use eager reification, since we will never look up properties directly.
Instead, we can iterate the HashTableValue array directly during reification.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
Only generate the value array for prototypes that use eager reification.

(GenerateHashTableValueArray):
Extract out into a helper.

(GenerateHashTable):
Add a parameter, $justGenerateValueArray, that if true, means we only
should generate the value array.

* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSreadonly.cpp:

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

5 years agoAlways switch to an sRGB screen color profile when running tests
simon.fraser@apple.com [Wed, 11 Jun 2014 02:28:42 +0000 (02:28 +0000)]
Always switch to an sRGB screen color profile when running tests
https://bugs.webkit.org/show_bug.cgi?id=133712

Reviewed by Tim Horton.

Switch the screen color profile to sRGB when running tests, because even ref
tests need the screen to use the correct color profile.

* DumpRenderTree/mac/LayoutTestHelper.m:
(installLayoutTestColorProfile):
* Scripts/webkitpy/port/mac.py:
(MacPort.start_helper):

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

5 years agoPrediction propagator should make sure everyone knows that a variable that is in...
fpizlo@apple.com [Wed, 11 Jun 2014 01:53:19 +0000 (01:53 +0000)]
Prediction propagator should make sure everyone knows that a variable that is in an argument position where other versions of that variable are not MachineInts cannot possibly be flushed as Int52
https://bugs.webkit.org/show_bug.cgi?id=133698

Reviewed by Geoffrey Garen and Mark Hahnenberg.

* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate): Use the new utility to figure out if a variable could ever represent an Int52.
* dfg/DFGVariableAccessData.cpp:
(JSC::DFG::VariableAccessData::couldRepresentInt52): Add a new utility to detect early on if a variable could possibly be Int52.
(JSC::DFG::VariableAccessData::couldRepresentInt52Impl):
(JSC::DFG::VariableAccessData::flushFormat):
* dfg/DFGVariableAccessData.h:
* tests/stress/int52-inlined-call-argument.js: Added.
(foo):
(bar):

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

5 years ago[EFL] Bump EFL libraries to 1.9
ryuan.choi@samsung.com [Wed, 11 Jun 2014 01:38:03 +0000 (01:38 +0000)]
[EFL] Bump EFL libraries to 1.9
https://bugs.webkit.org/show_bug.cgi?id=125479

Patch by Martin Hodovan <mhodovan@partner.samsung.com> on 2014-06-10
Reviewed by Gyuyoung Kim.

Based on the work of Ryuan Choi <ryuan.choi@samsung.com>
and László Langó <llango.u-szeged@partner.samsung.com>.

* ImageDiff/CMakeLists.txt:
* MiniBrowser/efl/CMakeLists.txt:
* efl/install-dependencies:
* efl/jhbuild.modules:
* efl/jhbuildrc:

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

5 years agoAX: iOS: Return the language for attributed text marker queries
cfleizach@apple.com [Wed, 11 Jun 2014 01:04:06 +0000 (01:04 +0000)]
AX: iOS: Return the language for attributed text marker queries
https://bugs.webkit.org/show_bug.cgi?id=133682

Reviewed by Mario Sanchez Prada.

Add language to the list of objects being returned for attributed text.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(AXAttributeStringSetLanguage):
(AXAttributedStringAppendText):

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

5 years agoold-run-webkit-tests: Create CoreSimulator device on demand and find it by name
dfarler@apple.com [Wed, 11 Jun 2014 00:06:17 +0000 (00:06 +0000)]
old-run-webkit-tests: Create CoreSimulator device on demand and find it by name
https://bugs.webkit.org/show_bug.cgi?id=133663

Reviewed by David Kilzer.

* Scripts/old-run-webkit-tests:
(installAndLaunchDumpToolAppUsingNotification):
- Remove obsolete notification keys
- Key off of mandatory device UDID (a UUID)
- Create a device on demand via CoreSimulator if necessary
-- Grab the UDID from the created device plist.
* Scripts/webkitdirs.pm:
(iOSSimulatorDevicesPath): Added
(iOSSimulatorDevices): Added
(createiOSSimulatorDevice): Added
(deleteiOSSimulatorDevice): Added

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

5 years agoSource/WebCore: WebCore part of [Cocoa] Handling authentication challenges should...
mitz@apple.com [Wed, 11 Jun 2014 00:01:18 +0000 (00:01 +0000)]
Source/WebCore: WebCore part of [Cocoa] Handling authentication challenges should not require multiple delegate methods
https://bugs.webkit.org/show_bug.cgi?id=133697

Reviewed by Anders Carlsson.

* platform/network/AuthenticationClient.h: Declared new virtual member functions for
requesting default handling of a challenge and rejecting a challenge.
* platform/network/ResourceHandle.h: Override new AuthenticationClient functions.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::receivedRequestToPerformDefaultHandling): Added. Calls
CFURLConnectionPerformDefaultHandlingForChallenge.
(WebCore::ResourceHandle::receivedChallengeRejection): Added. Calls
CFURLConnectionRejectChallenge.
* platform/network/cf/SocketStreamHandle.h: Override new AuthenticationClient functions.
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Added empty
override.
(WebCore::SocketStreamHandle::receivedChallengeRejection): Ditto.

Source/WebKit2: WebKit2 part of [Cocoa] Handling authentication challenges should not require multiple delegate methods
https://bugs.webkit.org/show_bug.cgi?id=133697

Reviewed by Anders Carlsson.

* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::performDefaultHandling): Added. Calls the new
AuthenticationClient function receivedRequestToPerformDefaultHandling.
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue): Added. Calls the new
AuthenticationClient function receivedChallengeRejection.
* Shared/Authentication/AuthenticationManager.h:
* Shared/Authentication/AuthenticationManager.messages.in: Added new messages
PerformDefaultHandling and RejectProtectionSpaceAndContinue.

* Shared/Downloads/DownloadAuthenticationClient.h: Override new AuthenticationClient member
functions.

* Shared/Downloads/ios/DownloadIOS.mm:
(WebKit::Download::receivedRequestToPerformDefaultHandling): Added empty implementation.
(WebKit::Download::receivedChallengeRejection): Ditto.

* Shared/Downloads/mac/DownloadMac.mm:
(WebKit::Download::receivedRequestToPerformDefaultHandling): Added. Forwards to the sender.
(WebKit::Download::receivedChallengeRejection): Ditto.

* UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
(checkChallenge): Factored out a bit of code into this helper function.
(-[WKNSURLAuthenticationChallengeSender cancelAuthenticationChallenge:]): Use new helper.
(-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
Ditto.
(-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]): Ditto.
(-[WKNSURLAuthenticationChallengeSender performDefaultHandlingForAuthenticationChallenge:]):
Implemented this optional NSURLAuthenticationChallengeSender protocol method by forwarding
to the decision listener.
(-[WKNSURLAuthenticationChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]):
Ditto.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.

* UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
(WebKit::AuthenticationChallengeProxy::performDefaultHandling): Added. Sends a message to
the authentication manager.
(WebKit::AuthenticationChallengeProxy::rejectProtectionSpaceAndContinue): Ditto.
* UIProcess/Authentication/AuthenticationChallengeProxy.h:

* UIProcess/Authentication/AuthenticationDecisionListener.cpp:
(WebKit::AuthenticationDecisionListener::performDefaultHandling): Added. Forwards to the
authentication challenge proxy.
(WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue): Ditto.
* UIProcess/Authentication/AuthenticationDecisionListener.h:

* UIProcess/Cocoa/NavigationState.h: Added flag in m_navigationDelegateMethods struct.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate): Initialize
webViewWillSendRequestForAuthenticationChallenge flag in the delegate methods struct.
(WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): If
the delegate implements -_webView:willSendRequestForAuthenticationChallenge:, return true
here; the delegate will respond with -rejectProtectionSpaceAndContinueWithChallenge: if
it cannot authenticate.
(WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): If the
delegate implements -_webView:willSendRequestForAuthenticationChallenge:, send that message.

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

5 years agoREGRESSION (r167962): Out of bounds read in JSC::StructureIDTable::get()
bfulgham@apple.com [Tue, 10 Jun 2014 23:30:43 +0000 (23:30 +0000)]
REGRESSION (r167962): Out of bounds read in JSC::StructureIDTable::get()
https://bugs.webkit.org/show_bug.cgi?id=133463
<rdar://problem/17098100>

Reviewed by Geoffrey Garen.

Revise MediaControllerHost implementation so that instead of holding its
own pointer to the JS Controller object, it uses new properties added to
the internal media controls DOM hierarchy. This allows the GC to see the
needed lifecycle of the various media control objects and avoids the
premature deallocation that caused this bug.

* Modules/mediacontrols/MediaControlsHost.h:
(WebCore::MediaControlsHost::controllerJSValue): Deleted.
(WebCore::MediaControlsHost::setControllerJSValue): Deleted.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::controllerJSValue): Added convenience function
to share logic for retrieving the controller object.
(WebCore::HTMLMediaElement::updateCaptionContainer): Revise to use new method
for accessing the controller.
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Connect the media
elements JS wrapper object to the MediaControlsHost JS wrapper. Then connect
the MediaControlsHost JS wrapper to the Controller JS object.
(WebCore::HTMLMediaElement::pageScaleFactorChanged): Revise to use new method
for accessing the controller.

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

5 years agoJapanese text in Google search is rendered too low and clipped
mmaxfield@apple.com [Tue, 10 Jun 2014 23:23:46 +0000 (23:23 +0000)]
Japanese text in Google search is rendered too low and clipped
https://bugs.webkit.org/show_bug.cgi?id=133595

Reviewed by Simon Fraser.

This is a revert of r155324.

Source/WebCore:
By forcing line-height to be normal, r155324 was forcing WebKit to inspect font metrics
to determine the height of a line. This means that if a fallback font was required to
draw a line of text, and the fallback font had a higher ascent than the primary font,
the entire line of text would be pushed down. If we don't force line-height to be normal,
then we use the line-height value instead, which short circuits this mechanism, thereby
not pushing text down.

No new tests (because this is simply a revert)

* css/html.css:
(input): Deleted.

LayoutTests:
* fast/dom/HTMLInputElement/input-line-height-expected.txt: Removed.
* fast/dom/HTMLInputElement/input-line-height.html: Removed.
* fast/forms/placeholder-position-expected.txt:
* platform/mac/fast/forms/placeholder-position-expected.png:
* platform/mac/fast/forms/placeholder-position-expected.txt:
* platform/mac-mountainlion/fast/forms/placeholder-position-expected.txt:

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

5 years agoREGRESSION (r167937): Do not use effective zoom factor while resolving media query...
zalan@apple.com [Tue, 10 Jun 2014 23:13:20 +0000 (23:13 +0000)]
REGRESSION (r167937): Do not use effective zoom factor while resolving media query's min-, max-(device)width/height values.
https://bugs.webkit.org/show_bug.cgi?id=133681

Reviewed by Simon Fraser.

We lost the default multiplier(zoom) value of 1 with r167937 at template<typename T> T computeLength().
Now MediaQueryEvaluator takes the current page zoom factor into account while resolving min-, max- width values.

This patch explicitly sets the multiplier value to 1 to ensure zoom independent media query value resolving.

Source/WebCore:
Test: fast/media/media-query-with-scaled-content.html

* css/CSSToLengthConversionData.cpp:
(WebCore::CSSToLengthConversionData::viewportWidthFactor):
(WebCore::CSSToLengthConversionData::viewportHeightFactor):
* css/CSSToLengthConversionData.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::eval):
* testing/Internals.cpp:
(WebCore::Internals::setPageZoomFactor):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:
* fast/media/media-query-with-scaled-content-expected.html: Added.
* fast/media/media-query-with-scaled-content.html: Added.

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

5 years agohttps://bugs.webkit.org/show_bug.cgi?id=133694
simon.fraser@apple.com [Tue, 10 Jun 2014 22:47:02 +0000 (22:47 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=133694

Revert the part of r169733 that caused this test to start failing.

Source/WebCore:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):

LayoutTests:
* platform/mac/TestExpectations:

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

5 years agoFactor repeated CFRunLoopObserver code out
timothy_horton@apple.com [Tue, 10 Jun 2014 22:30:31 +0000 (22:30 +0000)]
Factor repeated CFRunLoopObserver code out
https://bugs.webkit.org/show_bug.cgi?id=133690

Reviewed by Simon Fraser.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* platform/cf/RunLoopObserver.cpp: Added.
(WebCore::RunLoopObserver::create):
(WebCore::RunLoopObserver::~RunLoopObserver):
(WebCore::RunLoopObserver::runLoopObserverFired):
(WebCore::RunLoopObserver::schedule):
(WebCore::RunLoopObserver::invalidate):
* platform/cf/RunLoopObserver.h: Added.
(WebCore::RunLoopObserver::isScheduled):
(WebCore::RunLoopObserver::RunLoopObserver):
Factor CFRunLoopObserver management code out of LayerFlushScheduler and WebKit2.

* platform/graphics/ca/LayerFlushScheduler.h:
* platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
(WebCore::LayerFlushScheduler::LayerFlushScheduler):
(WebCore::LayerFlushScheduler::~LayerFlushScheduler):
(WebCore::LayerFlushScheduler::layerFlushCallback):
(WebCore::LayerFlushScheduler::schedule):
(WebCore::LayerFlushScheduler::invalidate):
(WebCore::LayerFlushScheduler::runLoopObserverCallback): Deleted.
Make use of WebCore::RunLoopObserver.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator):
(WebKit::coreAnimationDidCommitLayersCallback): Deleted.
(WebKit::RemoteLayerTreeDrawingAreaProxy::scheduleCoreAnimationLayerCommitObserver): Deleted.
(WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
Make use of WebCore::RunLoopObserver.

* WebView/WebViewData.h:

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

5 years agoModernize loop code in scrolling tree code
simon.fraser@apple.com [Tue, 10 Jun 2014 22:14:46 +0000 (22:14 +0000)]
Modernize loop code in scrolling tree code
https://bugs.webkit.org/show_bug.cgi?id=133688

Reviewed by Anders Carlsson.

Use new loop syntax for walking children.

* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::cloneAndResetChildren):
(WebCore::ScrollingStateNode::removeChild):
(WebCore::ScrollingStateNode::willBeRemovedFromStateTree):
(WebCore::ScrollingStateNode::dump):
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::removeChild):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):

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

5 years agoUse [ Pass Failure ] instead of [ Skip ] for the tests skipped in r169767.
aestes@apple.com [Tue, 10 Jun 2014 21:56:38 +0000 (21:56 +0000)]
Use [ Pass Failure ] instead of [ Skip ] for the tests skipped in r169767.

* platform/mac/TestExpectations:

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

5 years agoFix availability declaration.
andersca@apple.com [Tue, 10 Jun 2014 21:41:04 +0000 (21:41 +0000)]
Fix availability declaration.

* UIProcess/API/Cocoa/WKError.h:

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

5 years ago[GTK][gtkdoc] remove -Wcast-align
vjaquez@igalia.com [Tue, 10 Jun 2014 21:40:03 +0000 (21:40 +0000)]
[GTK][gtkdoc] remove -Wcast-align
https://bugs.webkit.org/show_bug.cgi?id=133640

Apparently gcc warns that GParamSpec is not castable to
GParamSpecInt64/GParamSpecUInt64/GParamSpecDouble due they are 64bit, even
though ARM hackers claim that those only need 4byte alignment. As long as gcc
behaves that way, this warning is not very useful, also they break the Debian
packaging.

This patch appends the compiler flag -Wno-align-cast for the gtkdoc
scanner compilation, thus the compiler ignores the previous
-Waling-cast flag.

Reviewed by Martin Robinson.

* gtk/generate-gtkdoc:
(get_generator_for_config):

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

5 years agoREGRESSION (6/9/2014): Several TextTrackCue tests became very flaky
aestes@apple.com [Tue, 10 Jun 2014 21:36:53 +0000 (21:36 +0000)]
REGRESSION (6/9/2014): Several TextTrackCue tests became very flaky
https://bugs.webkit.org/show_bug.cgi?id=133686

* platform/mac/TestExpectations: Skipped the flaky tests

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

5 years agoAddress a comment about a comment.
andersca@apple.com [Tue, 10 Jun 2014 21:36:04 +0000 (21:36 +0000)]
Address a comment about a comment.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView evaluateJavaScript:completionHandler:]):

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

5 years agoAdd -[WKWebView evaluateJavaScript:completionHandler:]
andersca@apple.com [Tue, 10 Jun 2014 21:25:54 +0000 (21:25 +0000)]
Add -[WKWebView evaluateJavaScript:completionHandler:]
https://bugs.webkit.org/show_bug.cgi?id=133689
<rdar://problem/17152685>

Reviewed by Geoffrey Garen.

Source/WebCore:
* English.lproj/Localizable.strings:
Add new localizable strings.

Source/WebKit2:
* Shared/API/c/WKErrorRef.h:
Remove WKErrorCode typedef from here.

* UIProcess/API/C/WKPageLoaderClient.h:
Use uint32_t instead of WKErrorCode.

* UIProcess/API/Cocoa/WKError.h:
(NS_ENUM):
Add a WKErrorDomain and a WKErrorCode enum.

* UIProcess/API/Cocoa/WKError.mm:
(localizedDescriptionForErrorCode):
Helper that returns the localized description given an error code.

(createNSError):
Helper that creates an NSError with the correct localized description given an error code.

* UIProcess/API/Cocoa/WKErrorInternal.h:
Add helpers.

* UIProcess/API/Cocoa/WKWebView.h:
Add evaluateJavaScript:completionHandler: method.

* UIProcess/API/Cocoa/WKWebView.mm:
(callbackErrorCode):
Helper that returns a WKErrorCode from a WebKit::CallbackBase::Error enum.

(-[WKWebView evaluateJavaScript:completionHandler:]):
Run the JavaScript code and handle all the error cases.

(-[WKWebView _runJavaScriptInMainFrame:]):
Reimplement this using the API method.

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

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

5 years ago[WK2] http/tests/navigation/new-window-redirect-history.html crashes
ap@apple.com [Tue, 10 Jun 2014 21:20:19 +0000 (21:20 +0000)]
[WK2] http/tests/navigation/new-window-redirect-history.html crashes
https://bugs.webkit.org/show_bug.cgi?id=127683

* platform/wk2/TestExpectations: Changed expectation from Crash to Skip, because
it crashes every time, and generating more crash logs only makes other tests more
flaky without providing useful information.

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

5 years agoDon't call Connection::terminateSoon if the connection is null
andersca@apple.com [Tue, 10 Jun 2014 20:56:15 +0000 (20:56 +0000)]
Don't call Connection::terminateSoon if the connection is null
https://bugs.webkit.org/show_bug.cgi?id=133695
<rdar://problem/17069024>

Reviewed by Tim Horton.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::removeWebPage):

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

5 years agoSkip some more flaky tests.
ap@apple.com [Tue, 10 Jun 2014 20:54:42 +0000 (20:54 +0000)]
Skip some more flaky tests.
https://bugs.webkit.org/show_bug.cgi?id=133696
<rdar://problem/17257097>

* platform/wk2/TestExpectations:

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

5 years agoREGRESSION (r169733): compositing/iframes/become-composited-nested-iframes.html fails...
aestes@apple.com [Tue, 10 Jun 2014 20:47:03 +0000 (20:47 +0000)]
REGRESSION (r169733): compositing/iframes/become-composited-nested-iframes.html fails on WebKit1 bots
https://bugs.webkit.org/show_bug.cgi?id=133694

* platform/mac/TestExpectations: Marked the test as failing

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

5 years agofast/dom/beforeload/remove-frame-in-beforeload-listener.html and related tests are...
ap@apple.com [Tue, 10 Jun 2014 20:41:50 +0000 (20:41 +0000)]
fast/dom/beforeload/remove-frame-in-beforeload-listener.html and related tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=133685

* platform/wk2/TestExpectations: Skipped more affected tests.

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

5 years agoAdd process entitlements
oliver@apple.com [Tue, 10 Jun 2014 20:33:00 +0000 (20:33 +0000)]
Add process entitlements
https://bugs.webkit.org/show_bug.cgi?id=133693

Reviewed by Alexey Proskuryakov.

Add entitlements description for Database process, and
ensure that we reference the correct seatbelt profiles.

* Configurations/DatabaseService.Development.xcconfig:
* Configurations/DatabaseService.xcconfig:
* Configurations/Databases-iOS.entitlements:
* Configurations/Network-iOS.entitlements:
* Configurations/WebContent-iOS.entitlements:
* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoAssertion failure at JSC::Structure::checkOffsetConsistency() const + 234.
mark.lam@apple.com [Tue, 10 Jun 2014 20:29:29 +0000 (20:29 +0000)]
Assertion failure at JSC::Structure::checkOffsetConsistency() const + 234.
<https://webkit.org/b/133356>

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore:
The root cause of this issue is that a nonPropertyTransition can transition
a pinned dictionary structure to an unpinned dictionary structure.  The new
structure will get a copy of the property table from the original structure.
However, when a GC occurs, the property table in the new structure will be
cleared because it is unpinned.  This leads to complications in subsequent
derivative structures when flattening occurs, which eventually leads to the
assertion failure in this bug.

The fix is to ensure that the new dictionary structure generated by the
nonPropertyTransition will have a copy of its predecessor's property table
and is pinned.

* runtime/Structure.cpp:
(JSC::Structure::nonPropertyTransition):

LayoutTests:
* TestExpectations:
- Undoing expectation for js/primitive-property-access-edge-cases.html now
  that the bug is fixed.

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

5 years agoFix crashes on some plug-in tests.
ap@apple.com [Tue, 10 Jun 2014 20:00:14 +0000 (20:00 +0000)]
Fix crashes on some plug-in tests.
https://bugs.webkit.org/show_bug.cgi?id=133691
<rdar://problem/17255836>

Reviewed by Anders Carlsson.

* PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::initialize):
Cannot use TemporaryChange here, because the object may go away before stack unwinds.

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

5 years agoplatform/mac-wk2/plugins/destroy-during-async-npp-new.html is flaky
ap@apple.com [Tue, 10 Jun 2014 19:56:03 +0000 (19:56 +0000)]
platform/mac-wk2/plugins/destroy-during-async-npp-new.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=133692

* platform/mac-wk2/TestExpectations: Skipped the test.

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

5 years agoSerialize ResourceRequests without platform request
antti@apple.com [Tue, 10 Jun 2014 19:07:47 +0000 (19:07 +0000)]
Serialize ResourceRequests without platform request
https://bugs.webkit.org/show_bug.cgi?id=133679

Reviewed by Alexey Proskuryakov.

Source/WebCore:
We create platform requests in the web process just so we can serialize them. This is unnecessary work.

* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::encodingRequiresPlatformData):
(WebCore::ResourceRequestBase::encodeWithoutPlatformData):
(WebCore::ResourceRequestBase::decodeWithoutPlatformData):

    Add encoding and decoding functions here to avoid exposing internals.

* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData):

    Allow encoding without platform data if it hasn't been created yet and there is no request body.

Source/WebKit2:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encode):
(IPC::ArgumentCoder<ResourceRequest>::decode):

    Encode ResourceRequest directly if possible.

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

5 years agoWeb Inspector: recording is overused as both noun and verb in TimelineManager
burg@cs.washington.edu [Tue, 10 Jun 2014 18:47:01 +0000 (18:47 +0000)]
Web Inspector: recording is overused as both noun and verb in TimelineManager
https://bugs.webkit.org/show_bug.cgi?id=132878

Reviewed by Joseph Pecoraro.

Rename most uses of the verb 'recording' to the verb 'capturing' for timelines.
Rename getter for the recording to activeRecording, and recordingEnabled to isCapturing().

When the timeline manager can handle multiple timeline data sets (i.e., 'recordings'),
it will be very confusing to have 'recording' as a plural noun and verb in the model.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.prototype.get activeRecording):
(WebInspector.TimelineManager.prototype.isCapturing):
(WebInspector.TimelineManager.prototype.startCapturing):
(WebInspector.TimelineManager.prototype.stopCapturing):
(WebInspector.TimelineManager.prototype.eventRecorded.processRecord):
(WebInspector.TimelineManager.prototype.eventRecorded):
(WebInspector.TimelineManager.prototype._addRecord):
(WebInspector.TimelineManager.prototype._startAutoCapturing):
(WebInspector.TimelineManager.prototype._stopAutoRecordingSoon):
(WebInspector.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
(WebInspector.TimelineManager.prototype._mainResourceDidChange):
(WebInspector.TimelineManager.prototype._resourceWasAdded):
(WebInspector.TimelineManager.prototype.get recording): Deleted.
(WebInspector.TimelineManager.prototype.get recordingEnabled): Deleted.
(WebInspector.TimelineManager.prototype.startRecording): Deleted.
(WebInspector.TimelineManager.prototype.stopRecording): Deleted.
(WebInspector.TimelineManager.prototype._startAutoRecording): Deleted.
* UserInterface/Models/DefaultDashboard.js:
(WebInspector.DefaultDashboard):
(WebInspector.DefaultDashboard.prototype._mainResourceDidChange):
(WebInspector.DefaultDashboard.prototype._capturingStopped):
(WebInspector.DefaultDashboard.prototype._recordingStopped): Deleted.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.isTimelineProfilingEnabled):
(InspectorFrontendAPI.setTimelineProfilingEnabled):
* UserInterface/Views/TimelineContentView.js:
(WebInspector.TimelineContentView.prototype._capturingStarted):
(WebInspector.TimelineContentView.prototype._capturingStopped):
(WebInspector.TimelineContentView.prototype._recordingStarted): Deleted.
(WebInspector.TimelineContentView.prototype._recordingStopped): Deleted.
* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype.initialize):
(WebInspector.TimelineSidebarPanel.prototype._capturingStarted):
(WebInspector.TimelineSidebarPanel.prototype._capturingStopped):
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOver):
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOut):
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphClicked):
(WebInspector.TimelineSidebarPanel.prototype._replayCaptureButtonClicked):
(WebInspector.TimelineSidebarPanel.prototype._recordingStarted): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._recordingStopped): Deleted.

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

5 years agofast/dom/beforeload/remove-frame-in-beforeload-listener.html is flaky
ap@apple.com [Tue, 10 Jun 2014 18:03:25 +0000 (18:03 +0000)]
fast/dom/beforeload/remove-frame-in-beforeload-listener.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=133685

* platform/wk2/TestExpectations: Skipped the test.

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

5 years agoIn a certain app state, Array.prototype.filter() returns incorrect results
msaboff@apple.com [Tue, 10 Jun 2014 17:58:03 +0000 (17:58 +0000)]
In a certain app state, Array.prototype.filter() returns incorrect results
https://bugs.webkit.org/show_bug.cgi?id=133577

Reviewed by Oliver Hunt.

Source/JavaScriptCore:
Fixed the LLInt processing of op_put_by_val_direct to have the same hole check as op_put_by_val.

* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

LayoutTests:
New test to check that the llint handles writing to an array hole from a built-in
function.

* js/regress/put-by-val-direct-expected.txt: Added.
* js/regress/put-by-val-direct.html: Added.
* js/regress/script-tests/put-by-val-direct.js: Added.
(test):

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

5 years agoSend more context about text selection to telephone number scanner
beidson@apple.com [Tue, 10 Jun 2014 17:52:18 +0000 (17:52 +0000)]
Send more context about text selection to telephone number scanner
<rdar://problem/16874385> and https://bugs.webkit.org/show_bug.cgi?id=133684

Reviewed by Enrica Casucci.

* dom/Range.cpp:
(WebCore::rangesOverlap):Add a utility to check if two ranges overlap.
* dom/Range.h:

* editing/Editor.cpp:
(WebCore::Editor::scanSelectionForTelephoneNumbers): Create a range that is wider than the
  actual selection to search for phone numbers that are not completely selected yet.

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

5 years ago[iOS] Another unreviewed build fix after r169746.
achristensen@apple.com [Tue, 10 Jun 2014 17:42:51 +0000 (17:42 +0000)]
[iOS] Another unreviewed build fix after r169746.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
Prevent another unused value error.

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

5 years ago[iOS] Unreviewed build fix after r169746.
achristensen@apple.com [Tue, 10 Jun 2014 17:37:37 +0000 (17:37 +0000)]
[iOS] Unreviewed build fix after r169746.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
Protect startTime with !PLATFORM(IOS) to prevent a unused variable build error.

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

5 years agoAX: WK2: iOS: text editing does not work
cfleizach@apple.com [Tue, 10 Jun 2014 17:19:05 +0000 (17:19 +0000)]
AX: WK2: iOS: text editing does not work
https://bugs.webkit.org/show_bug.cgi?id=133666

Reviewed by Mario Sanchez Prada.

In WK2, all the text editing is handled by the WebProcess, so selectedTextRange and setSelectedTextRange
need to be implemented, as well as posting the right value change notification.

* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper postValueChangedNotification]):
(-[WebAccessibilityObjectWrapper _accessibilitySelectedTextRange]):
(-[WebAccessibilityObjectWrapper _accessibilitySetSelectedTextRange:]):

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

5 years ago[iOS WebKit2] Stay in "memory pressure" mode until told otherwise.
akling@apple.com [Tue, 10 Jun 2014 16:02:03 +0000 (16:02 +0000)]
[iOS WebKit2] Stay in "memory pressure" mode until told otherwise.
<https://webkit.org/b/133671>

When we receive the first memory pressure signal, flip the flag in
MemoryPressureHandler so that isUnderMemoryPressure() returns true
from then on, until the system tells us pressure levels are back
to normal.

The hold-off mechanism is disabled for iOS, that wasn't actually
needed in the first place, since the system is not going to spam
you with tons of notifications.

Also propagate the "critical" flag all the way from the system
to the pressure handler. Note that we don't actually do anything
differently based on the flag yet.

Reviewed by Sam Weinig.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::setUnderMemoryPressure):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):
(WebCore::MemoryPressureHandler::respondToMemoryPressure):

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

5 years agoFix logging of sticky scrolling tree nodes
simon.fraser@apple.com [Tue, 10 Jun 2014 15:46:14 +0000 (15:46 +0000)]
Fix logging of sticky scrolling tree nodes
https://bugs.webkit.org/show_bug.cgi?id=133670

Reviewed by Sam Weinig.

Source/WebCore:

ScrollingStateStickyNode::dumpProperties() dumped stickyBoxRect() twice and
didn't dump constrainingRectAtLastLayout(), so fix that.

* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::dumpProperties):

LayoutTests:

Rebaselined.

* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

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

5 years ago[CSS Grid Layout] Simplify the named grid lines resolution algorithm
svillar@igalia.com [Tue, 10 Jun 2014 10:23:59 +0000 (10:23 +0000)]
[CSS Grid Layout] Simplify the named grid lines resolution algorithm
https://bugs.webkit.org/show_bug.cgi?id=133543

Reviewed by Darin Adler.

Source/WebCore:
Named grid lines resolution algorithm can be heavily simplified by
inserting the implicit named grid lines generated by each grid
area (<area-name>-{start|end} for rows and columns), into the list
of user defined named grid lines. This way we would only have to
deal with named grid lines and forget about the named grid areas
(as described in the specs
http://dev.w3.org/csswg/css-grid/#grid-placement-slot).

As a nice side effect, we'll get for free the implementation of the
use case described in section 5.2.2 Implicit Named Areas.

Test: fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html

* css/StyleResolver.cpp:
(WebCore::createImplicitNamedGridLinesFromGridArea):
(WebCore::StyleResolver::applyProperty):
* rendering/RenderGrid.cpp:
(WebCore::isStartSide):
(WebCore::gridLinesForSide):
(WebCore::implicitNamedGridLineForSide):
(WebCore::isNonExistentNamedLineOrArea):
(WebCore::RenderGrid::adjustGridPositionsFromStyle):
(WebCore::RenderGrid::resolveNamedGridLinePositionFromStyle):
(WebCore::RenderGrid::resolveGridPositionFromStyle):
(WebCore::RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition):
(WebCore::gridLineDefinedBeforeGridArea): Deleted.
(WebCore::setNamedLinePositionIfDefinedBeforeArea): Deleted.
(WebCore::RenderGrid::adjustNamedGridItemPosition): Deleted.

LayoutTests:
Added a new test that checks that named grid lines and areas are
correctly set after dynamically changing them with JS. It also
verifies that we properly recompute the resolution of named grid
lines/areas when the positioning properties change.

Also appended a new test case to verify that explicitly adding
named lines of the form <foo-start>/<foo-end> effectively creates
implicit named grid areas so that we could use them in grid
placement properties (for example -webkit-grid-column: foo).

No need to add more tests for named grid lines/areas resolution as
we already have a quite good coverage (the feature was already
there, we're simplifying/improving the implementation).

* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set-expected.txt: Added.
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html: Added.
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution-expected.txt:
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html:

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

5 years ago[MediaStream] Add getTracks() support to MediaStream.
commit-queue@webkit.org [Tue, 10 Jun 2014 10:17:16 +0000 (10:17 +0000)]
[MediaStream] Add getTracks() support to MediaStream.
https://bugs.webkit.org/show_bug.cgi?id=133641

Patch by Kiran <kiran.guduru@samsung.com> on 2014-06-10
Reviewed by Eric Carlson.

Source/WebCore:
A new method named getTracks is proposed to retrieve all the tracks
of a MediaStream irrespective of the type. This method has been implementd.

Test: fast/mediastream/MediaStream-getTracks.html

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::getTracks):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStream.idl:

LayoutTests:
* fast/mediastream/MediaStream-getTracks-expected.txt: Added.
* fast/mediastream/MediaStream-getTracks.html: Added.

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

5 years agoRemove use of view() in RenderView code
simon.fraser@apple.com [Tue, 10 Jun 2014 05:49:57 +0000 (05:49 +0000)]
Remove use of view() in RenderView code
https://bugs.webkit.org/show_bug.cgi?id=133669

Reviewed by Andreas Kling.

view() in RenderView just returns *this, so no need to use it.

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

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

5 years ago[iOS] Wireless route picker control should use touch event handlers
eric.carlson@apple.com [Tue, 10 Jun 2014 05:23:00 +0000 (05:23 +0000)]
[iOS] Wireless route picker control should use touch event handlers
https://bugs.webkit.org/show_bug.cgi?id=133672

Reviewed by Brent Fulgham.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.createControls): Listen for touch events.
(ControllerIOS.prototype.handleWirelessPickerButtonTouchStart): New, handle touch start.
(ControllerIOS.prototype.handleWirelessPickerButtonTouchEnd): New, handle touch end.
(ControllerIOS.prototype.handleWirelessPickerButtonTouchCancel): New, handle touch cancel.
(ControllerIOS.prototype.handleWirelessPickerButtonClicked): Deleted.

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

5 years agoGlobal HashTables contain references to atomic StringImpls
mhahnenberg@apple.com [Tue, 10 Jun 2014 03:01:42 +0000 (03:01 +0000)]
Global HashTables contain references to atomic StringImpls
https://bugs.webkit.org/show_bug.cgi?id=133661

Reviewed by Geoffrey Garen.

This was a long-standing bug revealed by bug 133558. The issue is that the global static HashTables
cache their set of keys as StringImpls that are associated with a particular VM.  This is obviously
incompatible with using multiple VMs on multiple threads (e.g. when using workers). The fix is to
change the "keys" field of the static HashTables to be char** instead of StringImpl**.

* runtime/JSObject.cpp:
(JSC::getClassPropertyNames):
* runtime/Lookup.cpp:
(JSC::HashTable::createTable):
(JSC::HashTable::deleteTable):
* runtime/Lookup.h:
(JSC::HashTable::ConstIterator::key):
(JSC::HashTable::entry):

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

5 years agoDo not use a mask when matching the return value of a function call on ARM
benjamin@webkit.org [Tue, 10 Jun 2014 02:31:28 +0000 (02:31 +0000)]
Do not use a mask when matching the return value of a function call on ARM
https://bugs.webkit.org/show_bug.cgi?id=133614

Reviewed by Andreas Kling.

On ARM, we cannot have garbage on the top bits of booleans. It is faster to check the whole
register for nullity.

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::callAndBranchOnBooleanReturnValue):
(WebCore::FunctionCall::callAndBranchOnCondition):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):

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

5 years agoRemove the bogus assertion that didn't even build.
rniwa@webkit.org [Tue, 10 Jun 2014 01:14:31 +0000 (01:14 +0000)]
Remove the bogus assertion that didn't even build.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue):

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

5 years agoFix build.
andersca@apple.com [Tue, 10 Jun 2014 00:54:39 +0000 (00:54 +0000)]
Fix build.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):

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

5 years agoCommit the right fix.
rniwa@webkit.org [Tue, 10 Jun 2014 00:49:09 +0000 (00:49 +0000)]
Commit the right fix.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue):

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

5 years agoREGRESSION: Web Inspector: Exception showing the DOM tree for a node with too many...
commit-queue@webkit.org [Tue, 10 Jun 2014 00:46:21 +0000 (00:46 +0000)]
REGRESSION: Web Inspector: Exception showing the DOM tree for a node with too many children
https://bugs.webkit.org/show_bug.cgi?id=129696

Fix issue where sometimes inspecting an element will try to attach the "show all nodes" button
before the expand function is called in TreeElement before _childrenListNode has been set.

Patch by Jono Wells <jonowells@apple.com> on 2014-06-09
Reviewed by Joseph Pecoraro.

* UserInterface/Views/TreeOutline.js:
(TreeOutline.prototype.appendChild):
(TreeOutline.prototype.insertChild):
Added check for existance of this._childrenListNode.

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

5 years agoDebug build fix after r169731.
rniwa@webkit.org [Tue, 10 Jun 2014 00:46:21 +0000 (00:46 +0000)]
Debug build fix after r169731.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue):

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

5 years agoWork towards having frames in the scrolling tree
simon.fraser@apple.com [Tue, 10 Jun 2014 00:37:06 +0000 (00:37 +0000)]
Work towards having frames in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=133665

Reviewed by Tim Horton.

Source/WebCore:
Optionally (based on Setting) create nodes in the scrolling tree for frames which
contain async-scrollable content. This will be used on iOS/WK2 to support accelerated
overflow-scroll in iframes. The setting allows for testing on OS X.

The change breaks an assumption in ScrollingCoordinator/AsyncScrollingCoordinator
that we're always dealing with the main frame, and changes logic in RenderLayerCompositor
so that we can connect the scrolling tree across frame boundaries. RenderLayerCompositor
maintains a m_subframeScrollLayersNeedReattach flag that gets set whenever we add or remove
scroll-coordinated layers in the current frame. When set, after updating compositing
layers we walk child frames, and, if they have scrolling nodes, re-attach them to the
scrolling tree (which will find the new ancestor node).

Tests: platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html
       platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::scrollLayerID): Use the new "for role" way of getting the node ID.
* page/Settings.cpp:
* page/Settings.in: Add scrollingTreeIncludesFrames.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Only set
the region for the main frame.
(WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode): updateScrollPositionAfterAsyncScroll()
needs to know which FrameView a given nodeID is hosted in; doing a walk of the frame tree for
non-main frames seems to be the safest way.
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::syncChildPositions):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Consult the new setting.
(WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
(WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
(WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::ScrollingCoordinator::synchronousScrollingReasons):
(WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
(WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
(WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
(WebCore::ScrollingCoordinator::replaySessionStateDidChange):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously): Deleted.
* rendering/RenderLayerBacking.h: Rather than separate functions to get the two scrolling
node IDs, having one scrollingNodeIDForRole() makes calling code cleaner.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::updateCompositingLayers):  call reattachSubframeScrollLayers()
after a compositing tree update.
(WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer): Deals with the various configurations
in which we can do async scrolling of sticky elements.
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer):
(WebCore::useCoordinatedScrollingForLayer):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::requiresCompositingForScrolling): Moved.
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): This is a bug fix;
we only need to notify child frames, not all descendant frames.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::enclosingScrollingNodeID):
(WebCore::scrollCoordinatedAncestorInParentOfFrame):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayer):
(WebCore::isStickyInAcceleratedScrollingLayerOrViewport): Deleted.
(WebCore::isViewportConstrainedFixedOrStickyLayer): Deleted.
(WebCore::isMainFrameScrollingOrOverflowScrolling): Deleted.
(WebCore::nearestScrollCoordinatedAncestor): Deleted.
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::setSelection): Added comment.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setScrollingTreeIncludesFrames):
* testing/InternalSettings.h: Removed some useless parameter names.
* testing/InternalSettings.idl: Added setScrollingTreeIncludesFrames() setting.

Source/WebKit2:
Override coordinatesScrollingForFrameView() to always return true for composited
frames, for iOS WK2 (eventually this class will have to be specialized for iOS and OS X).

* WebProcess/Scrolling/RemoteScrollingCoordinator.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):

LayoutTests:
Tests that dump the scrolling tree with subframes.

* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html: Added.

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

5 years agoGive callbacks real status codes
andersca@apple.com [Tue, 10 Jun 2014 00:26:48 +0000 (00:26 +0000)]
Give callbacks real status codes
https://bugs.webkit.org/show_bug.cgi?id=133668

Reviewed by Dan Bernstein.

This makes it possible to know whether a callback was invalidated due to the webpage being closed,
or whether it was due the a web process crash.

* UIProcess/GenericCallback.h:
(WebKit::GenericCallback::create):
(WebKit::GenericCallback::performCallbackWithReturnValue):
(WebKit::GenericCallback::invalidate):
(WebKit::invalidateCallbackMap):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h:

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

5 years agoImprove CSSPrimitiveValue::customCSSText for ARMv7
benjamin@webkit.org [Tue, 10 Jun 2014 00:22:23 +0000 (00:22 +0000)]
Improve CSSPrimitiveValue::customCSSText for ARMv7
https://bugs.webkit.org/show_bug.cgi?id=133597

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-06-09
Reviewed by Andreas Kling.

Source/WebCore:
On imgur, some script is updating some layout on timers and on scroll.

It looks like CSSPrimitiveValue::customCSSText() is a little constrained
by the instruction cache on ARMv7. This patch improve the situation a bit.

First, the creation of the string itself is changed to go from two allocation to one.
Previously, we would allocate a StringBuffer and adopt it. Now we allocate a StringImpl
directly with the inline buffer.

The second issue is that the compiler was generating a real copy constructor for every
assignment of the "text" variable (likely because the variable span is so large).
This was solved by moving the string creating into a separate function (to fix the span)
and being careful with passing PassRef<StringImpl> around.

Then there was the problem that the compiler was a little too aggressive with inlining
which caused each "case" to repeat the same prologue and epilogue before formatValue().
This was solved by adding formatNumberValue() with NEVER_INLINE to have the prologue/epilogue
in a single place.

On older device, that's about 3% improvement on style access. On modern ARM64/x86_64
there is no noticeable difference.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue):
(WebCore::CSSPrimitiveValue::formatNumberForcustomCSSText):
(WebCore::CSSPrimitiveValue::customCSSText):
(WebCore::formatNumber): Deleted.
* css/CSSPrimitiveValue.h:

Source/WTF:
* wtf/RefPtr.h:
(WTF::RefPtr<T>::RefPtr):
* wtf/text/WTFString.h:
(WTF::String::String):

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

5 years ago[iOS WebGL] Fix EXT_shader_texture_lod.
commit-queue@webkit.org [Mon, 9 Jun 2014 23:32:31 +0000 (23:32 +0000)]
[iOS WebGL] Fix EXT_shader_texture_lod.
https://bugs.webkit.org/show_bug.cgi?id=133633

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

Covered by the Khronos test (and in LayoutTests):
conformance/extensions/ext-shader-texture-lod.html

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
Added shader texture lod name to match value from glGetString(GL_EXTENSIONS) on iOS.

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

5 years agoDocument::updateStyleIfNeededForNode can get very expensive
benjamin@webkit.org [Mon, 9 Jun 2014 23:29:57 +0000 (23:29 +0000)]
Document::updateStyleIfNeededForNode can get very expensive
https://bugs.webkit.org/show_bug.cgi?id=133599

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-06-09
Reviewed by Andreas Kling.

When pages are querying their style, we first run through
Document::updateStyleIfNeededForNode() to find if that particular node needs style recalc.

The problem was that updateStyleIfNeededForNode() could get really expensive. For each node,
it needs to check the whole parent chain to find if any needs style recalc.
When web pages get a bunch of nodes and querying their style, we ended up going over a lot
of nodes just to find there is nothing to do.

This patch adds two tweaks to reduce the problem:
First, before querying nodeOrItsAncestorNeedsStyleRecalc() we check if the Document is dirty at all.
The other part is making nodeOrItsAncestorNeedsStyleRecalc() faster by removing useless elements check.

* dom/Document.cpp:
(WebCore::nodeOrItsAncestorNeedsStyleRecalc):
(WebCore::Document::updateStyleIfNeededForNode):

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

5 years agoiOS WebKit: Crash in charactersAroundPosition.
enrica@apple.com [Mon, 9 Jun 2014 23:20:11 +0000 (23:20 +0000)]
iOS WebKit: Crash in charactersAroundPosition.
https://bugs.webkit.org/show_bug.cgi?id=133659
<rdar://problem/17220870>

Reviewed by Benjamin Poulain.

Source/WebCore:
Ensure that we stay within the vector boundaries
when returning the characters around the position.

* editing/VisibleUnits.cpp:
(WebCore::charactersAroundPosition):

Source/WebKit2:
We only need to compute charactersAroundPosition when we are in
editable content.

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

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

5 years ago[iOS] Expose _WKWebViewPrintFormatter and -_webView:printFrame: as SPI
aestes@apple.com [Mon, 9 Jun 2014 23:12:30 +0000 (23:12 +0000)]
[iOS] Expose _WKWebViewPrintFormatter and -_webView:printFrame: as SPI
https://bugs.webkit.org/show_bug.cgi?id=133600

Reviewed by David Kilzer.

Expose -_webView:printFrame: in WKUIDelegatePrivate so that clients can implement support for window.print().
Since window.print() can be called from a subframe, expose _WKWebViewPrintFormatter (renamed from
WKWebViewPrintFormatter to reflect its new SPI status) as SPI and add a frameToPrint property.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Forward-declared _WKFrameHandle and declared -_webView:printFrame:.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _webViewPrintFormatter]): Added to get a _WKWebViewPrintFormatter.
(-[WKWebView _printFormatterClass]): Updated the class name to _WKWebViewPrintFormatter.
(-[WKWebView _computePageCountAndStartDrawingToPDFForFrame:printInfo:WebKit::firstPage:computedTotalScaleFactor:]):
Added a frame argument. If frame is nil, print the main frame.
(-[WKWebView _computePageCountAndStartDrawingToPDFWithPrintInfo:WebKit::firstPage:computedTotalScaleFactor:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h: Forward-declared _WKFrameHandle; removed an unneccessary
forward-declaration of WKWebViewPrintFormatter.
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Added a _webViewPrintFormatter property.
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::printFrame): Called -_webView:printFrame:.
* UIProcess/_WKWebViewPrintFormatter.h: Renamed from Source/WebKit2/UIProcess/WKWebViewPrintFormatter.h.
* UIProcess/_WKWebViewPrintFormatter.mm: Renamed from Source/WebKit2/UIProcess/WKWebViewPrintFormatter.mm.
* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoProperly reset UStringSearch object in SearchBuffer constructor.
ap@apple.com [Mon, 9 Jun 2014 22:59:05 +0000 (22:59 +0000)]
Properly reset UStringSearch object in SearchBuffer constructor.
https://bugs.webkit.org/show_bug.cgi?id=133662
<rdar://problem/17240136>

Reviewed by Tim Horton.

* editing/TextIterator.cpp: (WebCore::SearchBuffer::~SearchBuffer):

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

5 years agoAutomatic text track selection can select more than one track
eric.carlson@apple.com [Mon, 9 Jun 2014 22:56:41 +0000 (22:56 +0000)]
text track selection can select more than one track
https://bugs.webkit.org/show_bug.cgi?id=133590

Reviewed by Brent Fulgham.

Source/WebCore:
Test: media/video-trackmenu-selection.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::configureTextTrack): Consider the currently selected
    track, if any.

* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Drive-by change
    to make sure no non-visible text tracks are included in the track menu.

LayoutTests:
* media/video-trackmenu-selection-expected.txt: Added.
* media/video-trackmenu-selection.html: Added.

* platform/efl/TestExpectations: New test skipped.

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

5 years agoFlash video controls hit-test incorrectly after changing topContentInset
bdakin@apple.com [Mon, 9 Jun 2014 22:30:48 +0000 (22:30 +0000)]
Flash video controls hit-test incorrectly after changing topContentInset
https://bugs.webkit.org/show_bug.cgi?id=133658
-and corresponding-
<rdar://problem/16978590>

Reviewed by Anders Carlsson.

When the topContent changes, the PluginView needs to be informed.

New function PluginView::topContentInsetDidChange() calls viewGeometryDidChange().
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::topContentInsetDidChange):
* WebProcess/Plugins/PluginView.h:

Call topContentInsetDidChange() after setting an inset only if it is a new inset.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setTopContentInset):

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

5 years ago[Mac] Hang when painting media before compositing mode activated
jer.noble@apple.com [Mon, 9 Jun 2014 21:48:52 +0000 (21:48 +0000)]
[Mac] Hang when painting media before compositing mode activated
https://bugs.webkit.org/show_bug.cgi?id=133655

Reviewed by Eric Carlson.

When asked to paint(), MediaPlayerPrivateAVFoundationObjC should not create an image generator
or a video output. These operations are synchronous, and will block the drawing thread and cause
a spin. paint() as opposed to paintImageInContext() is only called when painting the layer tree
and MediaPlayerPrivateAVFoundationObjC will paint by creating a AVPlayerLayer, not by painting
frames directly into the tree.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paint):

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

5 years agoAnother attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset...
dbates@webkit.org [Mon, 9 Jun 2014 21:45:02 +0000 (21:45 +0000)]
Another attempt to fix the EFL and GTK builds after <trac.webkit.org/changeset/169711>
(https://bugs.webkit.org/show_bug.cgi?id=133657)

Substitute WKErrorRef.h for WKError.h.

* UIProcess/API/efl/ewk_error.cpp:
* WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
* WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:

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

5 years ago[Mac][MSE] Exception thrown from ~MediaPlayerPrivateMediaSourceAVFObjC().
jer.noble@apple.com [Mon, 9 Jun 2014 21:32:12 +0000 (21:32 +0000)]
[Mac][MSE] Exception thrown from ~MediaPlayerPrivateMediaSourceAVFObjC().
https://bugs.webkit.org/show_bug.cgi?id=133656

Reviewed by Eric Carlson.

AVSampleBufferRenderSynchronizer can't handle being passed a NULL observer, so only attempt
to remove the time jumped or duration observer if one was actually created.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):

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

5 years agoAttempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711>
dbates@webkit.org [Mon, 9 Jun 2014 21:23:28 +0000 (21:23 +0000)]
Attempt to fix the EFL and GTK builds after <trac.webkit.org/changeset/169711>
(https://bugs.webkit.org/show_bug.cgi?id=133657)

Rename Shared/API/c/WKError.cpp to Shared/API/c/WKErrorRef.cpp.

* CMakeLists.txt:

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

5 years agoSubpixel rendering: Pixelsnapping empty rounded rect results in NaN radii width/height.
zalan@apple.com [Mon, 9 Jun 2014 21:19:17 +0000 (21:19 +0000)]
Subpixel rendering: Pixelsnapping empty rounded rect results in NaN radii width/height.
https://bugs.webkit.org/show_bug.cgi?id=133654

Reviewed by Simon Fraser.

Empty rounded rects don't need snapping.

Not testable.

* platform/graphics/RoundedRect.cpp:
(WebCore::RoundedRect::pixelSnappedRoundedRectForPainting):

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

5 years agoREGRESSION: missing underline under CJK text
mmaxfield@apple.com [Mon, 9 Jun 2014 21:18:07 +0000 (21:18 +0000)]
REGRESSION: missing underline under CJK text
https://bugs.webkit.org/show_bug.cgi?id=128145

Reviewed by Darin Adler.

Source/WebCore:
This patch refactors the GlyphToPathTranslator which is used to find intersections of
glyphs and underlines. It was modified to allow for querying these pieces of
information:
1) The extents of the glyph. This can be used to make the underlines skip an entire
glyph, wholesale
2) What kind of skipping behavior should be used
3) The Path which represents the glyph
There are three skipping behaviors:
1) (SkipDescenders) The previous behavior
2) (SkipGlyph) Make the underline skip over the entire glyph, using the extents() function
3) (DrawOverGlyph) Make the underline plow through the glyph, ignoring any descenders

Calculating which underlining behavior to use depends on what the base codepoint that
originated that glyph is. This means that we have to map from glyphs to characters,
something which is nontrivial to do. In order to solve this problem, this patch adds
an optional vector to GlyphBuffer which represents the location in the original string
from which a particular glyph originated. Then, when our WidthIterator code adds
glyphs to the GlyphBuffer, we can include the extra information about where we are
in the input string. Once this data is available, the GlyphPathTranslator can look up
the base codepoint from which this glyph originates, and can run ICU functions on that
codepoint.

We can use the ICU ublock_getCode() function to find which Unicode block a particular
codepoint comes from. If the codepoint comes from a CJK block, we will use
DrawOverGlyph; otherwise, we will use SkipDescenders.

Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-cjk.html

* platform/graphics/Font.cpp:
(WebCore::sharedUnderlineType): Look up the base codepoint from which this glyph
originates, call ublock_getCode to get its Unicode block, then return
a GlyphUnderlineType accordingly. This code is shared between SVG and non-SVG.
* platform/graphics/Font.h: New virtual functions in GlyphToPathTranslator, as well as
function signatures for the above two functions.
* platform/graphics/GlyphBuffer.h: Add an optional instance member for the location
from within the original string from which a particular glyph originates.
(WebCore::GlyphBuffer::clear): Updated for new member.
(WebCore::GlyphBuffer::add): Ditto.
(WebCore::GlyphBuffer::saveOffsetsInString): Opt-in to using the new variable
(WebCore::GlyphBuffer::offsetInString): New variable accessor.
* platform/graphics/TextRun.h: SVG needs the TextRun to use sharedUnderlineType.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal): Use GlyphBuffer's new variable (if present).
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::advance): Use GlyphBuffer's new variable (if present).
* platform/graphics/mac/FontMac.mm: Implement new GlyphToPathTranslator functions.
(WebCore::MacGlyphToPathTranslator::path):
(WebCore::MacGlyphToPathTranslator::extents):
(WebCore::MacGlyphToPathTranslator::underlineType): Calls sharedUnderlineType().
(WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph):
(WebCore::MacGlyphToPathTranslator::increment):
(WebCore::Font::dashesForIntersectionsWithRect): Ask the translator what kind of underline
behavior should be used. React accordingly.
(WebCore::MacGlyphToPathTranslator::nextPath): Deleted.
(WebCore::MacGlyphToPathTranslator::incrementIndex): Deleted.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::shapeAndPlaceItem): Update to new signature of GlyphBuffer::add()
* rendering/svg/SVGTextRunRenderingContext.cpp: Implement new GlyphToPathTranslator functions.
(WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator):
(WebCore::SVGGlyphToPathTranslator::getCurrentTransform):
(WebCore::SVGGlyphToPathTranslator::path):
(WebCore::SVGGlyphToPathTranslator::extents):
(WebCore::MacGlyphToPathTranslator::underlineType): Calls sharedUnderlineType().
(WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph):
(WebCore::SVGGlyphToPathTranslator::increment):
(WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
(WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
(WebCore::SVGGlyphToPathTranslator::nextPath): Deleted.
(WebCore::SVGGlyphToPathTranslator::incrementIndex): Deleted.
* rendering/svg/SVGTextRunRenderingContext.h: SVG needs the TextRun to use sharedUnderlineType.

LayoutTests:
This test makes sure that underlines under CJK text don't skip over descenders.

* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-cjk-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-cjk.html: Added.

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

5 years ago[iOS WebGL] Implement OES_vertex_array_object for iOS.
commit-queue@webkit.org [Mon, 9 Jun 2014 21:09:09 +0000 (21:09 +0000)]
[iOS WebGL] Implement OES_vertex_array_object for iOS.
https://bugs.webkit.org/show_bug.cgi?id=133629

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

Covered by the Khronos test (and in LayoutTests):
conformance/extensions/oes-vertex-array-object.html

* platform/graphics/ios/GraphicsContext3DIOS.h:
Added OpenGL vertex array function renaming for iOS adding the OES suffix.
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::createVertexArrayOES):
(WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
(WebCore::Extensions3DOpenGL::isVertexArrayOES):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES):
Added isVertexArrayObjectSupported and support for iOS.
(WebCore::Extensions3DOpenGL::supportsExtension):
Added iOS name for GL_OES_vertex_array_object extension.
* platform/graphics/opengl/Extensions3DOpenGL.h:
Added isVertexArrayObjectSupported for iOS.

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

5 years ago[Mac] caption size is not update immediately when system preferences change
eric.carlson@apple.com [Mon, 9 Jun 2014 21:03:22 +0000 (21:03 +0000)]
[Mac] caption size is not update immediately when system preferences change
https://bugs.webkit.org/show_bug.cgi?id=133598

Reviewed by Brent Fulgham.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::updateCaptionDisplaySizes): New.
* Modules/mediacontrols/MediaControlsHost.h:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::captionPreferencesChanged): Tell the controls host to update sizes.

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