WebKit-https.git
6 years ago[GTK] Fix some simple gtkdoc warnings for WebKit1
mrobinson@webkit.org [Tue, 4 Mar 2014 07:36:02 +0000 (07:36 +0000)]
[GTK] Fix some simple gtkdoc warnings for WebKit1
https://bugs.webkit.org/show_bug.cgi?id=129659

Reviewed by Carlos Garcia Campos.

* docs/webkitgtk-sections.txt: Make public some enum documentation that is used
in public APIs.
* webkit/webkitwebview.cpp: Fix typos and add documentation for enums previously
marked as private.
(webkit_web_view_class_init):
* webkit/webkitwebview.h: Ditto.

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

6 years agoFix the GTK+ CMake build
mrobinson@webkit.org [Tue, 4 Mar 2014 07:35:38 +0000 (07:35 +0000)]
Fix the GTK+ CMake build

* PlatformGTK.cmake: Add a missing file to the source list.

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

6 years agoWeb Inspector: Avoid too early deref caused by RemoteInspectorXPCConnection::close
commit-queue@webkit.org [Tue, 4 Mar 2014 06:57:59 +0000 (06:57 +0000)]
Web Inspector: Avoid too early deref caused by RemoteInspectorXPCConnection::close
https://bugs.webkit.org/show_bug.cgi?id=129631

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

Avoid deref() too early if a client calls close(). The xpc_connection_close
will cause another XPC_ERROR event to come in from the queue, deref then.
Likewise, protect multithreaded access to m_client. If a client calls
close() we want to immediately clear the pointer to prevent calls to it.

Overall the multi-threading aspects of RemoteInspectorXPCConnection are
growing too complicated for probably little benefit. We may want to
clean this up later.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::xpcConnectionFailed):
* inspector/remote/RemoteInspectorXPCConnection.h:
* inspector/remote/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::RemoteInspectorXPCConnection):
(Inspector::RemoteInspectorXPCConnection::close):
(Inspector::RemoteInspectorXPCConnection::closeOnQueue):
(Inspector::RemoteInspectorXPCConnection::deserializeMessage):
(Inspector::RemoteInspectorXPCConnection::handleEvent):
(Inspector::RemoteInspectorXPCConnection::sendMessage):

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

6 years agoWeb Inspector: Match color of regex in source view with a popover
commit-queue@webkit.org [Tue, 4 Mar 2014 06:52:56 +0000 (06:52 +0000)]
Web Inspector: Match color of regex in source view with a popover
https://bugs.webkit.org/show_bug.cgi?id=129645

Patch by Jonathan Wells <jonowells@apple.com> on 2014-03-03
Reviewed by Timothy Hatcher.

* UserInterface/Views/LogContentView.css:
(.console-formatted-string):
(.console-formatted-regexp):

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

6 years agoAbstractMacroAssembler::CachedTempRegister should start out invalid
msaboff@apple.com [Tue, 4 Mar 2014 06:38:09 +0000 (06:38 +0000)]
AbstractMacroAssembler::CachedTempRegister should start out invalid
https://bugs.webkit.org/show_bug.cgi?id=129657

Reviewed by Filip Pizlo.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::AbstractMacroAssembler):
- Invalidate all cached registers in constructor as we don't know the
  contents of any register at the entry to the code we are going to
  generate.

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

6 years ago:active style is not cleared when its display property is set to none before mouse...
commit-queue@webkit.org [Tue, 4 Mar 2014 06:37:43 +0000 (06:37 +0000)]
:active style is not cleared when its display property is set to none before mouse released.
https://bugs.webkit.org/show_bug.cgi?id=129465

Patch by Sanghyup Lee <sh53.lee@samsung.com> on 2014-03-03
Reviewed by Antonio Gomes.

Source/WebCore:

We currently clearing the :active style when element has a renderer.
This patch makes elements clear its active style regardless of renderer.

* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):

LayoutTests:

* fast/css/active-display-none-expected.txt: Added.
* fast/css/active-display-none.html: Added.

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

6 years agoStructureOrOffset should be fastmalloced.
akling@apple.com [Tue, 4 Mar 2014 04:21:39 +0000 (04:21 +0000)]
StructureOrOffset should be fastmalloced.
<https://webkit.org/b/129640>

Reviewed by Geoffrey Garen.

* runtime/StructureIDTable.h:

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

6 years agoUse DYEBench v0.9 by default.
rniwa@webkit.org [Tue, 4 Mar 2014 04:11:17 +0000 (04:11 +0000)]
Use DYEBench v0.9 by default.

Rubber-stamped by Benjamin Poulain.

* perf/DoYouEvenBench/index.html:

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

6 years ago[iOS][WK2] WebPage::updateVisibleContentRects can set the position directly instead...
benjamin@webkit.org [Tue, 4 Mar 2014 03:24:32 +0000 (03:24 +0000)]
[iOS][WK2] WebPage::updateVisibleContentRects can set the position directly instead of using programmatic scrolling
https://bugs.webkit.org/show_bug.cgi?id=129649

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

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
Update my workaround from r165003. We should not use programmatic scrolling when the scroll position is changed
from the UI.

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

6 years ago[iOS][WK2] Update UIScrollView's contentSize when a new layer tree is committed
benjamin@webkit.org [Tue, 4 Mar 2014 03:23:58 +0000 (03:23 +0000)]
[iOS][WK2] Update UIScrollView's contentSize when a new layer tree is committed
https://bugs.webkit.org/show_bug.cgi?id=129641

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

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:WebKit::]):
Previously, we relied on [UIScrollView setZoomScale:] to reset the contentSize for us.
In the cases where we would not go through [UIScrollView setZoomScale:], the UIScrollView's contentSize
did not match the actual WKContentView's area on screen.

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

6 years agoRemove 2 unnecessary includes from JSDOMBinding.h
akling@apple.com [Tue, 4 Mar 2014 02:22:13 +0000 (02:22 +0000)]
Remove 2 unnecessary includes from JSDOMBinding.h
<https://webkit.org/b/129619>

Reviewed by Antti Koivisto.

* bindings/js/JSDOMBinding.h:

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

6 years agoGraphicsContext::drawLineForText needs to be exported from WebCore.dylib for iOS...
mmaxfield@apple.com [Tue, 4 Mar 2014 02:00:02 +0000 (02:00 +0000)]
GraphicsContext::drawLineForText needs to be exported from WebCore.dylib for iOS builds
https://bugs.webkit.org/show_bug.cgi?id=129647

Reviewed by NOBODY (This is a build fix).

Fixing after r165025 and r165016.

No new tests as this is a build fix.

* WebCore.exp.in:

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

6 years ago[iOS] Start playback button misplaced
jer.noble@apple.com [Tue, 4 Mar 2014 01:53:38 +0000 (01:53 +0000)]
[iOS] Start playback button misplaced
https://bugs.webkit.org/show_bug.cgi?id=129628

Reviewed by Simon Fraser.

On YouTube embeds, while the video is loading it is placed into the DOM with a 0x0 size.
This causes the start playback button to be visible in the upper-left corner of the embed
area. The button wasn't visible previously (in plugin mode) because the plugin clipped its
drawing to its bounds, and so the <video> shadow should do the same.

* Modules/mediacontrols/mediaControlsiOS.css:
(::-webkit-media-controls):

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

6 years agoBuild fix for iOS simulator.
enrica@apple.com [Tue, 4 Mar 2014 01:45:32 +0000 (01:45 +0000)]
Build fix for iOS simulator.

* WebCore.exp.in:

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

6 years agoForward application suspend resume notifications to the web process.
commit-queue@webkit.org [Tue, 4 Mar 2014 01:29:41 +0000 (01:29 +0000)]
Forward application suspend resume notifications to the web process.
https://bugs.webkit.org/show_bug.cgi?id=129356

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-03-03
Reviewed by Eric Carlson.

Source/WebCore:

* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper initWithCallback:]):
Observe UIApplicationDidBecomeActiveNotification,
WebUIApplicationDidBecomeActiveNotification,
WebUIApplicationWillEnterForegroundNotification, and
WebUIApplicationWillResignActiveNotification

(-[WebMediaSessionHelper applicationDidBecomeActive:]):
Resume session.

Source/WebKit2:

Repost UIApplicationWillEnterForegroundNotification,
UIApplicationDidBecomeActiveNotification and
UIApplicationWillResignActiveNotification from UIProcess to WebProcess.
As WebUIApplicationWillEnterForegroundNotification,
WebUIApplicationDidBecomeActiveNotification, and
WebUIApplicationWillResignActiveNotification

* UIProcess/WebPageProxy.h:
Add applicationWillEnterForeground()
applicationWillResignActive()
applicationDidBecomeActive()

* UIProcess/ios/WKContentView.mm:
(-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::]):
Observe notifications.

(-[WKContentView dealloc]):
Stop observing notifications.

(-[WKContentView _applicationWillResignActive:]):
Notify WebPageProxy of the event.

(-[WKContentView _applicationWillEnterForeground:]):
Notify WebPageProxy of the event.

(-[WKContentView _applicationDidBecomeActive:]):
Notify WebPageProxy of the event.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationWillEnterForeground):
Send corresponding Message to WebPage.

(WebKit::WebPageProxy::applicationWillResignActive):
Send corresponding Message to WebPage.

(WebKit::WebPageProxy::applicationDidBecomeActive):
Send corresponding Message to WebPage.

* WebProcess/WebPage/WebPage.h:
Add applicationWillEnterForeground()
applicationWillResignActive()
applicationDidBecomeActive()

* WebProcess/WebPage/WebPage.messages.in:
Add applicationWillEnterForeground()
applicationWillResignActive()
applicationDidBecomeActive()

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationWillResignActive):
Post corresponding NSNotification.

(WebKit::WebPage::applicationWillEnterForeground):
Post corresponding NSNotification.

(WebKit::WebPage::applicationDidBecomeActive):
Post corresponding NSNotification.

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

6 years agoUnreviewed, rolling out r165013.
commit-queue@webkit.org [Tue, 4 Mar 2014 01:22:01 +0000 (01:22 +0000)]
Unreviewed, rolling out r165013.
http://trac.webkit.org/changeset/165013
https://bugs.webkit.org/show_bug.cgi?id=129646

New code is not thread safe, asserting on a worker test
(Requested by ap on #webkit).

Source/WebCore:

* WebCore.exp.in:
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::createDeletionUI):
* html/DOMURL.cpp:
(WebCore::DOMURL::revokeObjectURL):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource):
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::replayXHR):
* loader/DocumentLoader.cpp:
(WebCore::areAllLoadersPageCacheAcceptable):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::CachedFont):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::CachedRawResource):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::~CachedResource):
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::CachedSVGDocument):
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::CachedScript):
* loader/cache/CachedScript.h:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::CachedTextTrack):
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForURL):
(WebCore::MemoryCache::resourceForRequest):
(WebCore::MemoryCache::addImageToCache):
(WebCore::MemoryCache::removeImageFromCache):
(WebCore::MemoryCache::evict):
(WebCore::MemoryCache::removeResourcesWithOrigin):
(WebCore::MemoryCache::getOriginsWithCache):
(WebCore::MemoryCache::removeUrlFromCache):
(WebCore::MemoryCache::removeRequestFromCache):
(WebCore::MemoryCache::removeRequestFromCacheImpl):
(WebCore::MemoryCache::crossThreadRemoveRequestFromCache):
(WebCore::MemoryCache::getStatistics):
(WebCore::MemoryCache::setDisabled):
* loader/cache/MemoryCache.h:
* platform/CrossThreadCopier.cpp:
* platform/CrossThreadCopier.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot):
* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Source/WebKit2:

* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/mac/DiskCacheMonitor.h:
* NetworkProcess/mac/DiskCacheMonitor.mm:
(WebKit::DiskCacheMonitor::DiskCacheMonitor):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didCacheResource):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:

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

6 years agoWeb Inspector: Better Debugger popovers for RegExp values
commit-queue@webkit.org [Tue, 4 Mar 2014 01:20:54 +0000 (01:20 +0000)]
Web Inspector: Better Debugger popovers for RegExp values
https://bugs.webkit.org/show_bug.cgi?id=129633

Patch by Jonathan Wells <jonowells@apple.com> on 2014-03-03
Reviewed by Timothy Hatcher.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForRegExp):

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

6 years agoFix the iOS Simulator build.
weinig@apple.com [Tue, 4 Mar 2014 01:20:31 +0000 (01:20 +0000)]
Fix the iOS Simulator build.

* WebCore.exp.in:

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

6 years ago[iOS WebKit2]: Text fields don't zoom in when focused
enrica@apple.com [Tue, 4 Mar 2014 01:00:00 +0000 (01:00 +0000)]
[iOS WebKit2]: Text fields don't zoom in when focused
https://bugs.webkit.org/show_bug.cgi?id=129632
<rdar://problem/16185230>

Reviewed by Benjamin Poulain.

When focusing the node we need to zoom and center it and possibly
scroll to make it visible.
On iPad we only scroll, without zooming.

* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
(WebKit::AssistedNodeInformation::AssistedNodeInformation):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _scrollToRect:withOrigin:minimumScrollDistance:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView _startAssistingNode:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

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

6 years agoCrash in JIT code while watching a video @ storyboard.tumblr.com
msaboff@apple.com [Tue, 4 Mar 2014 00:49:19 +0000 (00:49 +0000)]
Crash in JIT code while watching a video @ storyboard.tumblr.com
https://bugs.webkit.org/show_bug.cgi?id=129635

Reviewed by Filip Pizlo.

Clear m_set before we set bits in the TempRegisterSet(const RegisterSet& other)
construtor.

* jit/TempRegisterSet.cpp:
(JSC::TempRegisterSet::TempRegisterSet): Clear map before setting it.
* jit/TempRegisterSet.h:
(JSC::TempRegisterSet::TempRegisterSet): Use new clearAll() helper.
(JSC::TempRegisterSet::clearAll): New private helper.

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

6 years agoFix ASSERT and leaks introduced in recent "Support IOS Accessibility in WK2" patch
weinig@apple.com [Tue, 4 Mar 2014 00:44:02 +0000 (00:44 +0000)]
Fix ASSERT and leaks introduced in recent "Support IOS Accessibility in WK2" patch

Reviewed by Simon Fraser.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformInitializeAccessibility):

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

6 years agoDon't try to parse legacy CSS gradients -- we don't support them.
timothy@apple.com [Tue, 4 Mar 2014 00:08:37 +0000 (00:08 +0000)]
Don't try to parse legacy CSS gradients -- we don't support them.

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

Reviewed by Joseph Pecoraro.

* UserInterface/Models/Gradient.js:
(WebInspector.Gradient.stopsWithComponents): Fix a possible exception on malformed stops.
(WebInspector.LinearGradient.linearGradientWithComponents): Return early for legacy gradients.

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

6 years agoSpace between double underlines does not scale with font size
mmaxfield@apple.com [Mon, 3 Mar 2014 23:49:27 +0000 (23:49 +0000)]
Space between double underlines does not scale with font size
https://bugs.webkit.org/show_bug.cgi?id=129521

Reviewed by Simon Fraser.

Source/WebCore:

This patch moves the logic about how far to draw the second underline (when text-decoration-style: double
is specified) from InlineTextBox to GraphicsContext, because GraphicsContext is the authoritative source
about how thick underlines should be. The space between the two underlines is set to the thickness of
each of the underlines.

This patch also deletes some unused code in InlineTextBox that was never getting triggered, in addition
to unifying drawLineForText with drawLinesForText. This didn't have any performance impact in my testing.

Test: fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales.html

* platform/graphics/GraphicsContext.h: drawLineForText takes a boolean for if we should draw double
underlines.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLineForText):
(WebCore::GraphicsContext::drawLinesForText):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawLineForText):
* platform/graphics/wince/GraphicsContextWinCE.cpp:
(WebCore::GraphicsContext::drawLineForText):
* rendering/InlineTextBox.cpp: Use new boolean argument
(WebCore::drawSkipInkUnderline):
(WebCore::InlineTextBox::paintDecoration):

LayoutTests:

This test renders large text with a double underline, but then barely clips off the bottom underline
using overflow: hidden. It makes sure that this is exactly the same as a single underline. If the
space between the two underlines does not scale with font size, it will appear as though there is a
single thick underline (because they will be drawn on top of each other) and will thus fail this test.

* fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales.html: Added.

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

6 years agoComposited masks not working on iOS after r164890
simon.fraser@apple.com [Mon, 3 Mar 2014 23:36:20 +0000 (23:36 +0000)]
Composited masks not working on iOS after r164890
https://bugs.webkit.org/show_bug.cgi?id=129630

Reviewed by Jer Noble.

Fix typo in UIView-related masks code; set the mask layer
on the view, not the maskView.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):

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

6 years agoAX: Support IOS Accessibility in WK2
cfleizach@apple.com [Mon, 3 Mar 2014 23:30:09 +0000 (23:30 +0000)]
AX: Support IOS Accessibility in WK2
https://bugs.webkit.org/show_bug.cgi?id=129527

Reviewed by Sam Weinig.

Source/WebCore:

Update the iOS wrapper so that it can convert points to screen space in WebKit2.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):

Source/WebKit2:

Implement enough AX hooks so that accessibility can work in WebKit2.

* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.cpp:
(IPC::Connection::identifier):
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::accessibilityWebProcessTokenReceived):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _updateForScreen:]):
(-[WKContentView _setAccessibilityWebProcessToken:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _didRelaunchProcess]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
(WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.h: Added.
* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm: Added.
(-[WKAccessibilityWebPageObject init]):
(-[WKAccessibilityWebPageObject _accessibilityCategoryInstalled:]):
(-[WKAccessibilityWebPageObject pageScale]):
(-[WKAccessibilityWebPageObject dealloc]):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformInitialize):
(WebKit::WebPage::platformInitializeAccessibility):
(WebKit::WebPage::accessibilityObjectForMainFramePlugin):
(WebKit::WebPage::registerUIProcessAccessibilityTokens):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h: Copied from Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObject.h.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: Copied from Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm.
(-[WKAccessibilityWebPageObjectBase accessibilityFocusedUIElement]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.h: Added.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: Added.
(-[WKAccessibilityWebPageObject accessibilityIsIgnored]):
(-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityIsAttributeSettable:]):
(-[WKAccessibilityWebPageObject accessibilitySetValue:forAttribute:]):
(-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
(-[WKAccessibilityWebPageObject accessibilityActionNames]):
(-[WKAccessibilityWebPageObject accessibilityChildren]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
(-[WKAccessibilityWebPageObject accessibilityShouldUseUniqueId]):
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):
* WebProcess/WebPage/mac/WebPageMac.mm:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):

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

6 years agoAdd support for sessions to MemoryCache.
commit-queue@webkit.org [Mon, 3 Mar 2014 23:07:50 +0000 (23:07 +0000)]
Add support for sessions to MemoryCache.
https://bugs.webkit.org/show_bug.cgi?id=127794

Patch by Martin Hock <mhock@apple.com> on 2014-03-03
Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.exp.in:
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::createDeletionUI): Initialize CachedImage with sessionID.
* html/DOMURL.cpp:
(WebCore::DOMURL::revokeObjectURL): Remove URL from MemoryCache for all sessions.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource): Pass sessionID to MemoryCache.
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::replayXHR): Ditto.
* loader/DocumentLoader.cpp:
(WebCore::areAllLoadersPageCacheAcceptable): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads): Ditto.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement): Initialize CachedImage with sessionID.
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create): Pass sessionID to MemoryCache.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): Constructor takes sessionID.
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp: Ditto.
(WebCore::CachedFont::CachedFont):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp: Ditto.
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp: Ditto.
(WebCore::CachedRawResource::CachedRawResource):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp: Ditto.
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::~CachedResource): Pass sessionID to MemoryCache.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::sessionID):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource): Constructors take sessionID.
(WebCore::CachedResourceLoader::sessionID): Retrieve sessionID from page.
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Pass sessionID to MemoryCache.
(WebCore::CachedResourceLoader::requestResource): Initialize CachedCSSStyleSheet with sessionID.
(WebCore::CachedResourceLoader::revalidateResource): Initialize cached resource with sessionID.
(WebCore::CachedResourceLoader::loadResource): Pass sessionID to MemoryCache and initialize cached resource with sessionID.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGDocument.cpp: Constructor takes sessionID.
(WebCore::CachedSVGDocument::CachedSVGDocument):
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedScript.cpp: Ditto.
(WebCore::CachedScript::CachedScript):
* loader/cache/CachedScript.h:
* loader/cache/CachedTextTrack.cpp: Ditto.
(WebCore::CachedTextTrack::CachedTextTrack):
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.cpp: Ditto.
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::getSessionMap): Retrieve CachedResourceMap based on sessionID.
(WebCore::MemoryCache::add): Use sessionID from CachedResource parameter.
(WebCore::MemoryCache::revalidationSucceeded): Add sessionID parameter.
(WebCore::MemoryCache::resourceForURL): Ditto.
(WebCore::MemoryCache::resourceForRequest): Ditto, also move impl into impl method.
(WebCore::MemoryCache::resourceForRequestImpl): Add CachedResourceMap parameter.
(WebCore::MemoryCache::addImageToCache): Use default sessionID.
(WebCore::MemoryCache::removeImageFromCache): Ditto.
(WebCore::MemoryCache::evict): Use sessionID from CachedResource parameter.
(WebCore::MemoryCache::removeResourcesWithOrigin): Iterate through all CachedResourceMaps.
(WebCore::MemoryCache::getOriginsWithCache): Ditto.
(WebCore::MemoryCache::removeUrlFromCache): Add sessionID parameter.
(WebCore::MemoryCache::removeRequestFromCache): Ditto.
(WebCore::MemoryCache::removeRequestFromCacheImpl): Ditto.
(WebCore::MemoryCache::removeRequestFromSessionCaches): Iterate through all CachedResourceMaps.
(WebCore::MemoryCache::crossThreadRemoveRequestFromCache): Add sessionID parameter.
(WebCore::MemoryCache::getStatistics): Iterate through all CachedResourceMaps.
(WebCore::MemoryCache::setDisabled): Ditto.
* loader/cache/MemoryCache.h: Create another level for cache.
* platform/CrossThreadCopier.cpp: Allow copying SessionIDs across threads.
(WebCore::SessionID>::copy):
* platform/CrossThreadCopier.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest): Remove trailing whitespace.
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot): Initialize CachedImage with sessionID.
* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache): Pass sessionID to MemoryCache.

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Source/WebKit2:

* NetworkProcess/NetworkResourceLoader.h: Add sessionID() method.
(WebKit::NetworkResourceLoader::sessionID):
* NetworkProcess/mac/DiskCacheMonitor.h: Add sessionID member.
* NetworkProcess/mac/DiskCacheMonitor.mm:
(WebKit::DiskCacheMonitor::DiskCacheMonitor): Send sessionID to NetworkProcessConnection::DidCacheResource.
* WebProcess/Network/NetworkProcessConnection.cpp: Add sessionID parameter to didCacheResource and pass to MemoryCache.
(WebKit::NetworkProcessConnection::didCacheResource):
* WebProcess/Network/NetworkProcessConnection.h: Ditto.
* WebProcess/Network/NetworkProcessConnection.messages.in: Ditto.

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

6 years agoRemove an innocuous error message and support default views for Resource and Debugger...
timothy@apple.com [Mon, 3 Mar 2014 23:04:55 +0000 (23:04 +0000)]
Remove an innocuous error message and support default views for Resource and Debugger sidebars.

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

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView): Added.
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype.showDefaultContentView): Added.
(WebInspector.ResourceSidebarPanel.prototype.treeElementForRepresentedObject): Don't log an error
if the tree element isn't a Script. We try to find any represented object, and it can fail.

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

6 years agoAdd Jeremy Jones to the contributors list as a contributor.
simon.fraser@apple.com [Mon, 3 Mar 2014 22:42:28 +0000 (22:42 +0000)]
Add Jeremy Jones to the contributors list as a contributor.

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

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

6 years agoRemove unused DataView code from JSDOMBinding.h
akling@apple.com [Mon, 3 Mar 2014 22:34:35 +0000 (22:34 +0000)]
Remove unused DataView code from JSDOMBinding.h
<https://webkit.org/b/129616>

Reviewed by Antti Koivisto.

* bindings/js/JSDOMBinding.h:

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

6 years ago[x86] Improve code generation of byte test
benjamin@webkit.org [Mon, 3 Mar 2014 22:28:16 +0000 (22:28 +0000)]
[x86] Improve code generation of byte test
https://bugs.webkit.org/show_bug.cgi?id=129597

Reviewed by Geoffrey Garen.

When possible, test the 8 bit register to itself instead of comparing it
to a literal.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::test32):

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

6 years agoWeb Inspector: debugger statements do not break.
mark.lam@apple.com [Mon, 3 Mar 2014 22:12:10 +0000 (22:12 +0000)]
Web Inspector: debugger statements do not break.
<https://webkit.org/b/129524>

Reviewed by Geoff Garen.

Source/JavaScriptCore:

Since we no longer call op_debug hooks unless there is a debugger request
made on the CodeBlock, the op_debug for the debugger statement never gets
serviced.

With this fix, we check in the CodeBlock constructor if any debugger
statements are present.  If so, we set a m_hasDebuggerStatement flag that
causes the CodeBlock to show as having debugger requests.  Hence,
breaking at debugger statements is now restored.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::hasDebuggerRequests):
(JSC::CodeBlock::clearDebuggerRequests):

LayoutTests:

* inspector-protocol/debugger/debugger-statement-expected.txt: Added.
* inspector-protocol/debugger/debugger-statement.html: Added.
* inspector-protocol/debugger/resources/breakpoint.js:
(debuggerStatement):

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

6 years agoFix an exception caused by trying to access the DOM before it is loaded.
timothy@apple.com [Mon, 3 Mar 2014 21:52:31 +0000 (21:52 +0000)]
Fix an exception caused by trying to access the DOM before it is loaded.

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

Reviewed by Andreas Kling.

* UserInterface/Base/Main.js:
(WebInspector.loaded): Move global event listeners from here...
(WebInspector.contentLoaded): ... to here.

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

6 years agoAllow overflow-scroll to be one-finger scrolled until we hook up UIScrollViews
simon.fraser@apple.com [Mon, 3 Mar 2014 21:45:25 +0000 (21:45 +0000)]
Allow overflow-scroll to be one-finger scrolled until we hook up UIScrollViews
https://bugs.webkit.org/show_bug.cgi?id=129621

Reviewed by Benjamin Poulain.

Temporary change to allow overflow:scroll to be scrolled in iOS WK2.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hasAcceleratedTouchScrolling):

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

6 years agoASSERTION FAILED: m_numBreakpoints >= numBreakpoints when deleting breakpoints.
mark.lam@apple.com [Mon, 3 Mar 2014 21:39:21 +0000 (21:39 +0000)]
ASSERTION FAILED: m_numBreakpoints >= numBreakpoints when deleting breakpoints.
<https://webkit.org/b/129393>

Reviewed by Geoffrey Garen.

The issue manifests because the debugger will iterate all CodeBlocks in
the heap when setting / clearing breakpoints, but it is possible for a
CodeBlock to have been instantiate but is not yet registered with the
debugger.  This can happen because of the following:

1. DFG worklist compilation is still in progress, and the target
   codeBlock is not ready for installation in its executable yet.

2. DFG compilation failed and we have a codeBlock that will never be
   installed in its executable, and the codeBlock has not been cleaned
   up by the GC yet.

The code for installing the codeBlock in its executable is the same code
that registers it with the debugger.  Hence, these codeBlocks are not
registered with the debugger, and any pending breakpoints that would map
to that CodeBlock is as yet unset or will never be set.  As such, an
attempt to remove a breakpoint in that CodeBlock will fail that assertion.

To fix this, we do the following:

1. We'll eagerly clean up any zombie CodeBlocks due to failed DFG / FTL
   compilation.  This is achieved by providing a
   DeferredCompilationCallback::compilationDidComplete() that does this
   clean up, and have all sub classes call it at the end of their
   compilationDidComplete() methods.

2. Before the debugger or profiler iterates CodeBlocks in the heap, they
   will wait for all compilations to complete before proceeding.  This
   ensures that:
   1. any zombie CodeBlocks would have been cleaned up, and won't be
      seen by the debugger or profiler.
   2. all CodeBlocks that the debugger and profiler needs to operate on
      will be "ready" for whatever needs to be done to them e.g.
      jettison'ing of DFG codeBlocks.

* bytecode/DeferredCompilationCallback.cpp:
(JSC::DeferredCompilationCallback::compilationDidComplete):
* bytecode/DeferredCompilationCallback.h:
- Provide default implementation method to clean up zombie CodeBlocks.

* debugger/Debugger.cpp:
(JSC::Debugger::forEachCodeBlock):
- Utility function to iterate CodeBlocks.  It ensures that all compilations
  are complete before proceeding.
(JSC::Debugger::setSteppingMode):
(JSC::Debugger::toggleBreakpoint):
(JSC::Debugger::recompileAllJSFunctions):
(JSC::Debugger::clearBreakpoints):
(JSC::Debugger::clearDebuggerRequests):
- Use the utility iterator function.

* debugger/Debugger.h:
* dfg/DFGOperations.cpp:
- Added an assert to ensure that zombie CodeBlocks will be imminently cleaned up.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):
- Remove unneeded code (that was not the best solution anyway) for ensuring
  that we don't generate new DFG codeBlocks after enabling the debugger or
  profiler.  Now that we wait for compilations to complete before proceeding
  with debugger and profiler work, this scenario will never happen.

* dfg/DFGToFTLDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLDeferredCompilationCallback::compilationDidComplete):
- Call the super class method to clean up zombie codeBlocks.

* dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidComplete):
- Call the super class method to clean up zombie codeBlocks.

* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::remove):
* heap/CodeBlockSet.h:
* heap/Heap.h:
(JSC::Heap::removeCodeBlock):
- New method to remove a codeBlock from the codeBlock set.

* jit/JITOperations.cpp:
- Added an assert to ensure that zombie CodeBlocks will be imminently cleaned up.

* jit/JITToDFGDeferredCompilationCallback.cpp:
(JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete):
- Call the super class method to clean up zombie codeBlocks.

* runtime/VM.cpp:
(JSC::VM::waitForCompilationsToComplete):
- Renamed from prepareToDiscardCode() to be clearer about what it does.

(JSC::VM::discardAllCode):
(JSC::VM::releaseExecutableMemory):
(JSC::VM::setEnabledProfiler):
- Wait for compilation to complete before enabling the profiler.

* runtime/VM.h:

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

6 years agoInspector test dom/dom-search-crash.html times out in release builds
bburg@apple.com [Mon, 3 Mar 2014 21:33:17 +0000 (21:33 +0000)]
Inspector test dom/dom-search-crash.html times out in release builds
https://bugs.webkit.org/show_bug.cgi?id=129462

Reviewed by Timothy Hatcher.

This test passes now, so stop skipping it.

* TestExpectations:

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

6 years ago[iOS][WK2] Regression: ScrollView's scroll offset is never set after r164702
benjamin@webkit.org [Mon, 3 Mar 2014 21:32:21 +0000 (21:32 +0000)]
[iOS][WK2] Regression: ScrollView's scroll offset is never set after r164702
https://bugs.webkit.org/show_bug.cgi?id=129620

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-03-03
Reviewed by Simon Fraser.

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

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

6 years agoFind results on simple lines are not marked correctly
antti@apple.com [Mon, 3 Mar 2014 21:11:24 +0000 (21:11 +0000)]
Find results on simple lines are not marked correctly
https://bugs.webkit.org/show_bug.cgi?id=129586

Reviewed by Andreas Kling.

Source/WebCore:

Tests: editing/text-iterator/count-mark-lineboxes.html
       editing/text-iterator/count-mark-simple-lines.html

TextIterator operating on simple lines failed to take the end of the range into account.
This also causes performance issues on long documents as range traversals would miss the end
node and end up going through the entire document.

* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):

    Stop when hitting the range end on simple text nodes.

(WebCore::SimplifiedBackwardsTextIterator::handleTextNode):

    Use hasRenderedText test instead of linebox-only firstTextBox.

* testing/Internals.cpp:
(WebCore::Internals::countMatchesForText):
* testing/Internals.h:
* testing/Internals.idl:

    Add testing interface for counting and marking matches.

LayoutTests:

* editing/text-iterator/count-mark-lineboxes-expected.txt: Added.
* editing/text-iterator/count-mark-lineboxes.html: Added.
* editing/text-iterator/count-mark-simple-lines-expected.txt: Added.
* editing/text-iterator/count-mark-simple-lines.html: Added.

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

6 years agoSelectorQuery failing RightMostWithIdMatch are compiling their selectors for each...
benjamin@webkit.org [Mon, 3 Mar 2014 20:57:59 +0000 (20:57 +0000)]
SelectorQuery failing RightMostWithIdMatch are compiling their selectors for each execution
https://bugs.webkit.org/show_bug.cgi?id=129601

Reviewed by Andreas Kling.

This caused a regression after r164924 for documents in quirks mode. Since those always fail
selectorForIdLookup(), they ended up compiling the selector every time they were called.

* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::execute):

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

6 years ago[Mac] Crash in MediaPlayer::rateChanged()
jer.noble@apple.com [Mon, 3 Mar 2014 20:47:59 +0000 (20:47 +0000)]
[Mac] Crash in MediaPlayer::rateChanged()
https://bugs.webkit.org/show_bug.cgi?id=129548

Reviewed by Darin Adler.

WTF::bind will automatically ref the parameters added to it. But MediaPlayerPrivate-
AVFoundation and -MediaSOurceAVFObjC are not RefCounted, so by the time the bound
function is called, the underlying objects may have been freed.

Replace or augment callOnMainThread arguments with lambdas and weakPtrs so that
if the argument has been destroyed, its methods will not be called.

Make the MediaPlayerPrivateAVFoundation::Notification function type a std::function:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
(WebCore::MediaPlayerPrivateAVFoundation::Notification::function):

Make createWeakPtr() public so that it can be called from non-class methods:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createWeakPtr):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr):

Use a weakPtr to abort callOnMainThread() if the object has been destroyed:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::CMTimebaseEffectiveRateChangedCallback):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):

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

6 years ago[MSE] YouTube videos fail to play
jer.noble@apple.com [Mon, 3 Mar 2014 20:47:52 +0000 (20:47 +0000)]
[MSE] YouTube videos fail to play
https://bugs.webkit.org/show_bug.cgi?id=129525

Reviewed by Darin Adler.

Source/WebCore:

Test: media/media-source/media-source-fudge-factor.html

Add a very simple playability metric to SourceBuffer. Track the number of seconds buffered
and use that metric to determine whether the MediaSource has buffered enough data to play
through.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::currentTime): Added simple accessor.
(WebCore::MediaSource::monitorSourceBuffers): Replace the functor-based iterators with lambdas.
(WebCore::MediaSource::addSourceBuffer): Drive-by fix; only add new source buffers to the
    activeSourceBuffers list if those buffers are actually active.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer): Initialize new ivars.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Measure the number of seconds buffered.
(WebCore::SourceBuffer::monitorBufferingRate): Use a simple Exponential moving average to
    track the buffering rate.
(WebCore::SourceBuffer::hasCurrentTime): Return true if the current time is within 1/24 s
    of a buffered range.
(WebCore::SourceBuffer::hasFutureTime): Moved from MediaSource.
(WebCore::SourceBuffer::canPlayThrough): Return true if the buffering rate is > 1s per
    second, or if the rate is sufficient to keep up over the remaining time.
* Modules/mediasource/SourceBuffer.h:

LayoutTests:

* media/media-source/media-source-addsourcebuffer.html: Updated.
* media/media-source/media-source-addsourcebuffer-expected.txt: Updated.
* media/media-source/media-source-fudge-factor-expected.txt: Added.
* media/media-source/media-source-fudge-factor.html: Added.

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

6 years ago[CSS Shapes] Serialize circle positions
betravis@adobe.com [Mon, 3 Mar 2014 20:24:30 +0000 (20:24 +0000)]
[CSS Shapes] Serialize circle positions
https://bugs.webkit.org/show_bug.cgi?id=129404

Reviewed by Dirk Schulze.

Source/WebCore:

Circle positions should always be present when serialized, and should
only have the 2 or 4-valued form. Keywords are converted to percentages
and simplified where possible. This patch adds some additional processing
that converts the parsed position into the serialized format, before
converting it to text. See http://dev.w3.org/csswg/css-shapes/#basic-shape-serialization.

Updated existing parsing tests.

* css/CSSBasicShapes.cpp:
(WebCore::serializePositionOffset): Convert a position offset to a serialized string.
The offset must be a pair, as generated by buildSerializablePositionOffset.
(WebCore::buildSerializablePositionOffset): Generates a keyword + offset pair for each
position offset. The keywords may later be dropped during serialization.
(WebCore::CSSBasicShapeCircle::cssText): Use the new serialization methods.

LayoutTests:

Modify each circle test to have a correctly serialized position.

* fast/masking/parsing-clip-path-shape-expected.html: Updated result.
* fast/masking/parsing-clip-path-shape.html: Updated test.
* fast/shapes/parsing/parsing-shape-inside-expected.txt: Updated results.
* fast/shapes/parsing/parsing-shape-outside-expected.txt: Updated results.
* fast/shapes/parsing/parsing-test-utils.js: Updated serialization results.

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

6 years agoCrash when going into video fullscreen on iOS
simon.fraser@apple.com [Mon, 3 Mar 2014 20:01:26 +0000 (20:01 +0000)]
Crash when going into video fullscreen on iOS
https://bugs.webkit.org/show_bug.cgi?id=129613

Reviewed by Dean Jackson.

We shouldn't reparent a UIView's layer without unparenting
the view first.

* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerID):

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

6 years agoOptimize StylePropertiesSet::findPropertyIndex() to improve CSS properties performance
commit-queue@webkit.org [Mon, 3 Mar 2014 19:07:53 +0000 (19:07 +0000)]
Optimize StylePropertiesSet::findPropertyIndex() to improve CSS properties performance
https://bugs.webkit.org/show_bug.cgi?id=129605

Patch by Lorenzo Tilve <ltilve@igalia.com> on 2014-03-03
Reviewed by Andreas Kling.

Merged from Blink (patch by Mikhail Pozdnyakov):
https://src.chromium.org/viewvc/blink?view=revision&revision=167325

Avoid checking whether 'StylePropertiesSet' is mutable and accesing directly to its
data members to achieve performance improvements

Before the optimization applied:
    mean: 3064.8337171934063 runs/s
    median: 3097.5899379343855 runs/s
    stdev: 66.89274074044187 runs/s
    min: 2891.7479324362585 runs/s
    max: 3113.288683440125 runs/s

After the optimization applied:
    mean: 3343.8356114138105 runs/s
    median: 3356.25682957446 runs/s
    stdev: 36.297533087489036 runs/s
    min: 3238.5468032264243 runs/s
    max: 3368.664837531425 runs/s

Performance gain for the average value is approx. 9.1%, in the
range of the 10% - 8.2% for the min and max measured
values (Linux desktop x64).

* css/StyleProperties.cpp:
(WebCore::ImmutableStyleProperties::findPropertyIndex):
(WebCore::MutableStyleProperties::findPropertyIndex):
* css/StyleProperties.h:
(WebCore::toMutableStyleProperties):
(WebCore::toImmutableStyleProperties):
(WebCore::StyleProperties::findPropertyIndex):

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

6 years agoTransform CSS clip-path pixel tests to ref tests
krit@webkit.org [Mon, 3 Mar 2014 18:32:27 +0000 (18:32 +0000)]
Transform CSS clip-path pixel tests to ref tests
https://bugs.webkit.org/show_bug.cgi?id=129607

Reviewed by Andreas Kling.

* css3/masking/clip-path-border-box.html:
* css3/masking/clip-path-circle-filter-expected.txt: Removed.
* css3/masking/clip-path-circle-overflow-expected.txt: Removed.
* css3/masking/clip-path-circle-overflow-hidden-expected.txt: Removed.
* css3/masking/clip-path-circle-overflow-hidden.html: Removed.
* css3/masking/clip-path-circle-relative-overflow-expected.txt: Removed.
* css3/masking/clip-path-ellipse-expected.html: Renamed from LayoutTests/css3/masking/clip-path-circle-filter.html.
* css3/masking/clip-path-ellipse-expected.txt: Removed.
* css3/masking/clip-path-ellipse.html:
* css3/masking/clip-path-filter-expected.html: Added.
* css3/masking/clip-path-filter.html: Added.
* css3/masking/clip-path-inset-expected.html: Copied from LayoutTests/css3/masking/clip-path-ellipse.html.
* css3/masking/clip-path-inset-expected.txt: Removed.
* css3/masking/clip-path-overflow-expected.html: Copied from LayoutTests/css3/masking/clip-path-circle-overflow.html.
* css3/masking/clip-path-overflow-hidden-expected.html: Copied from LayoutTests/css3/masking/clip-path-ellipse.html.
* css3/masking/clip-path-overflow-hidden.html: Renamed from LayoutTests/css3/masking/clip-path-circle-overflow.html.
* css3/masking/clip-path-overflow.html: Copied from LayoutTests/css3/masking/clip-path-ellipse.html.
* css3/masking/clip-path-polygon-evenodd-expected.html: Added.
* css3/masking/clip-path-polygon-evenodd-expected.txt: Removed.
* css3/masking/clip-path-polygon-evenodd.html:
* css3/masking/clip-path-polygon-expected.html: Copied from LayoutTests/css3/masking/clip-path-ellipse.html.
* css3/masking/clip-path-polygon-expected.txt: Removed.
* css3/masking/clip-path-polygon-nonzero-expected.html: Copied from LayoutTests/css3/masking/clip-path-ellipse.html.
* css3/masking/clip-path-polygon-nonzero-expected.txt: Removed.
* css3/masking/clip-path-polygon-nonzero.html:
* css3/masking/clip-path-polygon.html:
* platform/efl/css3/masking/clip-path-circle-overflow-expected.png: Removed.
* platform/efl/css3/masking/clip-path-circle-overflow-hidden-expected.png: Removed.
* platform/efl/css3/masking/clip-path-ellipse-expected.png: Removed.
* platform/gtk/css3/masking/clip-path-circle-overflow-expected.png: Removed.
* platform/gtk/css3/masking/clip-path-circle-overflow-hidden-expected.png: Removed.
* platform/gtk/css3/masking/clip-path-ellipse-expected.png: Removed.
* platform/mac/css3/masking/clip-path-circle-overflow-expected.png: Removed.
* platform/mac/css3/masking/clip-path-circle-overflow-hidden-expected.png: Removed.
* platform/mac/css3/masking/clip-path-ellipse-expected.png: Removed.
* platform/mac/css3/masking/clip-path-inset-expected.png: Removed.
* platform/mac/css3/masking/clip-path-polygon-evenodd-expected.png: Removed.
* platform/mac/css3/masking/clip-path-polygon-expected.png: Removed.
* platform/mac/css3/masking/clip-path-polygon-nonzero-expected.png: Removed.

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

6 years agoAnother unreviewed build fix attempt for Windows after r164986.
bburg@apple.com [Mon, 3 Mar 2014 18:24:22 +0000 (18:24 +0000)]
Another unreviewed build fix attempt for Windows after r164986.

We never told Visual Studio to copy over the web replay code generator scripts
and the generated headers for JavaScriptCore replay inputs as if they were
private headers.

* JavaScriptCore.vcxproj/copy-files.cmd:

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

6 years agoUpdate the email.
cavalcantii@gmail.com [Mon, 3 Mar 2014 18:20:49 +0000 (18:20 +0000)]
Update the email.

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

6 years agoUnreviewed build fix for Windows after r164986.
bburg@apple.com [Mon, 3 Mar 2014 17:46:34 +0000 (17:46 +0000)]
Unreviewed build fix for Windows after r164986.

* WebCore.vcxproj/build-generated-files.sh: Export WebReplayScripts
so that the build system knows how to find CodeGeneratorReplayInputs.py.

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

6 years ago[CSS Regions] Overset computation is incorrect in some cases
abucur@adobe.com [Mon, 3 Mar 2014 17:16:06 +0000 (17:16 +0000)]
[CSS Regions] Overset computation is incorrect in some cases
https://bugs.webkit.org/show_bug.cgi?id=129032

Reviewed by Mihnea Ovidenie.

Source/WebCore:

This patch reworks the way overset is computed for regions and named flows.

1. Regions overflow no longer trigger an overset changed event. This is because
the overflow of a box is contained within the region range of the box. The content
edge should be considered the logical bottom position of the content inside the
flow thread.

2. The regions events logic was moved from RenderFlowThread to RenderNamedFlowThread
and from RenderRegion to RenderNamedFlowFragment (including the regionOverset property).

3. The overset value of the named flow is no longer stored in the named flow. It is
extracted from the overset of the last region in the chain.

4. The regions overset is not computed every time the flow thread is laid out which
should improve performance for flows with many regions. With the patch, each region
computes the overset value during its layout when the flow thread is in the overflow
or the final layout phase.

5. The overset changed event is dispatched only at the end of the layout of the named flows,
after all the region overset changes have been considered. This means that the overset
event can't be dispatched in the middle of the auto-height processing algorithm that
requires multiple layout passes for the flow threads.

However, the region layout update event dispatch timing was not changed, it is dispatched
every time the flow thread has a layout. This preserves the current behavior of the event.

Tests: The old tests were modified to take into account the change.

* dom/Element.cpp:
(WebCore::Element::webkitRegionOverset):
* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::overset):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildArrayForRegions):
* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeOverflow):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
(WebCore::RenderFlowThread::layout):
* rendering/RenderFlowThread.h:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::layoutBlock):
(WebCore::RenderNamedFlowFragment::setRegionOversetState):
(WebCore::RenderNamedFlowFragment::regionOversetState):
(WebCore::RenderNamedFlowFragment::updateOversetState):
* rendering/RenderNamedFlowFragment.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
(WebCore::RenderNamedFlowThread::computeOverflow):
(WebCore::RenderNamedFlowThread::layout):
(WebCore::RenderNamedFlowThread::dispatchNamedFlowEvents):
(WebCore::RenderNamedFlowThread::dispatchRegionLayoutUpdateEventIfNeeded):
(WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
* rendering/RenderNamedFlowThread.h:
There's a new field called m_flowContentBottom that tracks the content bottom of the flow thread
after layout. This value is used to compute the overset value of the regions because it's not
affected by relative positioning or visual overflow such as shadows.
* rendering/RenderRegion.cpp:
* rendering/RenderRegion.h:

LayoutTests:

Adjust the tests to cope with the overset changes.

* fast/regions/cssom/element-region-overset-state-expected.txt:
* fast/regions/cssom/element-region-overset-state-vertical-rl-expected.txt:
* fast/regions/cssom/element-region-overset-state-vertical-rl.html:
* fast/regions/cssom/element-region-overset-state.html:
This test has a new case that verifies region clamping is correctly taken into account.
* fast/regions/cssom/webkit-named-flow-overset-expected.txt:
* fast/regions/cssom/webkit-named-flow-overset.html:

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

6 years ago[GTK] CodeGeneratorGObject.pm remove usage of undefined variable
commit-queue@webkit.org [Mon, 3 Mar 2014 17:06:45 +0000 (17:06 +0000)]
[GTK] CodeGeneratorGObject.pm remove usage of undefined variable
https://bugs.webkit.org/show_bug.cgi?id=129602

Patch by Tomas Popela <tpopela@redhat.com> on 2014-03-03
Reviewed by Martin Robinson.

Remove usage of undefined variable hdrPropIncludes in CodeGeneratorGObject.pm

* bindings/scripts/CodeGeneratorGObject.pm:
(WriteData):

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

6 years agoWeb Replay: upstream input storage, capture/replay machinery, and inspector domain
bburg@apple.com [Mon, 3 Mar 2014 17:01:11 +0000 (17:01 +0000)]
Web Replay: upstream input storage, capture/replay machinery, and inspector domain
https://bugs.webkit.org/show_bug.cgi?id=128782

Source/JavaScriptCore:

Reviewed by Timothy Hatcher.

Alter the replay inputs code generator so that it knows when it is necessary to
to include headers for HEAVY_SCALAR types such as WTF::String and WebCore::URL.

* JavaScriptCore.xcodeproj/project.pbxproj:
* replay/scripts/CodeGeneratorReplayInputs.py:
(Framework.fromString):
(Frameworks): Add WTF as an allowed framework for code generation.
(Generator.generate_includes): Include headers for HEAVY_SCALAR types in the header file.
(Generator.generate_includes.declaration):
(Generator.generate_includes.or):
(Generator.generate_type_forward_declarations): Skip HEAVY_SCALAR types.

Source/WebCore:

Reviewed by Timothy Hatcher, Joseph Pecoraro, and Andreas Kling.

No new tests yet, as they rely on infrastructure tracked in https://webkit.org/b/129190.

Replayable executions are organized into ReplaySessions, which can
contain several ReplaySessionSegments that divide overall execution
at main frame navigation boundaries. NondeterministicInput subclasses
are stored in SegmentedInputStorage according to the input's InputQueue.

Capture and playback are controlled at the page granularity by the Page's
ReplayController. The controller knows how to create new segments, replay to
arbitrary positions in the ReplaySession, and track the active InputCursor.

The capturing and replaying input cursor subclasses encapsulate state for
storing new inputs and loading/dispatching saved inputs, respectively.

The ReplayAgent and associated inspector protocol domain is the friendly
public API for programmatically capturing and replaying sessions.

* DerivedSources.make: Add replay inputs code generation target. Add the
replay domain specification to the list of inspector domains.

* ForwardingHeaders/replay/EncodedValue.h: Added.
* WebCore.xcodeproj/project.pbxproj: Add many files, and export
`WebReplayScripts` environment variable to DerivedSources.make.

* inspector/InspectorController.cpp: Add the replay agent.
(WebCore::InspectorController::InspectorController):

* inspector/InspectorInstrumentation.cpp:
Add events for segment lifecycle events, and loading/unloading of sessions
and segments, and capture/replay progress events. The replay controller
also needs to know about detached and committed frames.

(WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::sessionCreatedImpl):
(WebCore::InspectorInstrumentation::sessionLoadedImpl):
(WebCore::InspectorInstrumentation::sessionModifiedImpl):
(WebCore::InspectorInstrumentation::segmentCreatedImpl):
(WebCore::InspectorInstrumentation::segmentCompletedImpl):
(WebCore::InspectorInstrumentation::segmentLoadedImpl):
(WebCore::InspectorInstrumentation::segmentUnloadedImpl):
(WebCore::InspectorInstrumentation::captureStartedImpl):
(WebCore::InspectorInstrumentation::captureStoppedImpl):
(WebCore::InspectorInstrumentation::playbackStartedImpl):
(WebCore::InspectorInstrumentation::playbackPausedImpl):
(WebCore::InspectorInstrumentation::playbackHitPositionImpl):
(WebCore::InspectorInstrumentation::replayAgentEnabled):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::replayAgentEnabled):
(WebCore::InspectorInstrumentation::sessionCreated):
(WebCore::InspectorInstrumentation::sessionLoaded):
(WebCore::InspectorInstrumentation::sessionModified):
(WebCore::InspectorInstrumentation::segmentCreated):
(WebCore::InspectorInstrumentation::segmentCompleted):
(WebCore::InspectorInstrumentation::segmentLoaded):
(WebCore::InspectorInstrumentation::segmentUnloaded):
(WebCore::InspectorInstrumentation::captureStarted):
(WebCore::InspectorInstrumentation::captureStopped):
(WebCore::InspectorInstrumentation::playbackStarted):
(WebCore::InspectorInstrumentation::playbackPaused):
(WebCore::InspectorInstrumentation::playbackHitPosition):

* inspector/InspectorReplayAgent.cpp: Added.
(WebCore::buildInspectorObjectForPosition):
(WebCore::buildInspectorObjectForInput):
(WebCore::buildInspectorObjectForSession):
(WebCore::SerializeInputToJSONFunctor::SerializeInputToJSONFunctor):
(WebCore::SerializeInputToJSONFunctor::~SerializeInputToJSONFunctor):
(WebCore::SerializeInputToJSONFunctor::operator()):
(WebCore::SerializeInputToJSONFunctor::returnValue):
(WebCore::buildInspectorObjectForSegment):
(WebCore::InspectorReplayAgent::InspectorReplayAgent):
(WebCore::InspectorReplayAgent::~InspectorReplayAgent):
(WebCore::InspectorReplayAgent::sessionState):
(WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
(WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorReplayAgent::frameNavigated):
(WebCore::InspectorReplayAgent::frameDetached):
(WebCore::InspectorReplayAgent::sessionCreated):
(WebCore::InspectorReplayAgent::sessionModified):
(WebCore::InspectorReplayAgent::sessionLoaded):
(WebCore::InspectorReplayAgent::segmentCreated):
(WebCore::InspectorReplayAgent::segmentCompleted):
(WebCore::InspectorReplayAgent::segmentLoaded):
(WebCore::InspectorReplayAgent::segmentUnloaded):
(WebCore::InspectorReplayAgent::captureStarted):
(WebCore::InspectorReplayAgent::captureStopped):
(WebCore::InspectorReplayAgent::playbackStarted):
(WebCore::InspectorReplayAgent::playbackPaused):
(WebCore::InspectorReplayAgent::playbackHitPosition):
(WebCore::InspectorReplayAgent::startCapturing):
(WebCore::InspectorReplayAgent::stopCapturing):
(WebCore::InspectorReplayAgent::replayToPosition):
(WebCore::InspectorReplayAgent::replayToCompletion):
(WebCore::InspectorReplayAgent::pausePlayback):
(WebCore::InspectorReplayAgent::cancelPlayback):
(WebCore::InspectorReplayAgent::switchSession):
(WebCore::InspectorReplayAgent::insertSessionSegment):
(WebCore::InspectorReplayAgent::removeSessionSegment):
Provide a public API for modifying sessions. This is the backend support
for user editing of replay sessions to add/remove specific segments.

(WebCore::InspectorReplayAgent::findSession):
(WebCore::InspectorReplayAgent::findSegment):
(WebCore::InspectorReplayAgent::getAvailableSessions):
(WebCore::InspectorReplayAgent::getSerializedSession):
(WebCore::InspectorReplayAgent::getSerializedSegment):
Most of the replay protocol domain speaks in terms of sesssion and
segment identifiers. These functions return the actual data associated
with these identifiers.

* inspector/InspectorReplayAgent.h: Added.
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::InstrumentingAgents):
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorReplayAgent): Added.
(WebCore::InstrumentingAgents::setInspectorReplayAgent): Added.
* inspector/protocol/Replay.json: Added.

* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::replayController): Added.
* platform/Logging.h: Add WebReplay logging channel.
* replay/AllReplayInputs.h: Added. Simplifies importing all input definitions.

* replay/CapturingInputCursor.cpp: Added.
(WebCore::CapturingInputCursor::CapturingInputCursor):
(WebCore::CapturingInputCursor::~CapturingInputCursor):
(WebCore::CapturingInputCursor::create):
(WebCore::CapturingInputCursor::storeInput):
(WebCore::CapturingInputCursor::loadInput):
(WebCore::CapturingInputCursor::uncheckedLoadInput):
* replay/CapturingInputCursor.h: Added.

* replay/EventLoopInput.h:
(WebCore::EventLoopInputBase::EventLoopInputBase):
(WebCore::EventLoopInputBase::timestamp):
(WebCore::EventLoopInputBase::setTimestamp): Support deserialization.

* replay/EventLoopInputDispatcher.cpp: Added. This class encapsulates the timers
and measurements used to dispatch event loop inputs during replay.

(WebCore::EventLoopInputDispatcher::EventLoopInputDispatcher):
(WebCore::EventLoopInputDispatcher::run):
(WebCore::EventLoopInputDispatcher::pause):
(WebCore::EventLoopInputDispatcher::timerFired):
(WebCore::EventLoopInputDispatcher::dispatchInputSoon):
(WebCore::EventLoopInputDispatcher::dispatchInput):
* replay/EventLoopInputDispatcher.h: Added.
(WebCore::EventLoopInputDispatcherClient::EventLoopInputDispatcherClient):
(WebCore::EventLoopInputDispatcherClient::~EventLoopInputDispatcherClient):

* replay/FunctorInputCursor.h: Added.
(WebCore::FunctorInputCursor::~FunctorInputCursor):
(WebCore::FunctorInputCursor::forEachInputInQueue):
(WebCore::FunctorInputCursor::FunctorInputCursor):
(WebCore::FunctorInputCursor::storeInput):
(WebCore::FunctorInputCursor::loadInput):
(WebCore::FunctorInputCursor::uncheckedLoadInput):

* replay/ReplayController.cpp: Added.
(WebCore::ReplayController::ReplayController):
(WebCore::ReplayController::switchSession):
(WebCore::ReplayController::createSegment):
(WebCore::ReplayController::completeSegment):
(WebCore::ReplayController::loadSegment):
(WebCore::ReplayController::unloadSegment):
(WebCore::ReplayController::startCapturing):
(WebCore::ReplayController::stopCapturing):
(WebCore::ReplayController::startPlayback):
(WebCore::ReplayController::pausePlayback):
(WebCore::ReplayController::cancelPlayback):
(WebCore::ReplayController::replayToPosition):
(WebCore::ReplayController::frameDetached):
(WebCore::ReplayController::frameNavigated):
(WebCore::ReplayController::loadedSession):
(WebCore::ReplayController::loadedSegment):
(WebCore::ReplayController::activeInputCursor):
(WebCore::ReplayController::dispatcher):
(WebCore::ReplayController::willDispatchInput):
(WebCore::ReplayController::didDispatchInput):
(WebCore::ReplayController::didDispatchFinalInput):
* replay/ReplayController.h: Added.
(WebCore::ReplayPosition::ReplayPosition):
(WebCore::ReplayPosition::operator<):
(WebCore::ReplayPosition::operator==):

* replay/ReplayInputCreationMethods.cpp: Added.
Static factory implementations for inputs belong here.
(WebCore::InitialNavigation::createFromPage):

* replay/ReplayInputDispatchMethods.cpp: Added.
All dispatch() implementations for generated replay inputs belong here.
(WebCore::BeginSegmentSentinel::dispatch):
(WebCore::EndSegmentSentinel::dispatch):
(WebCore::InitialNavigation::dispatch):

* replay/ReplayInputTypes.cpp:
(WebCore::ReplayInputTypes::ReplayInputTypes):
* replay/ReplayInputTypes.h: Define strings for WebCore inputs.

* replay/ReplaySession.cpp: Added.
(WebCore::ReplaySession::create):
(WebCore::ReplaySession::ReplaySession):
(WebCore::ReplaySession::~ReplaySession):
(WebCore::ReplaySession::appendSegment):
(WebCore::ReplaySession::insertSegment):
(WebCore::ReplaySession::removeSegment):
* replay/ReplaySession.h: Added.
(WebCore::ReplaySession::identifier):
(WebCore::ReplaySession::timestamp):
(WebCore::ReplaySession::size):
(WebCore::ReplaySession::at):
(WebCore::ReplaySession::begin):
(WebCore::ReplaySession::end):

* replay/ReplaySessionSegment.cpp: Added.
(WebCore::ReplaySessionSegment::create):
(WebCore::ReplaySessionSegment::ReplaySessionSegment):
(WebCore::ReplaySessionSegment::~ReplaySessionSegment):
(WebCore::ReplaySessionSegment::createCapturingCursor):
(WebCore::ReplaySessionSegment::createReplayingCursor):
(WebCore::ReplaySessionSegment::createFunctorCursor):
* replay/ReplaySessionSegment.h: Added.
(WebCore::ReplaySessionSegment::identifier):
(WebCore::ReplaySessionSegment::timestamp):

* replay/ReplayingInputCursor.cpp: Added.
(WebCore::ReplayingInputCursor::ReplayingInputCursor):
(WebCore::ReplayingInputCursor::~ReplayingInputCursor):
(WebCore::ReplayingInputCursor::create):
(WebCore::ReplayingInputCursor::storeInput):
(WebCore::ReplayingInputCursor::loadInput):
(WebCore::ReplayingInputCursor::uncheckedLoadInput):
* replay/ReplayingInputCursor.h: Added.

* replay/SegmentedInputStorage.cpp: Added.
(WebCore::queueTypeToLogPrefix):
(WebCore::jsonStringForInput):
(WebCore::offsetForInputQueue):
(WebCore::SegmentedInputStorage::SegmentedInputStorage):
(WebCore::SegmentedInputStorage::~SegmentedInputStorage):
(WebCore::SegmentedInputStorage::load):
(WebCore::SegmentedInputStorage::store):
(WebCore::SegmentedInputStorage::queueSize):
* replay/SegmentedInputStorage.h: Added.

* replay/SerializationMethods.cpp: Added.
Specializations of EncodingTraits for WebCore types belong here.

(JSC::EncodingTraits<NondeterministicInputBase>::encodeValue):
(JSC::EncodingTraits<NondeterministicInputBase>::decodeValue):
(JSC::EncodingTraits<SecurityOrigin>::encodeValue):
(JSC::EncodingTraits<SecurityOrigin>::decodeValue):
(JSC::EncodingTraits<URL>::encodeValue):
(JSC::EncodingTraits<URL>::decodeValue):
* replay/SerializationMethods.h: Added.
* replay/WebInputs.json: Added.
In this inital patch, we define BeginSegmentSentinel,
EndSegmentSentinel, and InitialNavigation inputs.

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

6 years agoRespect SVG fragment identifiers in <img> src attribute
graouts@webkit.org [Mon, 3 Mar 2014 11:57:30 +0000 (11:57 +0000)]
Respect SVG fragment identifiers in <img> src attribute
https://bugs.webkit.org/show_bug.cgi?id=129387

Reviewed by Dirk Schulze.

Following Dirk Schulze's suggestion, we set the URL on the SVGImage itself and handle the URL's
fragment identifier at draw time in the SVGImage itself, which will provide a sounder base for
handling of fragment identifier in SVG resource URLs in CSS properties, and should also deal
with the crasher reported in http://webkit.org/b/129498 since there is a guaranteed Frame at the
time we call SVGImage::draw().

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw):
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
* svg/graphics/SVGImageForContainer.h:

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

6 years agoMove function calls outside loop in dom
lvidacs.u-szeged@partner.samsung.com [Mon, 3 Mar 2014 10:17:55 +0000 (10:17 +0000)]
Move function calls outside loop in dom
https://bugs.webkit.org/show_bug.cgi?id=126525

Reviewed by Csaba Osztrogonác.

Store the result of length() in a local variable and use it in each iteration.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::isXMLMIMEType):
* dom/ElementData.cpp:
(WebCore::UniqueElementData::UniqueElementData):
* dom/EventContext.cpp:
(WebCore::TouchEventContext::checkReachability):

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

6 years ago[GTK] webkit_dom_range_compare_boundary_points fails when 0 is passed as how parameter
commit-queue@webkit.org [Mon, 3 Mar 2014 10:16:55 +0000 (10:16 +0000)]
[GTK] webkit_dom_range_compare_boundary_points fails when 0 is passed as how parameter
https://bugs.webkit.org/show_bug.cgi?id=129145

Patch by Tomas Popela <tpopela@redhat.com> on 2014-03-03
Reviewed by Carlos Garcia Campos.

While generating GObject DOM API the generator should skip non pointer
types while generating the g_return_val_if_fail macro.
This will avoid the situation when Range.START_TO_START is defined as 0,
thus the webkit_dom_range_compare_boundary_points function will fail
everytime it is called with 0 as how value.

* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateFunction):

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

6 years ago[cmake] *Names.cpp file should be regenerated after touching StaticString.pm
commit-queue@webkit.org [Mon, 3 Mar 2014 10:15:52 +0000 (10:15 +0000)]
[cmake] *Names.cpp file should be regenerated after touching StaticString.pm
https://bugs.webkit.org/show_bug.cgi?id=129031

Patch by Jozsef Berta <jberta.u-szeged@partner.samsung.com> on 2014-03-03
Reviewed by Csaba Osztrogonác.

.:

* Source/cmake/WebKitMacros.cmake: Added a call for make_names.pm dependencies in GENERATE_FONT_NAMES and GENERATE_DOM_NAMES macros.

Source/WebCore:

* CMakeLists.txt: Added make_names.pl dependencies: bindings/scripts/Hasher.pm and bindings/scripts/StaticString.pm

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

6 years ago[GTK] Multimedia controls captions icon needs its own metaphor
calvaris@igalia.com [Mon, 3 Mar 2014 08:36:56 +0000 (08:36 +0000)]
[GTK] Multimedia controls captions icon needs its own metaphor
https://bugs.webkit.org/show_bug.cgi?id=129091

Reviewed by Martin Robinson.

As we got the new icon created, we used it with a fallback to the
old icon to keep run-time compatibility.

No new tests, current ones suffice.

* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
Replicated RenderThemeGtk::paintMediaButton to check for the
necessary icon first and do the fallback to the old and stock
icons.
* platform/gtk/RenderThemeGtk2.cpp:
(WebCore::getStockIconForWidgetType): Added ASSERT for non-empty
icon name.
(WebCore::getStockSymbolicIconForWidgetType): Check for non empty
icon name before calling getStockIconForWidgetType. Fixed coding
style.
* platform/gtk/RenderThemeGtk3.cpp:
(WebCore::getStockIconForWidgetType): Added ASSERT for non-empty
icon name.
(WebCore::getStockSymbolicIconForWidgetType): Check for non empty
icon name before calling getStockIconForWidgetType. Fixed coding
style.

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

6 years ago[GTK] WebKit2WebExtension GIR can't be used in vala
carlosgc@webkit.org [Mon, 3 Mar 2014 08:07:49 +0000 (08:07 +0000)]
[GTK] WebKit2WebExtension GIR can't be used in vala
https://bugs.webkit.org/show_bug.cgi?id=127179

Reviewed by Martin Robinson.

Add a different pkg-config file for the web extensions API.

.:

* Source/cmake/OptionsGTK.cmake:
* configure.ac:

Source/WebKit2:

* GNUmakefile.am:
* PlatformGTK.cmake:
* webkit2gtk-web-extension.pc.in: Added.

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

6 years agoAdd a fallback path for compiling the remaining attribute checkers
benjamin@webkit.org [Mon, 3 Mar 2014 07:10:57 +0000 (07:10 +0000)]
Add a fallback path for compiling the remaining attribute checkers
https://bugs.webkit.org/show_bug.cgi?id=129580

Reviewed by Darin Adler.

The remaining attribute checkers appear to be less common than the simple value match.
This patch adds them to SelectorCompiler for completeness but no attempt is made at optimizing them,
they all default to function calls.

If the assumption that those selectors are not common turn out to be incorrect, we should see
the function calls in profiles and optimize them as needed.

* css/SelectorChecker.cpp:
(WebCore::attributeValueMatches):
If we get anything but attribute match here, something has gone horribly wrong. Update the code
to fail if that were to happen.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
Add the missing match type to the selector fragment.

Begin, End, Contain cannot match an empty value per specification. We can test that at compile time
and fail immediately. See http://www.w3.org/TR/css3-selectors/#attribute-substrings

List has the extra requirement that a value containing a space does not match anything. It also cannot
match with an empty string. See http://www.w3.org/TR/css3-selectors/#attribute-representation

(WebCore::SelectorCompiler::attributeValueBeginsWith):
(WebCore::SelectorCompiler::attributeValueContains):
(WebCore::SelectorCompiler::attributeValueEndsWith):
(WebCore::SelectorCompiler::attributeValueMatchHyphenRule):
(WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
The slow fallbacks.

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
A generic code generator making function call to match an attribute value.

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

6 years agoPolymorphicPutByIdList should have a simpler construction API with basically a single...
fpizlo@apple.com [Mon, 3 Mar 2014 06:01:44 +0000 (06:01 +0000)]
PolymorphicPutByIdList should have a simpler construction API with basically a single entrypoint
https://bugs.webkit.org/show_bug.cgi?id=129591

Reviewed by Michael Saboff.

* bytecode/PolymorphicPutByIdList.cpp:
(JSC::PutByIdAccess::fromStructureStubInfo): This function can figure out the slow path target for itself.
(JSC::PolymorphicPutByIdList::PolymorphicPutByIdList): This constuctor should be private, only from() should call it.
(JSC::PolymorphicPutByIdList::from):
* bytecode/PolymorphicPutByIdList.h:
(JSC::PutByIdAccess::stubRoutine):
* jit/Repatch.cpp:
(JSC::tryBuildPutByIdList): Don't pass the slow path target since it can be derived from the stubInfo.

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

6 years agoDebugging improvements from my gbemu investigation session
fpizlo@apple.com [Mon, 3 Mar 2014 05:42:29 +0000 (05:42 +0000)]
Debugging improvements from my gbemu investigation session
https://bugs.webkit.org/show_bug.cgi?id=129599

Reviewed by Mark Lam.

Various improvements from when I was investigating bug 129411.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::optimizationThresholdScalingFactor): Make the dataLog() statement print the actual multiplier.
* jsc.cpp:
(GlobalObject::finishCreation):
(functionDescribe): Make describe() return a string rather than printing the string.
(functionDescribeArray): Like describe(), but prints details about arrays.

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

6 years agoBlind Windows build fix.
akling@apple.com [Mon, 3 Mar 2014 05:33:05 +0000 (05:33 +0000)]
Blind Windows build fix.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

    Tweak JSDOMWindowBase::commonVM() return type to be a reference.

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

6 years agoJSDOMWindow::commonVM() should return a reference.
akling@apple.com [Mon, 3 Mar 2014 05:10:15 +0000 (05:10 +0000)]
JSDOMWindow::commonVM() should return a reference.
<https://webkit.org/b/129293>

Source/JavaScriptCore:

Added a DropAllLocks constructor that takes VM& without null checks.

Reviewed by Geoff Garen.

Source/WebCore:

Since this function always returns a VM and never null, make it
return a reference instead. There are more VM getters that never
return null, but I tried to keep the patch from snowballing.

Reviewed by Geoff Garen.

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

6 years agoRemove ASSERT in ~IDBRequest since it is firing during legitimate uses in Web Inspector.
timothy@apple.com [Mon, 3 Mar 2014 04:49:38 +0000 (04:49 +0000)]
Remove ASSERT in ~IDBRequest since it is firing during legitimate uses in Web Inspector.

Adding the ASSERT back is tracked by https://webkit.org/b/129593.

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

Reviewed by Sam Weinig.

Source/WebCore:

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::~IDBRequest):

LayoutTests:

* TestExpectations: Remove skipped tests.
* inspector-protocol/model/probe-manager-add-remove-actions-expected.txt: Rebaselined.

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

6 years agoWeb Inspector model tests load wrong inspector page under WebKitTestRunner
bburg@apple.com [Mon, 3 Mar 2014 03:42:43 +0000 (03:42 +0000)]
Web Inspector model tests load wrong inspector page under WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=129460

Reviewed by Dan Bernstein.

Tools:

Don't unconditionally open the inspector before running an inspector test.
Instead, the test should request that the inspector open when it's ready.

This change was lost during a rebase, but is the same change made to
DumpRenderTree.

* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):

LayoutTests:

Stop skipping inspector/test-harness-trivially-works.html.

* platform/wk2/TestExpectations:

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

6 years agoUnreviewed, rolling out r164961.
commit-queue@webkit.org [Mon, 3 Mar 2014 03:24:58 +0000 (03:24 +0000)]
Unreviewed, rolling out r164961.
http://trac.webkit.org/changeset/164961
https://bugs.webkit.org/show_bug.cgi?id=129596

Caused many assertion failures (Requested by ap on #webkit).

* css/SelectorChecker.cpp:
(WebCore::attributeValueMatches):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):

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

6 years agoStreamline use of TextIterator, cutting down includes and use of soon-to-be-deleted...
darin@apple.com [Mon, 3 Mar 2014 02:30:37 +0000 (02:30 +0000)]
Streamline use of TextIterator, cutting down includes and use of soon-to-be-deleted functions
https://bugs.webkit.org/show_bug.cgi?id=129592

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.exp.in: Re-sorted this file. Not sure how it got unsorted.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::stringForVisiblePositionRange): Call TextIterator::text
instead of TextIterator::length. Also removed unneeded special case for empty string
and exception code.
(WebCore::AccessibilityObject::lengthForVisiblePositionRange): Ditto.

* accessibility/AccessibilityObject.h: Include TextIteratorBehavior.h instead of
TextIterator.h.

* accessibility/AccessibilityRenderObject.cpp: Include TextIterator.h.

* accessibility/mac/WebAccessibilityObjectWrapperBase.mm: Removed unneeded
TextIterator.h include.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Call
TextIterator::text instead of TextIterator::length.

* dom/Element.cpp: Include TextIterator.h.

* dom/Node.cpp: Include Range.h.

* dom/Position.cpp:
(WebCore::Position::isCandidate): Cast to RenderBlockFlow since that's what the
type check above does. Use a return statement instead of an else for better flow.
(WebCore::Position::leadingWhitespacePosition): Call
deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).
(WebCore::Position::trailingWhitespacePosition): Ditto.

* dom/Range.cpp:
(WebCore::Range::firstNode): Added a FIXME about code that clearly does not
belong. This is something we really need to fix.

* editing/AlternativeTextController.cpp: Include TextIterator.h.
* editing/ApplyStyleCommand.cpp: Ditto.

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit): Call
deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).

* editing/Editor.h: Include TextIteratorBehavior.h instead of TextIterator.h.

* editing/HTMLInterchange.cpp:
(WebCore::convertHTMLTextToInterchangeFormat): Call
deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).

* editing/SpellingCorrectionCommand.cpp: Include TextIterator.h.

* editing/TextIterator.h: Moved isCollapsibleWhitespace from here into
htmlediting.h and renamed it deprecatedIsCollapsibleWhitespace.

* editing/TextIterator.cpp: Call
deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).

* editing/TypingCommand.cpp: Include TextIterator.h.

* editing/VisibleUnits.cpp:
(WebCore::previousBoundary): Call TextIterator::text instead of
TextIterator::length.
(WebCore::nextBoundary): Ditto.

* editing/htmlediting.cpp: Include TextIterator.h.

* editing/htmlediting.h: Removed non-helpful section comments.
Added FIXME about isWhitespace. Added deprecatedIsCollapsibleWhitespace,
formerly not deprecated and in TextIterator.h.

* editing/markup.cpp: Include TextIterator.h.

* html/HTMLTextAreaElement.cpp: Include TextIterator.h.

* page/ContextMenuController.cpp:
(WebCore::selectionContainsPossibleWord): Call TextIterator::text
instead of TextIterator::length and TextIterator::characterAt.

* page/EventHandler.cpp: Sorted conditional includes alphabetically by condition.

* platform/mac/HTMLConverter.mm:
(+[WebHTMLConverter editingAttributedStringFromRange:]): Call TextIterator::text
instead of TextIterator::length.

Source/WebKit/win:

* WebCoreSupport/WebEditorClient.cpp: Added now-needed include.

Source/WebKit2:

* UIProcess/WebPageProxy.cpp: Added now-needed include.
* WebProcess/WebPage/WebPage.cpp: Ditto.

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

6 years ago[iOS WebKit2] Keyboard deadlock when accepting/dismissing autocorrection.
enrica@apple.com [Mon, 3 Mar 2014 02:07:25 +0000 (02:07 +0000)]
[iOS WebKit2] Keyboard deadlock when accepting/dismissing autocorrection.
https://bugs.webkit.org/show_bug.cgi?id=129594
<rdar://problem/16168978>

Reviewed by Sam Weinig.

As a temporary fix, we are using a synchronous
message to accept autocorrection until we implement
a solution that processes these requests on a thread that
is not the main thread.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applyAutocorrection):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applyAutocorrection):
(WebKit::WebPage::syncApplyAutocorrection):

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

6 years ago[EFL] Remove m_initEfl from RunLoop.
ljaehun.lim@samsung.com [Mon, 3 Mar 2014 02:00:46 +0000 (02:00 +0000)]
[EFL] Remove m_initEfl from RunLoop.
https://bugs.webkit.org/show_bug.cgi?id=129568

Reviewed by Gyuyoung Kim.

We don't use m_initEfl except RunLoop constructor.

* wtf/RunLoop.h:
* wtf/efl/RunLoopEfl.cpp:
(WTF::RunLoop::RunLoop):

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

6 years agoAdd a fallback path for compiling the remaining attribute checkers
benjamin@webkit.org [Mon, 3 Mar 2014 01:48:20 +0000 (01:48 +0000)]
Add a fallback path for compiling the remaining attribute checkers
https://bugs.webkit.org/show_bug.cgi?id=129580

Reviewed by Darin Adler.

The remaining attribute checkers appear to be less common than the simple value match.
This patch adds them to SelectorCompiler for completeness but no attempt is made at optimizing them,
they all default to function calls.

If the assumption that those selectors are not common turn out to be incorrect, we should see
the function calls in profiles and optimize them as needed.

* css/SelectorChecker.cpp:
(WebCore::attributeValueMatches):
If we get anything but attribute match here, something has gone horribly wrong. Update the code
to fail if that were to happen.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
Add the missing match type to the selector fragment.

Begin, End, Contain cannot match an empty value per specification. We can test that at compile time
and fail immediately. See http://www.w3.org/TR/css3-selectors/#attribute-substrings

List has the extra requirement that a value containing a space does not match anything. It also cannot
match with an empty string. See http://www.w3.org/TR/css3-selectors/#attribute-representation

(WebCore::SelectorCompiler::attributeValueBeginsWith):
(WebCore::SelectorCompiler::attributeValueContains):
(WebCore::SelectorCompiler::attributeValueEndsWith):
(WebCore::SelectorCompiler::attributeValueMatchHyphenRule):
(WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
The slow fallbacks.

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
A generic code generator making function call to match an attribute value.

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

6 years agoFix build for case-sensitive file systems.
darin@apple.com [Mon, 3 Mar 2014 01:37:46 +0000 (01:37 +0000)]
Fix build for case-sensitive file systems.

* platform/UserActivity.h: Runloop -> RunLoop.

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

6 years agoHysteresisTimer should use WebCore::Timer
barraclough@apple.com [Mon, 3 Mar 2014 01:24:32 +0000 (01:24 +0000)]
HysteresisTimer should use WebCore::Timer
https://bugs.webkit.org/show_bug.cgi?id=129587

Reviewed by Sam Weinig.

* platform/HysteresisActivity.h:
(WebCore::HysteresisActivity::HysteresisActivity):
(WebCore::HysteresisActivity::hysteresisTimerFired):
    - RunLoop::Timer -> WebCore::Timer.
* platform/UserActivity.h:

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

6 years agoTry to fix the 32-bit build.
mitz@apple.com [Mon, 3 Mar 2014 01:16:59 +0000 (01:16 +0000)]
Try to fix the 32-bit build.

* UIProcess/ios/forms/WKFormSelectPopover.mm:
(adjustedFontSize):

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

6 years agoSplit TextIteratorBehavior into a separate header
darin@apple.com [Mon, 3 Mar 2014 01:02:36 +0000 (01:02 +0000)]
Split TextIteratorBehavior into a separate header
https://bugs.webkit.org/show_bug.cgi?id=129578

Reviewed by Sam Weinig.

Source/WebCore:

This is in preparation to greatly cut down on includes of TextIterator.h.

* GNUmakefile.list.am: Added new header.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.

 * editing/FindOptions.h: Changed typedef to unsigned char;
there is no reason to store these in a 32-bit integer.

 * editing/TextIterator.h: Added include of TextIteratorBehavior.h
and moved comments about the meanings of flag bits to their definition.

* editing/TextIteratorBehavior.h: Added.

* WebCore.exp.in: Updated for type changes.

Tools:

* Scripts/sort-export-file: Added special cases to the script so you can just paste link errors
from WebKit in and the script will add them in as unconditional exports. This makes the "add"
task easy, but the remove is still a bit of a pain.

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

6 years agoPage Cache is not enabled when using the modern WebKit2 API
weinig@apple.com [Mon, 3 Mar 2014 00:30:26 +0000 (00:30 +0000)]
Page Cache is not enabled when using the modern WebKit2 API
https://bugs.webkit.org/show_bug.cgi?id=129585

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool initWithConfiguration:]):
Default to CacheModelPrimaryWebBrowser until there is a way to configure it.

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

6 years ago[iOS WebKit2] Form controls handling
enrica@apple.com [Mon, 3 Mar 2014 00:19:41 +0000 (00:19 +0000)]
[iOS WebKit2] Form controls handling
https://bugs.webkit.org/show_bug.cgi?id=129344
<rdar://problem/16053643>

Reviewed by Simon Fraser.

Source/WebCore:

Updates localizable strings and adds some exports.

* English.lproj/Localizable.strings:
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

Adding support for select elements on iOS.
There is full support on iPad, while on iPhone it is
still limited to single select with no groups.
The change also fixes the issue of the keyboard appearing
on screen for types of elements that are implemented with
a popover or a picker.

* Scripts/webkit2/messages.py:
* Shared/AssistedNodeInformation.cpp:
(WebKit::WKOptionItem::encode):
(WebKit::WKOptionItem::decode):
(WebKit::AssistedNodeInformation::encode):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
(WebKit::WKOptionItem::WKOptionItem):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView inputView]):
(-[WKContentView assistedNodeSelectOptions]):
(-[WKContentView _startAssistingNode:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setAssistedNodeSelectedIndex):
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm: Added.
(-[WKFormSelectControl initWithView:]):
(+[WKFormSelectControl createPeripheralWithView:]):
(-[WKFormSelectControl assistantView]):
(-[WKFormSelectControl beginEditing]):
(-[WKFormSelectControl endEditing]):
* UIProcess/ios/forms/WKFormSelectPicker.mm: Added.
(-[WKSelectSinglePicker initWithView:]):
(-[WKSelectSinglePicker dealloc]):
(-[WKSelectSinglePicker controlView]):
(-[WKSelectSinglePicker controlBeginEditing]):
(-[WKSelectSinglePicker controlEndEditing]):
(-[WKSelectSinglePicker numberOfComponentsInPickerView:]):
(stringByTrimmingWhitespaceAndNewlines):
(-[WKSelectSinglePicker pickerView:numberOfRowsInComponent:]):
(-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
(-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
* UIProcess/ios/forms/WKFormSelectPopover.mm: Added.
(stringWithWritingDirection):
(adjustedFontSize):
(-[WKSelectTableViewController initWithView:hasGroups:]):
(-[WKSelectTableViewController viewWillAppear:]):
(-[WKSelectTableViewController numberOfSectionsInTableView:]):
(-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
(-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
(-[WKSelectTableViewController populateCell:withItem:]):
(-[WKSelectTableViewController findItemIndexAt:]):
(-[WKSelectTableViewController findItemAt:]):
(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
(-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
(-[WKSelectTableViewController hasText]):
(-[WKSelectTableViewController insertText:]):
(-[WKSelectTableViewController deleteBackward]):
(-[WKSelectPopover initWithView:hasGroups:]):
(-[WKSelectPopover dealloc]):
(-[WKSelectPopover controlView]):
(-[WKSelectPopover controlBeginEditing]):
(-[WKSelectPopover controlEndEditing]):
(-[WKSelectPopover _userActionDismissedPopover:]):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setAssistedNodeSelectedIndex):
(WebKit::innerFrameQuad):
(WebKit::WebPage::getPositionInformation):
(WebKit::hasFocusableNode):
(WebKit::WebPage::getAssistedNodeInformation):
(WebKit::WebPage::elementDidFocus):

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

6 years agoCodeBlock::hasDebuggerRequests() should returning a bool instead of an int.
mark.lam@apple.com [Mon, 3 Mar 2014 00:03:06 +0000 (00:03 +0000)]
CodeBlock::hasDebuggerRequests() should returning a bool instead of an int.
<https://webkit.org/b/129584>

Reviewed by Darin Adler.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::hasDebuggerRequests):

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

6 years agoClean up use of Options::enableConcurrentJIT().
mark.lam@apple.com [Sun, 2 Mar 2014 23:14:47 +0000 (23:14 +0000)]
Clean up use of Options::enableConcurrentJIT().
<https://webkit.org/b/129582>

Reviewed by Filip Pizlo.

DFG Driver was conditionally checking Options::enableConcurrentJIT()
only if ENABLE(CONCURRENT_JIT).  Otherwise, it bypasses it with a local
enableConcurrentJIT set to false.

Instead we should configure Options::enableConcurrentJIT() to be false
in Options.cpp if !ENABLE(CONCURRENT_JIT), and DFG Driver should always
check Options::enableConcurrentJIT().  This makes the code read a little
cleaner.

* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

6 years ago[iOS][WK2] Pages using tiled compositing layers allocate too many tiles on zoom
benjamin@webkit.org [Sun, 2 Mar 2014 23:13:46 +0000 (23:13 +0000)]
[iOS][WK2] Pages using tiled compositing layers allocate too many tiles on zoom
https://bugs.webkit.org/show_bug.cgi?id=129471

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-03-02
Reviewed by Simon Fraser.

Source/WebCore:

A few issues with TileController were causing sublayers of the root layers
to tile incorrect surfaces on zoom.

First, the exposedRect API was not updating the sublayers. The layers go correctly
into tiling mode, but the tiles cover the full document instead of the visible area.

The other major issue was the margins being applied to the coverage size in document
coordinates. Since each margin is 512px, the total coverage size after zoom was
gigantic.

To solve this, this patch switch from the exposedRect API to the generic concept
of VisibleExtentContentRect introduced for iOS WebKit1.

* WebCore.exp.in:
* platform/ScrollView.h:
Define a VisibleExtentContentRect on the scrollview itself when there is no
platformWidget().
The case with inside frame is untested due to stability issues :(.
(see <rdar://problem/16199219>)

* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::computeTileCoverageRect):
Remove the margin from the tile coverage.

On iOS, m_tileCoverage is always zero at the moment. Previously, the tile coverage
was artificially extended by the margins. With the margins removed, I temporarily added
a factor of 1.5.
ViewUpdateDispatcher has all the information to compute a great tile coverage, I will need
a follow up patch to fix that.

* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::visibleExtentContentRect):
(WebCore::ScrollView::setVisibleExtentContentRect):

Source/WebKit2:

* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
A few interesting changes here:
-Now that we do not use setExposedRect, we can pass the exposed area directly
 to the drawing area since everything is now in content coordinates :)
-The scale is now converted to float before being compared to the Page's scaleFactor.
 The page's scalefactor being a float, the comparison was failing most of the time.

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setVisibleExtentContentRect):

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

6 years agoSort Mac platform export files so they merge better
darin@apple.com [Sun, 2 Mar 2014 22:35:36 +0000 (22:35 +0000)]
Sort Mac platform export files so they merge better
https://bugs.webkit.org/show_bug.cgi?id=129581

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.exp.in: Ran the new sort-export-file on this.

Source/WebKit/mac:

* WebKit.exp: Ran the new sort-export-file on this.

Tools:

* Scripts/sort-export-file: Added. Quickly whipped together script that sorts
Mac export files in a "canonical" order for this project.

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

6 years agoAdd protected casting to FilterOperation classes.
dino@apple.com [Sun, 2 Mar 2014 22:26:05 +0000 (22:26 +0000)]
Add protected casting to FilterOperation classes.
https://bugs.webkit.org/show_bug.cgi?id=124062

Reviewed by Sam Weinig.

Source/WebCore:

Use the type cast macro generators to produce some toFilterOperation-style
functions, and then use them in our PlatformCA filter code.

Test: css3/filters/animation-from-initial-values-with-color-matrix.html

* platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Use the toFilterOperation methods, in
some cases removing the unnecessary double cast.
(PlatformCAFilters::filterValueForOperation):
(PlatformCAFilters::colorMatrixValueForFilter):
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::BasicColorMatrixFilterOperation::blend):
(WebCore::BasicColorMatrixFilterOperation::operator==): Move this to the .cpp file so it can use the casting methods.
(WebCore::BasicComponentTransferFilterOperation::blend):
(WebCore::BasicComponentTransferFilterOperation::operator==): Ditto.
* platform/graphics/filters/FilterOperation.h: Add the casting macros.

LayoutTests:

* css3/filters/animation-from-initial-values-with-color-matrix-expected.html: Added.
* css3/filters/animation-from-initial-values-with-color-matrix.html: Added.

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

6 years agoFix srcset related bugs
commit-queue@webkit.org [Sun, 2 Mar 2014 22:22:10 +0000 (22:22 +0000)]
Fix srcset related bugs
https://bugs.webkit.org/show_bug.cgi?id=129539

Source/WebCore:

Fixed a bug reported against Blink's srcset implementation at https://code.google.com/p/chromium/issues/detail?id=347998
When both src and srcset had only 1x descriptors and the DPR was higher than 1, the src's resource was picked.

Also fixed the invalid descriptor handling, which wasn't aligned with the spec, and therefore was not as forward compatible as it should be.
Invalid descriptors caused the entire resource to be ignored, rather than just the descriptors themselves.

Patch by Yoav Weiss <yoav@yoav.ws> on 2014-03-02
Reviewed by Andreas Kling.

Tests: fast/hidpi/image-srcset-invalid-descriptor.html
       fast/hidpi/image-srcset-src-selection-1x-both.html

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseDescriptors):
(WebCore::parseImagesWithScaleFromSrcsetAttribute):
(WebCore::bestFitSourceForImageAttributes):

LayoutTests:

These tests make sure that:
1. Invalid srcset descriptors are handled according to the spec. The invalid descriptors are ignored, but the resource is not.
2. When both src and srcset have only 1x descriptors and the DPR is higher than 1, the srcset's resource is picked.

I've also fixed the invalid inputs test, which was faulty.

Patch by Yoav Weiss <yoav@yoav.ws> on 2014-03-02
Reviewed by Andreas Kling.

* fast/hidpi/image-srcset-invalid-descriptor-expected.txt: Added.
* fast/hidpi/image-srcset-invalid-descriptor.html: Added.
* fast/hidpi/image-srcset-invalid-inputs-correct-src.html:
* fast/hidpi/image-srcset-src-selection-1x-both-expected.txt: Added.
* fast/hidpi/image-srcset-src-selection-1x-both.html: Added.
* fast/hidpi/resources/srcset-helper.js:
(runTest):

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

6 years agoSplit UserActivity, simplify PageThrottler
barraclough@apple.com [Sun, 2 Mar 2014 20:44:17 +0000 (20:44 +0000)]
Split UserActivity, simplify PageThrottler
https://bugs.webkit.org/show_bug.cgi?id=129551

Reviewed by Darin Adler.

The class UserActivity currently implements two things – a hysteresis mechanism, and
an abstraction of NSActivity controlled by that mechanism. PageThrottler implements
its own hysteresis mechanism, which directly controls DOM timer throttling and also
controls a couple of UserActivities, giving a total of 3 separate hysteresis mechanisms,
layered two deep.

Split UserActivity into three, with HysteresisActivity implementing an abstract hysteresis
mechanism, UserActivity::Impl controlling the NSActivity, and then UserActivity combining
these two back together. The interface to UserActivity is unchanged.

Remove PageThrottler's bespoke hysteresis, replacing it with a use of HysteresisActivity.
Replace the two UserActivities with a single UserActivity::Impl, so there are no longer
layered hysteresis mechanisms.

* WebCore.exp.in:
    - exports changed.
* WebCore.xcodeproj/project.pbxproj:
    - added HysteresisActivity.h.
* page/PageThrottler.cpp:
(WebCore::PageThrottler::PageThrottler):
    - if the page starts visible, begin activity. If it starts hidden throttle DOM timers.
(WebCore::PageThrottler::hiddenPageDOMTimerThrottlingStateChanged):
    - when the DOM timer throttling setting changes, make sure we update.
(WebCore::PageThrottler::incrementActivityCount):
(WebCore::PageThrottler::decrementActivityCount):
    - when m_activityCount changes update the hysteresis state.
(WebCore::PageThrottler::updateHysteresis):
(WebCore::PageThrottler::setViewState):
    - when IsVisuallyIdle changes update the hysteresis state.
(WebCore::PageThrottler::started):
(WebCore::PageThrottler::stopped):
    - callbacks from HysteresisActivity, these control m_activity and DOM timer throttling.
* page/PageThrottler.h:
(WebCore::PageThrottler::didReceiveUserInput):
(WebCore::PageThrottler::pluginDidEvaluate):
    - call impulse to temporarily enable the activity.
* platform/HysteresisActivity.h: Copied from Source/WebCore/platform/UserActivity.h.
(WebCore::HysteresisActivity::HysteresisActivity):
    - constructor takes a delegate optionally a timeout.
(WebCore::HysteresisActivity::start):
    - start activity immediately. If stopped, call started method on delegate. If in timeout period, cancel the timer.
(WebCore::HysteresisActivity::stop):
    - stop activity after hysteresis. If started, initiate timeout period.
(WebCore::HysteresisActivity::impulse):
    - ensure activity for at least the timeout period.
(WebCore::HysteresisActivity::hysteresisTimerFired):
    - delayed stop - when the timer fires call stopped on the delegate.
* platform/UserActivity.cpp:
(WebCore::UserActivity::Impl::Impl):
(WebCore::UserActivity::Impl::beginActivity):
(WebCore::UserActivity::Impl::endActivity):
    - nop implementation.
(WebCore::UserActivity::UserActivity):
    - UserActivity maintains existing interface with hysteresis.
(WebCore::UserActivity::started):
(WebCore::UserActivity::stopped):
    - callbacks from HysteresisTimer; forward to Impl.
* platform/UserActivity.h:
* platform/mac/UserActivityMac.mm:
(WebCore::UserActivity::Impl::Impl):
    - UserActivity::Impl, abstraction for NSActivity without added hysteresis.
(WebCore::UserActivity::Impl::beginActivity):
    - allocate NSActivity.
(WebCore::UserActivity::Impl::endActivity):
    - release NSActivity.

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

6 years agoDocumentLoader should keep maps of ResourceLoaders instead of sets
bburg@apple.com [Sun, 2 Mar 2014 20:34:51 +0000 (20:34 +0000)]
DocumentLoader should keep maps of ResourceLoaders instead of sets
https://bugs.webkit.org/show_bug.cgi?id=129388

Reviewed by Darin Adler.

For web replay, we need to be able to pull a ResourceLoader instance by
identifier from the DocumentLoader. This is easy to do if we convert
ResourceLoaderSet to ResourceLoaderMap, keyed by the loader's identifier.

Added assertions whenever adding or removing from the map to ensure
that we don't try to add duplicates or resources with zero identifiers.

No new tests required. No functionality was added.

* loader/DocumentLoader.cpp:
(WebCore::cancelAll):
(WebCore::setAllDefersLoading):
(WebCore::areAllLoadersPageCacheAcceptable):
(WebCore::DocumentLoader::addSubresourceLoader):
(WebCore::DocumentLoader::removeSubresourceLoader):
(WebCore::DocumentLoader::addPlugInStreamLoader):
(WebCore::DocumentLoader::removePlugInStreamLoader):
(WebCore::DocumentLoader::subresourceLoaderFinishedLoadingOnePart):
* loader/DocumentLoader.h:
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::create): Only add the loader
to the document loader's map if it initialized successfully.
The old code was probably leaking resource loaders that failed to
initialize.

* loader/mac/DocumentLoaderMac.cpp:
(WebCore::scheduleAll):
(WebCore::unscheduleAll):

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

6 years agoReactivate SVG mask-type tests for Mac
krit@webkit.org [Sun, 2 Mar 2014 19:52:16 +0000 (19:52 +0000)]
Reactivate SVG mask-type tests for Mac
https://bugs.webkit.org/show_bug.cgi?id=129577

Reviewed by Darin Adler.

Reduce mask-type tests to the minimum to test the feature.

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:
* svg/masking/mask-type-alpha-expected.svg:
* svg/masking/mask-type-alpha.svg:
* svg/masking/mask-type-luminance-expected.svg:
* svg/masking/mask-type-luminance.svg:
* svg/masking/mask-type-not-set-expected.svg:
* svg/masking/mask-type-not-set.svg:

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

6 years agoChange public text iterator API implementations to not depend on 16-bit character...
darin@apple.com [Sun, 2 Mar 2014 19:36:12 +0000 (19:36 +0000)]
Change public text iterator API implementations to not depend on 16-bit character pointers
https://bugs.webkit.org/show_bug.cgi?id=129566

Reviewed by Anders Carlsson.

Source/WebKit/mac:

* WebView/WebTextIterator.mm:
(-[WebTextIterator initWithRange:]): Use make_unique instead of adoptPtr.
(-[WebTextIterator advance]): Clear out the upconverted text since we are moving on to the
next text.
(-[WebTextIterator currentTextPointer]): Upconvert if we have 8-bit text.
(-[WebTextIterator currentTextLength]): Call TextIterator::text().length() since we will
probably be removing TextIterator::length eventually.

Source/WebKit2:

* WebView/WebTextIterator.mm:
(-[WKDOMTextIterator initWithRange:]): Use make_unique instead of adoptPtr.
(-[WKDOMTextIterator advance]): Clear out the upconverted text since we are moving on to the
next text.
(-[WKDOMTextIterator currentTextPointer]): Upconvert if we have 8-bit text.
(-[WKDOMTextIterator currentTextLength]): Call TextIterator::text().length() since we will
probably be removing TextIterator::length eventually.

* WebProcess/WebCoreSupport/WebEditorClient.cpp: Removed unneded include of TextIterator.h.
* WebProcess/WebPage/WebPage.cpp: Ditto.

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

6 years agoRemove path to non-existent SVG clip-path test from TestExpectations
krit@webkit.org [Sun, 2 Mar 2014 18:25:32 +0000 (18:25 +0000)]
Remove path to non-existent SVG clip-path test from TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=129574

Reviewed by Simon Fraser.

The test was transformed to a ref test and moved to a different location.
It passes on all platforms now.

* platform/gtk/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:

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

6 years agoSupport ENABLE_ENCRYPTED_MEDIA in cmake builds
commit-queue@webkit.org [Sun, 2 Mar 2014 17:55:29 +0000 (17:55 +0000)]
Support ENABLE_ENCRYPTED_MEDIA in cmake builds
https://bugs.webkit.org/show_bug.cgi?id=129575

Patch by Dirkjan Ochtman <d.ochtman@activevideo.com> on 2014-03-02
Reviewed by Philippe Normand.

.:

* Source/cmake/OptionsEfl.cmake:
Enabled ENABLE_ENCRYPTED_MEDIA{,_V2} usage.
* Source/cmake/OptionsGTK.cmake:
Enabled ENABLE_ENCRYPTED_MEDIA{,_V2} usage.
* Source/cmake/WebKitFeatures.cmake:
Enabled ENABLE_ENCRYPTED_MEDIA{,_V2} usage.
* Source/cmakeconfig.h.cmake:
Added ENABLE_ENCRYPTED_MEDIA{,_V2} flags.

Source/WebCore:

No new tests, only fixes the build.

* CMakeLists.txt:
Add support for ENABLE_ENCRYPTED_MEDIA.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::close):
Assign nullptr instead of 0 to OwnPtr to appease gcc-4.7.

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

6 years agoCut down use of OwnPtr within WTF itself
darin@apple.com [Sun, 2 Mar 2014 17:19:59 +0000 (17:19 +0000)]
Cut down use of OwnPtr within WTF itself
https://bugs.webkit.org/show_bug.cgi?id=129567

Reviewed by Sam Weinig.

* wtf/RefCounted.h: Removed OwnPtr includes.

* wtf/StreamBuffer.h: Removed OwnPtr includes and switched to use
std::make_unique and std::unique_ptr instead.

* wtf/Threading.cpp: Removed OwnPtr includes.
* wtf/ThreadingPthreads.cpp: Ditto.
* wtf/Vector.h: Ditto.

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

6 years agoUpdating some WebRTC and MediaStream LayoutTests
thiago.lacerda@openbossa.org [Sun, 2 Mar 2014 15:36:53 +0000 (15:36 +0000)]
Updating some WebRTC and MediaStream LayoutTests
https://bugs.webkit.org/show_bug.cgi?id=129442

Reviewed by Eric Carlson.

Due to changes in JavaScriptCore (in r163562), some LayoutTests in fast/mediastream needed to be updated:
    - MediaStreamTrack.html: checking hasOwnProperty in __proto__ as well, until CustomGetter properties are
    moved to the prototype chain.
    - RTCIceCandidate.html and RTCSessionDescription.html: JSON.stringify are not considering properties in
    __proto__, so remove this for now.

* fast/mediastream/MediaStreamTrack-expected.txt:
* fast/mediastream/MediaStreamTrack.html:
* fast/mediastream/RTCIceCandidate-expected.txt:
* fast/mediastream/RTCIceCandidate.html:
* fast/mediastream/RTCPeerConnection-have-local-answer.html: Removed. Other tests already test what this one was
testing
* fast/mediastream/RTCSessionDescription-expected.txt:
* fast/mediastream/RTCSessionDescription.html:

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

6 years ago[GTK] Make impossible to build with <webkit2/webkit2.h> and <webkit2/webkit-web-exten...
carlosgc@webkit.org [Sun, 2 Mar 2014 14:59:47 +0000 (14:59 +0000)]
[GTK] Make impossible to build with <webkit2/webkit2.h> and <webkit2/webkit-web-extension.h> included together
https://bugs.webkit.org/show_bug.cgi?id=129549

Reviewed by Martin Robinson.

Add a compile error to prevent mixing the UI and web process APIs.

* UIProcess/API/gtk/webkit2.h:
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:

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

6 years ago[GTK] Remove the include dir of the C API from the WebKit2 pkg-config file
carlosgc@webkit.org [Sun, 2 Mar 2014 14:56:54 +0000 (14:56 +0000)]
[GTK] Remove the include dir of the C API from the WebKit2 pkg-config file
https://bugs.webkit.org/show_bug.cgi?id=129543

Reviewed by Martin Robinson.

We are not installing the C API headers anymore.

* webkit2gtk.pc.in:

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

6 years agoFix the Mac build.
timothy_horton@apple.com [Sun, 2 Mar 2014 05:35:16 +0000 (05:35 +0000)]
Fix the Mac build.

* UIProcess/mac/ViewGestureController.messages.in:

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

6 years agoWebKit2 View Gestures (Smart Magnification): Support for iOS
timothy_horton@apple.com [Sun, 2 Mar 2014 05:25:27 +0000 (05:25 +0000)]
WebKit2 View Gestures (Smart Magnification): Support for iOS
https://bugs.webkit.org/show_bug.cgi?id=129146
<rdar://problem/16032668>

Reviewed by Benjamin Poulain.

Add support for double-tap smart magnification on iOS.

* DerivedSources.make:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
WKContentView is no longer API, so it can know about WKWebView
and will always have one.

(-[WKWebView contentView:didCommitLayerTree:WebKit::]):
Don't replace the zoom scale if we're currently animating.

(-[WKWebView _takeViewSnapshot]):
Rename.

(-[WKWebView _zoomToPoint:WebCore::atScale:]):
(-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
(constrainContentOffset):
(-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]):
(-[WKWebView _zoomOutWithOrigin:]):
(-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
Add _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:
and _zoomOutWithOrigin: as internal API, for use by SmartMagnificationController via WKContentView.
These will use some heuristics to generally center the target rect in the view
in a way that should match WebKit1 fairly closely.

* UIProcess/API/Cocoa/WKWebViewInternal.h:
Don't use the WKContentViewDelegate protocol for things that don't belong there.

* UIProcess/ios/SmartMagnificationController.h: Added.
* UIProcess/ios/SmartMagnificationController.messages.in: Added.
* UIProcess/ios/SmartMagnificationController.mm: Added.
(WebKit::SmartMagnificationController::SmartMagnificationController):
(WebKit::SmartMagnificationController::~SmartMagnificationController):
(WebKit::SmartMagnificationController::handleSmartMagnificationGesture):
(WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
SmartMagnificationController sits off of WKContentView, and sends/receives
messages to the WebProcess to do the smart magnification hit-testing.

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]):
As before, teach WKContentView about its owning WKWebView.

(-[WKContentView _takeViewSnapshot]):
Rename.

(-[WKContentView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
(-[WKContentView _zoomOutWithOrigin:]):
Forward _zoomToRect:::::: and _zoomOutWithOrigin: to WKWebView.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _doubleTapRecognized:]):
(-[WKContentView _twoFingerDoubleTapRecognized:]):
Forward double tap to the SmartMagnificationController.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureController.messages.in:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
Retrieve the minimum/maximum viewport scale from the WebProcess.

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

* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
(WebKit::ViewGestureGeometryCollector::dispatchDidCollectGeometryForSmartMagnificationGesture):
(WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
(WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture):
Factor out code to send the geometry back to the UI process.

* WebProcess/WebPage/ViewGestureGeometryCollector.h:
* WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
We should have a ViewGestureGeometryCollector on iOS too.

* WebCore.exp.in:
Add an export.

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

6 years agoUnreviewed, rolling out r164929 and r164934.
commit-queue@webkit.org [Sun, 2 Mar 2014 03:58:59 +0000 (03:58 +0000)]
Unreviewed, rolling out r164929 and r164934.
http://trac.webkit.org/changeset/164929
http://trac.webkit.org/changeset/164934
https://bugs.webkit.org/show_bug.cgi?id=129570

Caused assertions on two srcset tests (Requested by ap on
#webkit).

Source/WebCore:

* html/parser/HTMLParserIdioms.cpp:
(WebCore::isHTMLSpaceOrComma):
(WebCore::parseImagesWithScaleFromSrcsetAttribute):
(WebCore::bestFitSourceForImageAttributes):

LayoutTests:

* fast/hidpi/image-srcset-invalid-descriptor-expected.txt: Removed.
* fast/hidpi/image-srcset-invalid-descriptor.html: Removed.
* fast/hidpi/image-srcset-invalid-inputs-correct-src.html:
* fast/hidpi/image-srcset-src-selection-1x-both-expected.txt: Removed.
* fast/hidpi/image-srcset-src-selection-1x-both.html: Removed.
* fast/hidpi/resources/srcset-helper.js:
(runTest):

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

6 years agoSource/JavaScriptCore: This shouldn't have been a layout test since it runs only...
fpizlo@apple.com [Sun, 2 Mar 2014 03:45:06 +0000 (03:45 +0000)]
Source/JavaScriptCore: This shouldn't have been a layout test since it runs only under jsc. Moving it to JSC
stress tests.

* tests/stress/generational-opaque-roots.js: Copied from LayoutTests/js/script-tests/generational-opaque-roots.js.

LayoutTests: This shouldn't be a layout test since it runs only under jsc. Moving it to JSC
stress tests.

* js/script-tests/generational-opaque-roots.js: Removed.

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

6 years agoBuild fix.
mitz@apple.com [Sun, 2 Mar 2014 00:35:13 +0000 (00:35 +0000)]
Build fix.

* html/parser/HTMLParserIdioms.cpp: Removed an unused function.

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

6 years agoEnsure keySplines is valid in SMIL animations
ddkilzer@apple.com [Sun, 2 Mar 2014 00:20:58 +0000 (00:20 +0000)]
Ensure keySplines is valid in SMIL animations
<http://webkit.org/b/129547>
<rdar://problem/15676128>

Reviewed by Darin Adler.

Merged from Blink (patch by Philip Rogers):
https://src.chromium.org/viewvc/blink?revision=156452&view=revision
http://crbug.com/276111

    This patch fixes a crash in SMIL animations when keySplines are not
    specified. The SMIL spec is clear on this:
    http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncCalcMode
    "If there are any errors in the keyTimes specification (bad values,
    too many or too few values), the animation will have no effect."

    This patch simply checks that keyTimes is not empty. Previously,
    splinesCount was set to be m_keySplines.size() + 1 in
    SVGAnimationElement.cpp; this patch changes splinesCount to be equal
    to m_keySplines.size() to make the logic easier to follow and to
    match other checks in SVGAnimationElement::startedActiveInterval.

Source/WebCore:

Test: svg/animations/animate-keysplines-crash.html

* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::startedActiveInterval):

LayoutTests:

* svg/animations/animate-keysplines-crash-expected.txt: Added.
* svg/animations/animate-keysplines-crash.html: Added.

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

6 years agoTighten minimumRegisterRequirements()
benjamin@webkit.org [Sat, 1 Mar 2014 23:50:17 +0000 (23:50 +0000)]
Tighten minimumRegisterRequirements()
https://bugs.webkit.org/show_bug.cgi?id=129538

Reviewed by Andreas Kling.

Source/WebCore:

Fix small things that made minimumRegisterRequirements() a little optimistic
when dealing with attributes.

Test: fast/selectors/adjacent-descendant-tail-register-requirement.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
Attribute Set does not do value matching, the case sensitive value matching is irrelevant
The problem is that flag is also used by minimumRegisterRequirements()
to find if one more register is needed.

Set the flag to case sensitive to avoid reserving one extra register.

(WebCore::SelectorCompiler::minimumRegisterRequirements):
Use a new backtrackingFlag to know if there is a descendant tail, thus a backtracking register
reserved.
This is better than using the backtracking action because the backtracking chain could be
an adjacent chain inside a descendant chain.

The flags are designed for that, just set one for minimumRegisterRequirements().

The 2 extra registers for the attribute count and address become limited to all attributes
except the last one. We don't keep a copy for the last matching, those registers were not needed.

(WebCore::SelectorCompiler::SelectorCodeGenerator::computeBacktrackingInformation):

LayoutTests:

* fast/selectors/adjacent-descendant-tail-register-requirement-expected.txt: Added.
* fast/selectors/adjacent-descendant-tail-register-requirement.html: Added.

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

6 years ago[iOS] selectionImageForcingBlackText should return autoreleased object
psolanki@apple.com [Sat, 1 Mar 2014 23:31:03 +0000 (23:31 +0000)]
[iOS] selectionImageForcingBlackText should return autoreleased object
https://bugs.webkit.org/show_bug.cgi?id=129437
<rdar://problem/15810384>

Reviewed by Darin Adler.

Source/WebCore:

* bindings/objc/DOM.mm:
(-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):

Source/WebKit/mac:

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

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

6 years agoSome small modernizing tweaks to the coding style guide
darin@apple.com [Sat, 1 Mar 2014 23:30:51 +0000 (23:30 +0000)]
Some small modernizing tweaks to the coding style guide
https://bugs.webkit.org/show_bug.cgi?id=129427

Reviewed by Alexey Proskuryakov.

My intent here was originally to do the nullptr style guide update, but that was already done.
I did some other improvements. There's still quite a bit to do -- the guide is out of date in
a number of subtle ways.

* coding/coding-style.html: Change "left side operator" example to be a more modern example
without non-WebKit-style abbreviations and such. Use auto& instead of const auto& in for loop
example, since that's normally preferred. Changed section title to say "zero" instead of "0".
Use words instead of abbreviations in code examples. Show that a modern C++ for loop is preferred
over index iteration in vector iteration example and also showed use of unsigned rather than
size_t since that is almost always what we want. Eliminated the use of PassOwnPtr in the "return
a newly created object" example. Use references instead of pointers in one example.

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

6 years agoFix srcset related bugs
commit-queue@webkit.org [Sat, 1 Mar 2014 23:28:40 +0000 (23:28 +0000)]
Fix srcset related bugs
https://bugs.webkit.org/show_bug.cgi?id=129539

Source/WebCore:

Fixed a bug reported against Blink's srcset implementation at https://code.google.com/p/chromium/issues/detail?id=347998
When both src and srcset had only 1x descriptors and the DPR was higher than 1, the src's resource was picked.

Also fixed the invalid descriptor handling, which wasn't aligned with the spec, and therefore was not as forward compatible as it should be.
Invalid descriptors caused the entire resource to be ignored, rather than just the descriptors themselves.

Patch by Yoav Weiss <yoav@yoav.ws> on 2014-03-01
Reviewed by Andreas Kling.

Tests: fast/hidpi/image-srcset-invalid-descriptor.html
       fast/hidpi/image-srcset-src-selection-1x-both.html

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseDescriptors):
(WebCore::parseImagesWithScaleFromSrcsetAttribute):
(WebCore::bestFitSourceForImageAttributes):

LayoutTests:

These tests make sure that:
1. Invalid srcset descriptors are handled according to the spec. The invalid descriptors are ignored, but the resource is not.
2. When both src and srcset have only 1x descriptors and the DPR is higher than 1, the srcset's resource is picked.

I've also fixed the invalid inputs test, which was faulty.

Patch by Yoav Weiss <yoav@yoav.ws> on 2014-03-01
Reviewed by Andreas Kling.

* fast/hidpi/image-srcset-invalid-descriptor-expected.txt: Added.
* fast/hidpi/image-srcset-invalid-descriptor.html: Added.
* fast/hidpi/image-srcset-invalid-inputs-correct-src.html:
* fast/hidpi/image-srcset-src-selection-1x-both-expected.txt: Added.
* fast/hidpi/image-srcset-src-selection-1x-both.html: Added.
* fast/hidpi/resources/srcset-helper.js:
(runTest):

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