WebKit-https.git
4 years ago[GTK] Fix HPPA build
berto@igalia.com [Tue, 7 Apr 2015 06:25:10 +0000 (06:25 +0000)]
[GTK] Fix HPPA build
https://bugs.webkit.org/show_bug.cgi?id=143453

Reviewed by Darin Adler.

Add HPPA to the list of supported CPUs.

* CMakeLists.txt:

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

4 years agoBing video search result pages are not PageCacheable
cdumez@apple.com [Tue, 7 Apr 2015 06:22:59 +0000 (06:22 +0000)]
Bing video search result pages are not PageCacheable
https://bugs.webkit.org/show_bug.cgi?id=143463
<rdar://problem/20440916>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Bing video search result pages are not PageCacheable (tested on iOS).
It both:
- is bad for power usage as it causes a reload when clicking one of the
  results then navigating back in history.
- degrades user experience because the results page uses infinite
  scrolling and the scroll position is not properly restored when
  navigating back, not to mention the user has to wait for the reload
  to complete.

The issue was that the bing search page was doing a ping load when
clicking on one of the search results. The ping load was done by
create an image and its 'src' attribute to the ping URL. This load
usually did not have time to complete when navigating away so we would
cancel it and the main document would end up with an error that would
prevent the page from entering the page cache. We already have code
making sure load cancellations do not prevent page caching as long as
the loads are for XHR or images. However, the latter check was broken
in the case where the ResourceRequest's cachePartition was non-empty.
This is because the check was using the MemoryCache::ResourceForUrl()
API which rarely does what we want because it will request a dummy
ResourceRequest (without cachePartition) and then call
MemoryCache::resourceForRequest(). This patch updates the check
to use resourceForRequest() directly as we have the ResourceRequest
at this point.

This patch also gets rid of the  MemoryCache::ResourceForUrl() API as
it rarely does what we want and it is bug prone. It was only used in
2 places, one of them causing this bug and the other in Internals.

Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
       http/tests/navigation/page-cache-pending-image-load.html

* loader/DocumentLoader.cpp:
(WebCore::areAllLoadersPageCacheAcceptable):
Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
we have the ResourceRequest and calling resourceForUrl() would loose
the cachePartition.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::resourceForURL): Deleted.
Drop this API as it is bug prone and rarely does what we want.

* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):
Update call to create a dummy ResourceRequest and call
resourceForRequest() instead of resourceForUrl(), as this API no
longer exists. The new code also set the cachePartition on the
dummy request so that this function actually behaves as expected
if the cachePartition in the memory cache is non-empty.

Source/WebKit/mac:

Fix the iOS / WK1 build by using MemoryCache::resourceForRequest()
instead of resourceForUrl().

* Misc/WebCache.mm:
(+[WebCache imageForURL:]):

LayoutTests:

Add layout tests to confirm that a pending image load does not prevent
a page from entering the page cache. There are 2 tests, once that cover
the case where the request's cachePartion is empty (passing without the
fix), and another where the request's cachePartition is non-empty
(which only passes with the fix).

* http/tests/navigation/page-cache-pending-image-load-cache-partition-expected.txt: Added.
* http/tests/navigation/page-cache-pending-image-load-cache-partition.html: Added.
* http/tests/navigation/page-cache-pending-image-load-expected.txt: Added.
* http/tests/navigation/page-cache-pending-image-load.html: Added.

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

4 years agohttp/tests/contentfiltering/block-after-redirect.html fails on Windows
aestes@apple.com [Tue, 7 Apr 2015 00:29:39 +0000 (00:29 +0000)]
http/tests/contentfiltering/block-after-redirect.html fails on Windows
https://bugs.webkit.org/show_bug.cgi?id=143460

* platform/win/TestExpectations: Marked test as ImageOnlyFailure.

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

4 years agoCreate the web inspector process pool lazily
andersca@apple.com [Tue, 7 Apr 2015 00:05:28 +0000 (00:05 +0000)]
Create the web inspector process pool lazily
https://bugs.webkit.org/show_bug.cgi?id=143456
rdar://problem/20146520

Reviewed by Mark Lam.

Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
when trying to determine if a given process pool is the inspector process pool.

This should speed up initialization somewhat and avoid creating a storage manager for example.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::inspectorProcessPool):
(WebKit::WebInspectorProxy::isInspectorProcessPool):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):

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

4 years agoUnreviewed, rolling out r182445.
achristensen@apple.com [Mon, 6 Apr 2015 23:24:58 +0000 (23:24 +0000)]
Unreviewed, rolling out r182445.
https://bugs.webkit.org/show_bug.cgi?id=143459

broke 32 bit build (Requested by alexchristensen on #webkit).

Reverted changeset:

"Use content extensions in MiniBrowser."
https://bugs.webkit.org/show_bug.cgi?id=143446
http://trac.webkit.org/changeset/182445

Patch by Commit Queue <commit-queue@webkit.org> on 2015-04-06

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

4 years agoUse content extensions in MiniBrowser.
achristensen@apple.com [Mon, 6 Apr 2015 23:15:49 +0000 (23:15 +0000)]
Use content extensions in MiniBrowser.
https://bugs.webkit.org/show_bug.cgi?id=143446

Patch by Sam Weinig <sam@webkit.org> on 2015-04-06
Reviewed by Alex Christensen.

* MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
* MiniBrowser/mac/AppDelegate.h:
* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate init]):
(-[BrowserAppDelegate showExtensionsManager:]):
(-[BrowserAppDelegate userContentContoller]):
* MiniBrowser/mac/ExtensionManagerWindowController.h: Added.
* MiniBrowser/mac/ExtensionManagerWindowController.m: Added.
(-[ExtensionManagerWindowController init]):
(-[ExtensionManagerWindowController windowDidLoad]):
(-[ExtensionManagerWindowController add:]):
(-[ExtensionManagerWindowController remove:]):
* MiniBrowser/mac/ExtensionManagerWindowController.xib: Added.
* MiniBrowser/mac/MainMenu.xib:

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

4 years agoIn the 64-bit DFG and FTL, Array::Double case for HasIndexedProperty should set its...
mark.lam@apple.com [Mon, 6 Apr 2015 22:48:00 +0000 (22:48 +0000)]
In the 64-bit DFG and FTL, Array::Double case for HasIndexedProperty should set its result to true when all is well.
<https://webkit.org/b/143396>

Reviewed by Filip Pizlo.

The DFG was neglecting to set the result boolean.  The FTL was setting it with
an inverted value.  Both of these are now resolved.

* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileHasIndexedProperty):
* tests/stress/for-in-array-mode.js: Added.
(.):
(test):

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

4 years ago[Win] [SVG -> OTF Converter] Turn off on Windows until I can get the tests under...
mmaxfield@apple.com [Mon, 6 Apr 2015 22:39:07 +0000 (22:39 +0000)]
[Win] [SVG -> OTF Converter] Turn off on Windows until I can get the tests under control

Unreviewed.

* win/tools/vsprops/FeatureDefines.props:

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

4 years agoCombine ActionMenuHitTestResult with WebHitTestResult
beidson@apple.com [Mon, 6 Apr 2015 22:33:57 +0000 (22:33 +0000)]
Combine ActionMenuHitTestResult with WebHitTestResult
https://bugs.webkit.org/show_bug.cgi?id=143444

Reviewed by Beth Dakin.

* Shared/mac/ActionMenuHitTestResult.h: Removed.
* Shared/mac/ActionMenuHitTestResult.mm: Removed.

* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::Data):
(WebKit::WebHitTestResult::Data::encode):
(WebKit::WebHitTestResult::Data::decode):
(WebKit::WebHitTestResult::Data::platformEncode):
(WebKit::WebHitTestResult::Data::platformDecode):
* Shared/WebHitTestResult.h:
* Shared/mac/WebHitTestResult.mm: Added.
(WebKit::WebHitTestResult::Data::platformEncode):
(WebKit::WebHitTestResult::Data::platformDecode):

* UIProcess/API/mac/WKView.mm:
(-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
(-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformActionMenuHitTest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformActionMenuHitTest):
* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController willDestroyView:]):
(-[WKActionMenuController _clearActionMenuState]):
(-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
(-[WKActionMenuController _hitTestResultDataImage]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _copyImage:]):
(-[WKActionMenuController _addImageToPhotos:]):
(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
(-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
(-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
(-[WKActionMenuController _webHitTestResult]):
(-[WKActionMenuController _defaultMenuItems]):
(-[WKActionMenuController _hitTestResultImage]): Deleted.
* UIProcess/mac/WKImmediateActionController.h:
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController willDestroyView:]):
(-[WKImmediateActionController _clearImmediateActionState]):
(-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
(-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
(-[WKImmediateActionController _webHitTestResult]):
(-[WKImmediateActionController _defaultAnimationController]):
(-[WKImmediateActionController _updateImmediateActionItem]):
(-[WKImmediateActionController _menuItemForDataDetectedText]):
(-[WKImmediateActionController _animationControllerForText]):
(-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):

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

4 years ago[GTK] install-dependencies should prefer dnf to yum
commit-queue@webkit.org [Mon, 6 Apr 2015 22:27:09 +0000 (22:27 +0000)]
[GTK] install-dependencies should prefer dnf to yum
https://bugs.webkit.org/show_bug.cgi?id=143441

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2015-04-06
Reviewed by Martin Robinson.

Test for the existance of dnf before yum, and only try to use yum if dnf does not exist.

* gtk/install-dependencies:

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

4 years ago[iOS] 'make clean' fails in Tools/WebKitTestRunner
aestes@apple.com [Mon, 6 Apr 2015 22:16:30 +0000 (22:16 +0000)]
[iOS] 'make clean' fails in Tools/WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=143455

Reviewed by Dan Bernstein.

This Makefile adds '-target WebKitTestRunnerApp' to OTHER_OPTIONS during iOS builds, but the top-level
Makefile.shared adds '-alltargets' for clean builds, and xcodebuild does not allow both -target and -alltargets.

* WebKitTestRunner/Makefile: Don't add '-target WebKitTestRunerApp' to OTHER_OPTIONS on clean builds.

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

4 years agoSynchronize fullscreen animation between processes.
jer.noble@apple.com [Mon, 6 Apr 2015 22:02:46 +0000 (22:02 +0000)]
Synchronize fullscreen animation between processes.
https://bugs.webkit.org/show_bug.cgi?id=143131

Reviewed by Simon Fraser.

Source/WebCore:

Rather than attempt to synchcronize animations across the WebProcess / UIProcess boundary,
do the bounds-change animation in-process by applying a sublayer transformation to the
video layer. This gives the same visual effect as a synchronized bounds animation, but
without needing a synchronization fence. Resolve the difference between the transformation
and bounds by doing a fence-synchronized bounds change after the current animation is
scheduled to complete.

To do this calculation correctly, WebAVPlayer needs to query both the effective
videoLayerFrame and the videoLayerGravity. To that end, add getter methods for
videoLayerFrame() and videoLayerGravity().

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::videoFullscreenGravity):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVVideoLayer dealloc]): Cancel outstanding performSelector requests.
(-[WebAVVideoLayer setBounds:]): Add a scale transform to simulate a bonuds change.
(-[WebAVVideoLayer resolveBounds]): Reset the scale transform and set the bounds.
(WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Set the initial video frame bounds.
(-[WebAVPlayerController layoutSublayersOfLayer:]): Deleted.
* platform/ios/WebVideoFullscreenModel.h:
* platform/ios/WebVideoFullscreenModelVideoElement.h:
* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::videoLayerFrame): Added; simple getter.
(WebVideoFullscreenModelVideoElement::videoLayerGravity): Ditto.

Source/WebKit2:

Support synchronize resizing by animating within the UIProcess. Since setVideoLayerFrameFenced() is now only
ever called from within a 0-duration transaction, make that the official contract of the function and wrap
the WebProcess side of that method in its own 0-duration transaction.

* Platform/spi/ios/BackBoardServicesSPI.h: Added.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WebVideoFullscreenManagerProxy.h:
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Remember the initial rect.
(WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Added; simple getter.
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Use a different synchronization fence primative.
    Save the cached frame value.
(WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Added; simple getter.
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): Save the cached gravity value.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Wrap in a 0-length transaction.

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

4 years agoPerf dashboard should be able to trigger A/B testing jobs for iOS
rniwa@webkit.org [Mon, 6 Apr 2015 21:08:26 +0000 (21:08 +0000)]
Perf dashboard should be able to trigger A/B testing jobs for iOS
https://bugs.webkit.org/show_bug.cgi?id=143398

Reviewed by Chris Dumez.

Fix various bugs in the perf dashboard so that it can schedule A/B testing jobs for iOS.

Also generalized sync-with-buildbot.py slightly to meet the requirements of iOS builders.

* public/api/triggerables.php:
(main): Avoid spitting a warning when $id_to_triggerable doesn't contain the triggerable.
* public/v2/analysis.js:
(App.AnalysisTask.triggerable): Log an error when failed to fetch triggerables for debugging purposes.
* public/v2/app.js:
(App.AnalysisTaskController.updateRootConfigurations): Show 'None' when a revision is missing from
some of the data points. This will happen when we modify the list of projects we build for iOS.
(App.AnalysisTaskController.actions.createTestGroup): Gracefully fail by showing alerts when an user
attempts to create an invalid test group; when there is already another test group of the same or when
only either configuration specifies the revision for some repository.
(App.AnalysisTaskController._updateRootsBySelectedPoints): Fixed a typo: sets[i] -> set.
* public/v2/index.html: Don't show the form to create a new test group if it's not available.
* tools/sync-with-buildbot.py:
(find_request_updates):
(schedule_request): iOS builders take a JSON that contains the list of roots. Generate this JSON when
a dictionary of the form {rootsExcluding: ["WebKit"]} is specified. Also replaced the way we refer to
a revision from $-based text replacements to an explicit dictionary of the form {root: "WebKit"}.
(request_id_from_build): Don't hard code the parameter name here. Retrieve the name from the config.

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

4 years ago[WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker...
cdumez@apple.com [Mon, 6 Apr 2015 20:49:40 +0000 (20:49 +0000)]
[WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()
https://bugs.webkit.org/show_bug.cgi?id=143451
<rdar://problem/20437994>

Reviewed by Anders Carlsson.

Initialize WebProcess::m_webSQLiteDatabaseTracker and
NetworkProcess::m_webSQLiteDatabaseTracker in their respective class
constructors instead of doing it later in the initializeWebProcess() /
initializeNetworkProcess() methods.

If we do it later, it can happen that the tracker gets set after
a SQLiteTransactionInProgressAutoCounter initialization and before
the actual transaction. When this happens, the
SQLiteTransactionInProgressAutoCounter variable fails to increment the
transaction count. Then when the transaction is executed,
SQLiteDatabaseTracker::hasTransactionInProgress() can return false.
This would lead to possible assertions on start up on iOS.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeConnection):
* WebProcess/WebProcess.h:

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

4 years agoSimple line layout: RunResolver::Iterator class cleanup.
zalan@apple.com [Mon, 6 Apr 2015 20:39:11 +0000 (20:39 +0000)]
Simple line layout: RunResolver::Iterator class cleanup.
https://bugs.webkit.org/show_bug.cgi?id=143445

Reviewed by Antti Koivisto.

1. SimpleLineLayout::Run is an intermediate structure and should not be publicly accessible through RunResolver::Iterator.
RunResolver::Run is the class to use to access run properties.
2. Also move advance()/advanceLine() to private. Callers should use LineResolver to advance on lines.

No change in functionality.

* rendering/SimpleLineLayoutResolver.h:

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

4 years agohttps://trac.webkit.org/changeset/182338 introduced a build failure that I
bdakin@apple.com [Mon, 6 Apr 2015 20:26:36 +0000 (20:26 +0000)]
https://trac.webkit.org/changeset/182338 introduced a build failure that I
attempted to fix with https://trac.webkit.org/changeset/182341 , but that disabled
the feature accidentally.  This should do the right thing.

* UIProcess/API/mac/WKView.mm:
(-[WKView pressureChangeWithEvent:]):

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

4 years agoWebKit1.SetAndUpdateCacheModelPreferencesChangeMix fails on some machines
ap@apple.com [Mon, 6 Apr 2015 19:58:05 +0000 (19:58 +0000)]
WebKit1.SetAndUpdateCacheModelPreferencesChangeMix fails on some machines
https://bugs.webkit.org/show_bug.cgi?id=143450

Reviewed by Anders Carlsson.

* TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm: (TestWebKitAPI::TEST):
Make sure that the view is actually closed, regardless of anything else that happens beneath.
Also, removed unnecessary get() calls.

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

4 years ago[ES6] DFG and FTL should be aware of that StringConstructor behavior for symbols...
utatane.tea@gmail.com [Mon, 6 Apr 2015 19:07:12 +0000 (19:07 +0000)]
[ES6] DFG and FTL should be aware of that StringConstructor behavior for symbols becomes different from ToString
https://bugs.webkit.org/show_bug.cgi?id=143424

Reviewed by Geoffrey Garen.

In ES6, StringConstructor behavior becomes different from ToString abstract operations in the spec. (and JSValue::toString).

ToString(symbol) throws a type error.
However, String(symbol) produces SymbolDescriptiveString(symbol).

So, in DFG and FTL phase, they should not inline StringConstructor to ToString.

Now, in the template literals patch, ToString DFG operation is planned to be used.
And current ToString behavior is aligned to the spec (and JSValue::toString) and it's better.
So intead of changing ToString behavior, this patch adds CallStringConstructor operation into DFG and FTL.
In CallStringConstructor, all behavior in DFG analysis is the same.
Only the difference from ToString is, when calling DFG operation functions, it calls
operationCallStringConstructorOnCell and operationCallStringConstructor instead of
operationToStringOnCell and operationToString.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupToStringOrCallStringConstructor):
(JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
(JSC::DFG::FixupPhase::fixupToString): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileToStringOrCallStringConstructorOnCell):
(JSC::DFG::SpeculativeJIT::compileToStringOnCell): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStructureRegistrationPhase.cpp:
(JSC::DFG::StructureRegistrationPhase::run):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileToStringOrCallStringConstructor):
(JSC::FTL::LowerDFGToLLVM::compileToString): Deleted.
* runtime/StringConstructor.cpp:
(JSC::stringConstructor):
(JSC::callStringConstructor):
* runtime/StringConstructor.h:
* tests/stress/symbol-and-string-constructor.js: Added.
(performString):

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

4 years agoUnreviewed, rolling out r182296.
commit-queue@webkit.org [Mon, 6 Apr 2015 18:37:15 +0000 (18:37 +0000)]
Unreviewed, rolling out r182296.
https://bugs.webkit.org/show_bug.cgi?id=143448

This will disturb network cache efficacy logging, we should
reland this later. (Requested by cdumez__ on #webkit).

Reverted changeset:

"[WK2][NetworkCache] Drop HTTP method from NetworkCache::Key"
https://bugs.webkit.org/show_bug.cgi?id=143348
http://trac.webkit.org/changeset/182296

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

4 years agoUse a RenderObject bit for isRenderFlowThread()
simon.fraser@apple.com [Mon, 6 Apr 2015 17:00:54 +0000 (17:00 +0000)]
Use a RenderObject bit for isRenderFlowThread()
https://bugs.webkit.org/show_bug.cgi?id=143439

Reviewed by Darin Adler.

Turning isRenderFlowThread() into a bit in rare data rather than a virtual function reduces
the time under RenderLayer::scrollTo() on a large overflow:scroll table from 56% to 44%.

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
* rendering/RenderFlowThread.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setIsRenderFlowThread):
* rendering/RenderObject.h:
(WebCore::RenderObject::isDragging):
(WebCore::RenderObject::hasReflection):
(WebCore::RenderObject::isRenderFlowThread):
(WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):

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

4 years agoReduce the dependency on Flash in regression tests
ap@apple.com [Mon, 6 Apr 2015 16:28:52 +0000 (16:28 +0000)]
Reduce the dependency on Flash in regression tests
https://bugs.webkit.org/show_bug.cgi?id=143391

Reviewed by Anders Carlsson.

Tools:

* WebKitTestRunner/TestController.cpp: (WTR::TestController::decidePolicyForPluginLoad):
Only allow QuickTime and the test plug-in.

LayoutTests:

* accessibility/inline-block-assertion.html:
* accessibility/plugin.html:
* compositing/geometry/empty-embed-rects.html:
* fast/history/resources/subframe-with-plugin.html:
* fast/images/embed-does-not-propagate-dimensions-to-object-ancestor.html:
* fast/loader/loadInProgress.html:
* fast/replaced/border-radius-clip.html:
* fast/replaced/embed-display-none.html:
* plugins/crash-restoring-plugin-page-from-page-cache.html:
* plugins/object-embed-plugin-scripting.html:
* plugins/resources/plugin-frame.html:
Use TestNetscapePlugin, as the tests don't appear to have any real need for Flash.

* plugins/iframe-shims.html: Removed. This was a test for a chromium only feature
that never existed in WebKit.

* platform/mac/TestExpectations:
* platform/wincairo/TestExpectations:
Removed the deleted plugins/iframe-shims.html.

* platform/mac-wk2/TestExpectations: Skip snapshotting tests that use Flash,
because they make WebKitTestRunner crash now. Marked all other snapshotting tests
as Pass/Failure, because they don't really make any sense, and are only useful for
finsing crashes.

* platform/wk2/TestExpectations: Skipped a few remaining tests that use Flash.
These tests still run (and pass) under WebKit1, regardless of whether Flash is
installed, so they don't seem like very accurate tests.

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

4 years ago[Win] Unreviewed test update after r182369.
bfulgham@apple.com [Mon, 6 Apr 2015 15:49:52 +0000 (15:49 +0000)]
[Win] Unreviewed test update after r182369.

New test does not pass on Windows.

* platform/win/TestExpectations: Skip.

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

4 years ago[Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
mmaxfield@apple.com [Mon, 6 Apr 2015 15:30:49 +0000 (15:30 +0000)]
[Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
https://bugs.webkit.org/show_bug.cgi?id=143402

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-04-06
Reviewed by Darin Adler.

Source/WebCore:

There are a few pieces to the converter that Windows requires that we haven't already
implemented:
1. Checksums were being calculated with the wrong endianness
2. Windows requires a format 4 'cmap' subtable in addition to the format 12 one we already
were using
3. Windows requires a reference to a Private DICT inside the CFF table, even if the DICT
is of 0 length.

Covered by all our existing SVG font tests.

* svg/SVGFontFaceElement.h: Add capHeight accessor.
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::capHeight): Ditto.
* svg/SVGToOTFConversion.cpp: Update the conversion process according to the above
requirements.
(WebCore::SVGToOTFFontConverter::appendFormat12CMAPTable):
(WebCore::SVGToOTFFontConverter::appendFormat4CMAPTable):
(WebCore::SVGToOTFFontConverter::appendCMAPTable): Use helpers.
(WebCore::SVGToOTFFontConverter::appendHHEATable): Use member variables.
(WebCore::SVGToOTFFontConverter::appendOS2Table): Update to version 2.
(WebCore::SVGToOTFFontConverter::appendCFFTable): Create a reference to a
zero-sized Private DICT
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Populate member
variables.
(WebCore::SVGToOTFFontConverter::calculateChecksum): Flip endianness

WebKitLibraries:

* win/tools/vsprops/FeatureDefines.props: Enable the define.

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

4 years agoReturn Optional<uint32_t> from PropertyName::asIndex
utatane.tea@gmail.com [Mon, 6 Apr 2015 12:40:33 +0000 (12:40 +0000)]
Return Optional<uint32_t> from PropertyName::asIndex
https://bugs.webkit.org/show_bug.cgi?id=143422

Reviewed by Darin Adler.

Source/JavaScriptCore:

PropertyName::asIndex returns uint32_t and use UINT_MAX as NotAnIndex.
But it's not obvious to callers.

This patch changes
1. PropertyName::asIndex() to return Optional<uint32_t> and
2. function name `asIndex()` to `parseIndex()`.
It forces callers to check the value is index or not explicitly.

* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFor):
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFor):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitDirectPutById):
* jit/Repatch.cpp:
(JSC::emitPutTransitionStubAndGetOldStructure):
* jsc.cpp:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSort):
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::getOwnPropertySlot):
(JSC::GenericArguments<Type>::put):
(JSC::GenericArguments<Type>::deleteProperty):
(JSC::GenericArguments<Type>::defineOwnProperty):
* runtime/Identifier.h:
(JSC::parseIndex):
(JSC::Identifier::isSymbol):
* runtime/JSArray.cpp:
(JSC::JSArray::defineOwnProperty):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot):
(JSC::JSGenericTypedArrayView<Adaptor>::put):
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty):
(JSC::JSGenericTypedArrayView<Adaptor>::deleteProperty):
* runtime/JSObject.cpp:
(JSC::JSObject::put):
(JSC::JSObject::putDirectAccessor):
(JSC::JSObject::putDirectCustomAccessor):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::putDirectMayBeIndex):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
(JSC::JSObject::getOwnPropertySlot):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::putDirectInternal):
* runtime/JSString.cpp:
(JSC::JSString::getStringPropertyDescriptor):
* runtime/JSString.h:
(JSC::JSString::getStringPropertySlot):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::parse):
* runtime/PropertyName.h:
(JSC::parseIndex):
(JSC::toUInt32FromCharacters): Deleted.
(JSC::toUInt32FromStringImpl): Deleted.
(JSC::PropertyName::asIndex): Deleted.
* runtime/PropertyNameArray.cpp:
(JSC::PropertyNameArray::add):
* runtime/StringObject.cpp:
(JSC::StringObject::deleteProperty):
* runtime/Structure.cpp:
(JSC::Structure::prototypeChainMayInterceptStoreTo):

Source/WebCore:

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::item):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateImplementation):
* bindings/scripts/test/JS/JSFloat64Array.cpp:
(WebCore::JSFloat64Array::getOwnPropertySlot):
(WebCore::JSFloat64Array::getOwnPropertyDescriptor):
(WebCore::JSFloat64Array::put):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlot):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::put):

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

4 years ago[WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array...
zandobersek@gmail.com [Mon, 6 Apr 2015 09:55:07 +0000 (09:55 +0000)]
[WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array::create() call
https://bugs.webkit.org/show_bug.cgi?id=143413

Reviewed by Darin Adler.

Move the Vector<> object containing the copied elements into the Array::create()
call, avoiding copying all the elements again.

While here, change the Vector<> parameters for Array::create() and the Array
constructor to rvalue references. This will ensure that the passed-in object
is moved into the Array::create() call if possible, or explicitly copied
otherwise. The constructor is moved into the header for inlining opportunities
and the unnecessary parameter in the create(Vector<>&&) method declaration
removed.

* Shared/API/APIArray.cpp:
(API::Array::create):
(API::Array::copy):
(API::Array::Array): Deleted.
* Shared/API/APIArray.h:

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

4 years agoW3C test importer should generate the modules installed dynamically to run wpt tests
youenn.fablet@crf.canon.fr [Mon, 6 Apr 2015 09:06:03 +0000 (09:06 +0000)]
W3C test importer should generate the modules installed dynamically to run wpt tests
https://bugs.webkit.org/show_bug.cgi?id=142738

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Renamed WPTModules to web-platform-test-modules.json
Updated TestRepositories to ask the importer to generate web-platform-test-modules.json at import time.

* resources/TestRepositories:
* resources/WPTModules: Removed.
* resources/web-platform-tests-modules.json: Added.

Tools:

The test importer can now generate the submodules description file based on information extracted from the corresponding git repository.
The implementation is done within TestDownloader and it is activated for the WPT repository.
LayoutTests/imported/w3c/resources/WPTModules is renamed as LayoutTests/imported/w3c/resources/web-platform-tests-modules.json for that reason.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer._install_modules): Updated to cope with path as array.
* Scripts/webkitpy/w3c/test_downloader.py:
(TestDownloader._git_submodules_status): Added so that it can be overriden for unit tests.
(TestDownloader):
(TestDownloader._git_submodules_description): Computes submodule description.
(TestDownloader.generate_git_submodules_description): Write submodule description in a file.
* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.do_import): Added the possibility to post process the tests.
(TestImporter):
(TestImporter.generate_git_submodules_description_for_all_repositories): Enable generating module description file.
(TestImporter.should_convert_test_harness_links): Updated according new options format.
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest.import_downloaded_tests): Making use of TestDownloaderMock.
(TestImporterTest.import_downloaded_tests.TestDownloaderMock): Added to override submodule status gathering.
(TestImporterTest.import_downloaded_tests.TestDownloaderMock.__init__):
(TestImporterTest.import_downloaded_tests.TestDownloaderMock._git_submodules_status):
(TestImporterTest.test_submodules_generation): Added to check that modules description files works.

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

4 years agoFileList constructor should move the passed-in Vector<> rvalue reference into the...
zandobersek@gmail.com [Mon, 6 Apr 2015 07:22:35 +0000 (07:22 +0000)]
FileList constructor should move the passed-in Vector<> rvalue reference into the member variable
https://bugs.webkit.org/show_bug.cgi?id=143412

Reviewed by Darin Adler.

* fileapi/FileList.h:
(WebCore::FileList::FileList): An explicit move of the passed-in rvalue
reference into the member variable is required, otherwise a copy is
performed since an rvalue reference is just an lvalue.

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

4 years agoSource/WebCore:
zandobersek@gmail.com [Mon, 6 Apr 2015 07:21:21 +0000 (07:21 +0000)]
Source/WebCore:
UserScript, UserStyleSheet constructors should take in Vector<String> rvalue references
https://bugs.webkit.org/show_bug.cgi?id=143411

Reviewed by Darin Adler.

Have the UserScript and UserStyleSheet constructors take in Vector<String>
rvalue references for the whitelist and blacklist parameters. Both classes
store these Vector<String> objects, so the referenced objects can simply be
moved into the member variable.

Because the constructor is now demanding an rvalue, it's up to the caller
to move in the desired object if possible, or create an explicit copy
otherwise.

* page/UserScript.h:
(WebCore::UserScript::UserScript):
* page/UserStyleSheet.h:
(WebCore::UserStyleSheet::UserStyleSheet):

Source/WebKit2:
UserScript, UserStyleSheet constructors should take in Vector<String> rvalues
https://bugs.webkit.org/show_bug.cgi?id=143411

Reviewed by Darin Adler.

Move the whitelist and blacklist Vector<String> objects into the
UserScript and UserStyleSheet constructors in ArgumentCoder<T>::decode
functions.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<UserStyleSheet>::decode):
(IPC::ArgumentCoder<UserScript>::decode):

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

4 years ago[Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest...
aestes@apple.com [Mon, 6 Apr 2015 05:24:21 +0000 (05:24 +0000)]
[Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest:...]
https://bugs.webkit.org/show_bug.cgi?id=143437

Reviewed by Dan Bernstein.

No new tests. We can't test NEFilterSource directly.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.

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

4 years ago[Content Filtering] Add some additional unblock tests
aestes@apple.com [Mon, 6 Apr 2015 04:48:33 +0000 (04:48 +0000)]
[Content Filtering] Add some additional unblock tests
https://bugs.webkit.org/show_bug.cgi?id=143435

Reviewed by Dan Bernstein.

* contentfiltering/block-after-add-data-then-allow-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-add-data-then-allow-unblock.html: Added.
* contentfiltering/block-after-add-data-then-deny-unblock-expected.html: Renamed from LayoutTests/contentfiltering/allow-after-unblock-request-expected.html.
* contentfiltering/block-after-add-data-then-deny-unblock.html: Added.
* contentfiltering/block-after-finished-adding-data-then-allow-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-finished-adding-data-then-allow-unblock.html: Renamed from LayoutTests/contentfiltering/allow-after-unblock-request.html.
* contentfiltering/block-after-finished-adding-data-then-deny-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-finished-adding-data-then-deny-unblock.html: Renamed from LayoutTests/contentfiltering/block-after-unblock-request.html.
* contentfiltering/block-after-response-then-allow-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-response-then-allow-unblock.html: Added.
* contentfiltering/block-after-response-then-deny-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-response-then-deny-unblock.html: Added.
* contentfiltering/block-after-will-send-request-then-allow-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-will-send-request-then-allow-unblock.html: Added.
* contentfiltering/block-after-will-send-request-then-deny-unblock-expected.html: Renamed from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-will-send-request-then-deny-unblock.html: Added.

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

4 years agoWeb Inspector: Add String/Array "includes" parameter display string
commit-queue@webkit.org [Mon, 6 Apr 2015 04:01:43 +0000 (04:01 +0000)]
Web Inspector: Add String/Array "includes" parameter display string
https://bugs.webkit.org/show_bug.cgi?id=143434

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-05
Reviewed by Darin Adler.

* UserInterface/Models/NativeFunctionParameters.js:

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

4 years agoFrameView code uses page() without null checking
darin@apple.com [Mon, 6 Apr 2015 03:29:06 +0000 (03:29 +0000)]
FrameView code uses page() without null checking
https://bugs.webkit.org/show_bug.cgi?id=143425
rdar://problem/18920601

Reviewed by Anders Carlsson.

While we don't have tests that cover this, we are seeing crashes coming in
that indicate the shouldEnableSpeculativeTilingDuringLoading function is
being called when the page is null. This patch adds null checks to all the
places in FrameView that use page() without doing null checking.

* page/FrameView.cpp:
(WebCore::FrameView::layout): If page is null, don't try to do the
auto-sizing logic that involves the textAutosizingWidth value from the page.
(WebCore::FrameView::setFixedVisibleContentRect): Get settings from the
frame rather than the page to avoid possible null-dereference.
(WebCore::FrameView::scrollPositionChanged): Check the page for null when
getting the event throttling delay.
(WebCore::FrameView::updateLayerFlushThrottling): Check the page for null,
and return early if it is null.
(WebCore::shouldEnableSpeculativeTilingDuringLoading): Check the page for
null, and return false if it is null.
(WebCore::FrameView::performPostLayoutTasks): Guard the code that calls
didLayout on the page client by a check if the page is null.
(WebCore::FrameView::pagination): Don't call Page::pagination on a null
page here.
(WebCore::FrameView::visibleContentScaleFactor): Use a scale factor of 1
if the page is null.
(WebCore::FrameView::setVisibleScrollerThumbRect): Don't call through to
the page client if the page is null.
(WebCore::FrameView::scrollbarStyleChanged): Ditto.
(WebCore::FrameView::setScrollPinningBehavior): Check the page for null
before asking it for the scrolling coordinator.

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

4 years agoFree up some bits in RenderObject by moving rarely used bits into a side table
simon.fraser@apple.com [Mon, 6 Apr 2015 02:59:57 +0000 (02:59 +0000)]
Free up some bits in RenderObject by moving rarely used bits into a side table
https://bugs.webkit.org/show_bug.cgi?id=143432

Reviewed by Darin Adler.

Add a side table (global hash) on RenderObject to store data that is rarely
used. Move the "isDragging" and "hasReflection" bits there. Re-use one of
those bits for "hasRareData", and leave the other unused (I have plans for it).

* rendering/RenderBlock.cpp:
(WebCore::getBlockRareData): Renamed for consistency.
(WebCore::ensureBlockRareData): Renamed to avoid conflict with RenderObject::ensureRareData().
(WebCore::RenderBlock::cachedFlowThreadContainingBlock):
(WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
(WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
(WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
(WebCore::RenderBlock::locateFlowThreadContainingBlock):
(WebCore::RenderBlock::paginationStrut):
(WebCore::RenderBlock::pageLogicalOffset):
(WebCore::RenderBlock::setPaginationStrut):
(WebCore::RenderBlock::setPageLogicalOffset):
(WebCore::getRareData): Deleted.
(WebCore::ensureRareData): Deleted.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::~RenderObject): Assert that rare data hasn't been resurrected
since willBeDestroyed().
(WebCore::RenderObject::willBeDestroyed): Clear the rare data.
(WebCore::RenderObject::setIsDragging): If setting, ensure that we have rare data and
set the bit. Otherwise, only clear the bit of we have rare data.
(WebCore::RenderObject::setHasReflection): Ditto.
(WebCore::RenderObject::rareDataMap):
(WebCore::RenderObject::rareData):
(WebCore::RenderObject::ensureRareData):
(WebCore::RenderObject::clearRareData):
* rendering/RenderObject.h:
(WebCore::RenderObject::isDragging): Fast-fail on the hasRareData() bit, then do the
slower lookup in rare data.
(WebCore::RenderObject::hasReflection): Ditto.
(WebCore::RenderObject::setEverHadLayout): Moved up to group with other bit setters.
(WebCore::RenderObject::hasRareData):
(WebCore::RenderObject::setHasRareData):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
(WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
(WebCore::RenderObject::setHasReflection): Deleted. Out of line now.
(WebCore::RenderObject::setIsDragging): Deleted. Ditto.

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

4 years agoWeb Inspector: Regression: Map instances don't expand
commit-queue@webkit.org [Mon, 6 Apr 2015 01:56:28 +0000 (01:56 +0000)]
Web Inspector: Regression: Map instances don't expand
https://bugs.webkit.org/show_bug.cgi?id=143428

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-05
Reviewed by Brian Burg.

Fix uses of "this" in super() calls. Also fix a style name
that no longer exists and was intended to be inlined.

* UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js:
(WebInspector.IndexedDatabaseObjectStoreTreeElement):
* UserInterface/Views/IndexedDatabaseTreeElement.js:
(WebInspector.IndexedDatabaseTreeElement):
* UserInterface/Views/ObjectTreeMapEntryTreeElement.js:
(WebInspector.ObjectTreeMapEntryTreeElement):

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

4 years agoREGRESSION (r181778): Crash after scrolling Google search result page
darin@apple.com [Mon, 6 Apr 2015 01:43:32 +0000 (01:43 +0000)]
REGRESSION (r181778): Crash after scrolling Google search result page
https://bugs.webkit.org/show_bug.cgi?id=143431

Reviewed by Simon Fraser.

I can't reproduce this crash, nor was I able to make a regression test,
but the crash data makes it clear this is a null dereference.

* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::scrollWasUpdated): Check the result
of Frame::view for null. We know this is only called when there is a
valid FrameView, but it can be called after Frame::m_view is already null.

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

4 years agoURI encoding/escaping should use efficient string building instead of calling snprintf().
akling@apple.com [Mon, 6 Apr 2015 01:32:12 +0000 (01:32 +0000)]
URI encoding/escaping should use efficient string building instead of calling snprintf().
<https://webkit.org/b/143426>

Reviewed by Gavin Barraclough.

I saw 0.5% of main thread time in snprintf() on <http://polymerlabs.github.io/benchmarks/>
which seemed pretty silly. This change gets that down to nothing in favor of using our
existing JSStringBuilder and HexNumber.h facilities.

These APIs are well-exercised by our existing test suite.

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::encode):
(JSC::globalFuncEscape):

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

4 years ago[Content Filtering] Tell the filter about requests and redirects
aestes@apple.com [Mon, 6 Apr 2015 00:23:46 +0000 (00:23 +0000)]
[Content Filtering] Tell the filter about requests and redirects
https://bugs.webkit.org/show_bug.cgi?id=143414
rdar://problem/19239549

Reviewed by Darin Adler.

Source/WebCore:

Tests: contentfiltering/allow-after-will-send-request.html
       contentfiltering/block-after-will-send-request.html
       http/tests/contentfiltering/allow-after-redirect.html
       http/tests/contentfiltering/block-after-redirect.html

NEFilterSource supports making filter decisions based on NSURLRequests, so this patch adds support for telling
ContentFilter about the original main resource request as well as redirect requests.

* bindings/js/JSMockContentFilterSettingsCustom.cpp: Updated decisionPoint values to include AfterWillSendRequest and AfterRedirect.
(WebCore::JSMockContentFilterSettings::decisionPoint):
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::willSendRequest): Called willSendRequest() on each filter using forEachContentFilterUntilBlocked().
(WebCore::ContentFilter::redirectReceived): Called willSendRequest().
* loader/ContentFilter.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Called ContentFilter::willSendRequest() if there is a content filter.
Asserted that this is not a redirect, and that ContentFilter does not set the request to null.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequest): Called redirectReceived() instead of willSendRequest().
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
(WebCore::CachedRawResource::willSendRequest): Deleted.
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
(WebCore::CachedResource::willSendRequest): Deleted.
* loader/cache/CachedResource.h:
* platform/PlatformContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::willSendRequest): Called responseReceived() if there was a redirectResponse.
Then called -[NEFilterSource willSendRequest:decisionHandler:].
* platform/cocoa/ParentalControlsContentFilter.h:
* platform/spi/cocoa/NEFilterSourceSPI.h: Added a #define for NEFilterSourceOptionsPageData.
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::willSendRequest): Added support for willSendRequest.
* testing/MockContentFilter.h: Added decision points for AfterWillSendRequest and AfterRedirect.
* testing/MockContentFilterSettings.h:
* testing/MockContentFilterSettings.idl:

LayoutTests:

* contentfiltering/allow-after-will-send-request-expected.html: Added.
* contentfiltering/allow-after-will-send-request.html: Added.
* contentfiltering/block-after-will-send-request-expected.html: Added.
* contentfiltering/block-after-will-send-request.html: Added.
* http/tests/contentfiltering/allow-after-redirect-expected.html: Added.
* http/tests/contentfiltering/allow-after-redirect.html: Added.
* http/tests/contentfiltering/block-after-redirect-expected.html: Added.
* http/tests/contentfiltering/block-after-redirect.html: Added.
* http/tests/contentfiltering/resources/fail.html: Added.
* http/tests/contentfiltering/resources/pass.html: Added.

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

4 years agodocumentation for ES Promises points to the wrong one
commit-queue@webkit.org [Sun, 5 Apr 2015 23:41:03 +0000 (23:41 +0000)]
documentation for ES Promises points to the wrong one
https://bugs.webkit.org/show_bug.cgi?id=143263

Patch by Masataka Yakura <masataka.yakura@gmail.com> on 2015-04-05
Reviewed by Darin Adler.

* features.json:

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

4 years agoRemove DocumentLoader::requestURL().
commit-queue@webkit.org [Sun, 5 Apr 2015 23:31:32 +0000 (23:31 +0000)]
Remove DocumentLoader::requestURL().
https://bugs.webkit.org/show_bug.cgi?id=140001

Patch by Sungmann Cho <sungmann.cho@navercorp.com> on 2015-04-05
Reviewed by Darin Adler.

No new tests, no behavior change.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::documentURL):
(WebCore::DocumentLoader::requestURL): Deleted.
* loader/DocumentLoader.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):

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

4 years ago[Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on...
darin@apple.com [Sun, 5 Apr 2015 22:24:26 +0000 (22:24 +0000)]
[Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread
https://bugs.webkit.org/show_bug.cgi?id=143423
rdar://problem/18773785

Reviewed by Alexey Proskuryakov.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::origin): Factored out this helper function from updateActivePages below, so
the function below is easier to read.
(WebKit::WebProcess::updateActivePages): Refactored to use the new origin function.
Use dispatch_async to call WKSetApplicationInformationItem without blocking.

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

4 years agoUse constants of sqlite3 directly for status of SQL result in webdatabase
commit-queue@webkit.org [Sun, 5 Apr 2015 20:44:35 +0000 (20:44 +0000)]
Use constants of sqlite3 directly for status of SQL result in webdatabase
https://bugs.webkit.org/show_bug.cgi?id=143329

Patch by Gyuyoung Kim <gyuyoung.kim@samsung.com> on 2015-04-05
Reviewed by Darin Adler.

Source/WebCore:

In webdatabase, it has used own constant vairables as well as using sqlite3 constants directly.
It causes to use if~else statement which consumes more cpu cycles compared to switch~case. This
patch makes to use constants of sqlite3. Additionally if~else statment is changed to switch~case
to save cpu cycles.

No new tests, no behavior changes.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::performGetTableNames):
* Modules/webdatabase/DatabaseBackendBase.cpp:
(WebCore::retrieveTextResultFromDatabase):
(WebCore::setTextValueInDatabase):
(WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::hasEntryForOriginNoLock):
(WebCore::DatabaseTracker::hasEntryForDatabase):
(WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
(WebCore::DatabaseTracker::origins):
(WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
(WebCore::DatabaseTracker::setDatabaseDetails):
(WebCore::DatabaseTracker::quotaForOriginNoLock):
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::addDatabase):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
(WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
* Modules/webdatabase/SQLStatementBackend.cpp:
(WebCore::SQLStatementBackend::execute):
* Modules/webdatabase/SQLStatementBackend.h:
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
Change to use a reference instead of a pointer in arguemnt of execute().
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCacheGroup):
(WebCore::ApplicationCacheStorage::loadManifestHostHashes):
(WebCore::ApplicationCacheStorage::cacheGroupForURL):
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::verifySchemaVersion):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::storeUpdatedType):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
(WebCore::ApplicationCacheStorage::storeNewestCache):
(WebCore::ApplicationCacheStorage::loadCache):
(WebCore::ApplicationCacheStorage::remove):
(WebCore::ApplicationCacheStorage::getManifestURLs):
(WebCore::ApplicationCacheStorage::cacheGroupSize):
(WebCore::ApplicationCacheStorage::deleteCacheGroupRecord):
(WebCore::ApplicationCacheStorage::checkForMaxSizeReached):
(WebCore::ApplicationCacheStorage::checkForDeletedResources):
(WebCore::ApplicationCacheStorage::flatFileAreaSize):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::checkIntegrity):
(WebCore::IconDatabase::performURLImport):
(WebCore::IconDatabase::pruneUnretainedIcons):
(WebCore::readySQLiteStatement):
(WebCore::IconDatabase::setIconIDForPageURLInSQLDatabase):
(WebCore::IconDatabase::removePageURLFromSQLDatabase):
(WebCore::IconDatabase::getIconIDForIconURLFromSQLDatabase):
(WebCore::IconDatabase::addIconURLToSQLDatabase):
(WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
(WebCore::IconDatabase::removeIconFromSQLDatabase):
(WebCore::IconDatabase::writeIconSnapshotToSQLDatabase):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::setMaximumSize):
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::getFileNameForNewDatabase):
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::step):
(WebCore::SQLiteStatement::returnIntResults):
(WebCore::SQLiteStatement::returnInt64Results):

Source/WebKit:

In webdatabase, it has used own constants vairables as well as using sqlite3 constants directly.
It causes to use if~else statement which consumes more cpu cycles compared to switch~case. This
patch makes to use constants of sqlite3.

* Storage/StorageAreaSync.cpp:
(WebCore::StorageAreaSync::performImport):
(WebCore::StorageAreaSync::sync):
(WebCore::StorageAreaSync::deleteEmptyDatabase):
* Storage/StorageTracker.cpp:
(WebCore::StorageTracker::syncImportOriginIdentifiers):
(WebCore::StorageTracker::syncSetOriginDetails):
(WebCore::StorageTracker::syncDeleteAllOrigins):
(WebCore::StorageTracker::syncDeleteOrigin):
(WebCore::StorageTracker::databasePathForOrigin):
* WebKit.vcxproj/WebKit/WebKitCommon.props: Add sqlite include path.

Source/WebKit2:

In webdatabase, it has used own constant variables as well as using sqlite3 constants directly.
If sqlite3 constants are changed in the library, we should modify many files as well. Besides
it can cause to use if~else statement which consumes more cpu cycles compared to switch~case.

* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
(WebKit::SQLiteIDBCursor::createSQLiteStatement):
(WebKit::SQLiteIDBCursor::resetAndRebindStatement):
(WebKit::SQLiteIDBCursor::bindArguments):
(WebKit::SQLiteIDBCursor::internalAdvanceOnce):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::createOrMigrateRecordsTableIfNecessary):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::changeDatabaseVersion):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::executeSQLStatement):
(WebKit::NetworkCache::Statistics::initialize):
(WebKit::NetworkCache::Statistics::queryWasEverRequested):
(WebKit::NetworkCache::Statistics::addHashesToDatabase):
(WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
* UIProcess/Storage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::importItems):
(WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
(WebKit::LocalStorageDatabase::databaseIsEmpty):
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
(WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers):
(WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier):
(WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
(WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier):
* WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp:
(webkitSoupCookieJarSqliteLoad):
(webkitSoupCookieJarSqliteInsertCookie):
(webkitSoupCookieJarSqliteDeleteCookie):

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

4 years agoRemove "go ahead and" from comments
simon.fraser@apple.com [Sun, 5 Apr 2015 20:17:11 +0000 (20:17 +0000)]
Remove "go ahead and" from comments
https://bugs.webkit.org/show_bug.cgi?id=143421

Reviewed by Darin Adler, Benjamin Poulain.

Remove the phrase "go ahead and" from comments where it doesn't add
anything (which is almost all of them).

Source/JavaScriptCore:

* interpreter/JSStack.cpp:
(JSC::JSStack::growSlowCase):

Source/WebCore:

* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteOriginLockFor):
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::isSupportedFormat):
* css/CSSPrimitiveValue.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::addIncrementalDataBuffer):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::performURLImport):
* page/PageOverlay.cpp:
(WebCore::PageOverlay::fadeAnimationTimerFired):
* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::scrollContents):
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::create):
* platform/graphics/GraphicsContext.cpp:
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPRefresh):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removeChild):
(WebCore::RenderBlock::layoutPositionedObjects):
(WebCore::RenderBlock::selectionGaps):
(WebCore::RenderBlock::blockSelectionGaps):
(WebCore::RenderBlock::absoluteRects):
(WebCore::RenderBlock::absoluteQuads):
(WebCore::RenderBlock::addFocusRingRects):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlockChild):
(WebCore::RenderBlockFlow::handleAfterSideOfBlock):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::inlineSelectionGaps):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::appendRunsForObject):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::positionLineBox):
(WebCore::RenderBox::sizesLogicalWidthToFitContent):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleWillChange):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::dirtyRange):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleOutOfFlowPositioned):
(WebCore::BreakingContext::handleText):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::nextLineBreak):
* style/StyleResolveTree.cpp:
(WebCore::Style::resolveLocal):
* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::append):

Source/WebKit/mac:

* WebView/WebDynamicScrollBarsView.mm:
(-[WebDynamicScrollBarsView updateScrollers]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView insertText:]):

Source/WebKit2:

* Platform/unix/EnvironmentUtilities.cpp:
(WebKit::EnvironmentUtilities::stripValuesEndingWithString):
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::didClose):
* UIProcess/API/mac/WKView.mm:
(-[WKView insertText:replacementRange:]):
(-[WKView _pluginFocusOrWindowFocusChanged:pluginComplexTextInputIdentifier:]):
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):

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

4 years agoBloom filter should support longer hashes
antti@apple.com [Sun, 5 Apr 2015 18:45:38 +0000 (18:45 +0000)]
Bloom filter should support longer hashes
https://bugs.webkit.org/show_bug.cgi?id=143419

Reviewed by Dan Bernstein.

Source/WebKit2:

Use the hash digest directly in the contents filter instead of going via shortHash.

* NetworkProcess/cache/NetworkCacheKey.h:
(WebKit::NetworkCache::Key::hash):
(WebKit::NetworkCache::Key::shortHash): Deleted.
(WebKit::NetworkCache::Key::toShortHash): Deleted.

    No longer needed.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::addToContentsFilter):
(WebKit::NetworkCache::Storage::mayContain):
* NetworkProcess/cache/NetworkCacheStorage.h:

Source/WTF:

It currently supports 'unsigned' hash only which is inconvenient and doesn't have enough independent bits for larger filters.

Support arbitrarily sized hashes of type std::array<uint8_t, hashSize> (like SHA1::Digest and MD5::Digest).

* wtf/BloomFilter.h:
(WTF::BloomFilter<keyBits>::keysFromHash):
(WTF::BloomFilter<keyBits>::mayContain):
(WTF::BloomFilter<keyBits>::add):

Tools:

* TestWebKitAPI/Tests/WTF/BloomFilter.cpp:
(TestWebKitAPI::generateRandomDigests):
(TestWebKitAPI::TEST):

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

4 years agoNetwork cache Bloom filter is too big
antti@apple.com [Sun, 5 Apr 2015 18:39:07 +0000 (18:39 +0000)]
Network cache Bloom filter is too big
https://bugs.webkit.org/show_bug.cgi?id=143400

Follow-up: Fix an ineffective assert.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::setMaximumSize): Average resource size is closer to 50KB than 50MB.

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

4 years agoRename Cache::setMaximumSize to setCapacity
antti@apple.com [Sun, 5 Apr 2015 18:35:19 +0000 (18:35 +0000)]
Rename Cache::setMaximumSize to setCapacity
https://bugs.webkit.org/show_bug.cgi?id=143418

Reviewed by Dan Bernstein.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::setCapacity):
(WebKit::NetworkCache::Cache::setMaximumSize): Deleted.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::retrieve):
(WebKit::NetworkCache::Storage::store):
(WebKit::NetworkCache::Storage::update):
(WebKit::NetworkCache::Storage::setCapacity):
(WebKit::NetworkCache::Storage::shrinkIfNeeded):
(WebKit::NetworkCache::Storage::shrink):
(WebKit::NetworkCache::Storage::setMaximumSize): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSetCacheModel):

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

4 years agoSkip fast/fixed-layout/fixed-layout.html on Windows.
simon.fraser@apple.com [Sun, 5 Apr 2015 18:18:45 +0000 (18:18 +0000)]
Skip fast/fixed-layout/fixed-layout.html on Windows.

* platform/win/TestExpectations:

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

4 years agoWeb Inspector: ObjectTree array index hints are clipped when shown in popover
nvasilyev@apple.com [Sun, 5 Apr 2015 16:52:49 +0000 (16:52 +0000)]
Web Inspector: ObjectTree array index hints are clipped when shown in popover
https://bugs.webkit.org/show_bug.cgi?id=143309

Reviewed by Brian Burg.

* UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:
(.object-tree-array-index .index-name):
Add left margin that equals the width of the expand/collapse icon.

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

4 years ago[EFL] Gardening on 5th April. Mark 2 tests to ImageOnlyFailure.
gyuyoung.kim@webkit.org [Sun, 5 Apr 2015 15:34:21 +0000 (15:34 +0000)]
[EFL] Gardening on 5th April. Mark 2 tests to ImageOnlyFailure.
https://bugs.webkit.org/show_bug.cgi?id=143417

Unreviewed. Mark 2 tests to ImageOnlyFailure.

* platform/efl/TestExpectations:

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

4 years agoNetwork cache Bloom filter is too big
antti@apple.com [Sun, 5 Apr 2015 15:18:47 +0000 (15:18 +0000)]
Network cache Bloom filter is too big
https://bugs.webkit.org/show_bug.cgi?id=143400

Reviewed by Chris Dumez.

It is currently 1MB.

This patch switches the cache from a counting filter (CountingBloomFilter) to a bit filter (BloomFilter).

It also reduces the filter size from 2^20 to 2^18 elements which is good for ~26000 cache entries while
still keeping false positive rate below 1%. The current cache capacity allows around 4000 entries
with typical web contents.

The new filter size is 32KB.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::synchronize):

    Turn initialization function into general purpose synchronization function.

(WebKit::NetworkCache::Storage::addToContentsFilter):

    Collect newly added hashes so we don't miss entries that were added during synchronization.

(WebKit::NetworkCache::Storage::mayContain):
(WebKit::NetworkCache::Storage::remove):
(WebKit::NetworkCache::Storage::retrieve):
(WebKit::NetworkCache::Storage::store):
(WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
(WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
(WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
(WebKit::NetworkCache::Storage::setMaximumSize):
(WebKit::NetworkCache::Storage::clear):
(WebKit::NetworkCache::Storage::shrinkIfNeeded):
(WebKit::NetworkCache::Storage::shrink):

    Non-counting Bloom filter does not support removals so this requires a new strategy.

    Shrink code now simply deletes entries. The filter is updated by calling synchronize() at the end.
    While we could synchronize the filter during traversal it is better to just have one function for that.

(WebKit::NetworkCache::Storage::initialize): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::mayContain):
(WebKit::NetworkCache::Storage::cacheMayContain): Deleted.

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

4 years ago[Content Filtering] Blocked page is not always displayed when it should be
aestes@apple.com [Sun, 5 Apr 2015 07:52:14 +0000 (07:52 +0000)]
[Content Filtering] Blocked page is not always displayed when it should be
https://bugs.webkit.org/show_bug.cgi?id=143410
Source/WebCore:

rdar://problem/20211099

Reviewed by Andreas Kling.

These tests now pass: contentfiltering/block-after-add-data.html
                      contentfiltering/block-after-response.html

There were several problems with how ContentFilter loaded replacement data:
(1) Replacement data was delivered to DocumentLoader as if it were the original document's data. This assumes
    that the original data was a UTF-8 encoded HTML document, which is not always true. We had a way to reset
    the encoding, but not the content type.
(2) Replacement data was never delivered when the filter blocks in DocumentLoader::responseReceived().
(3) The main resource load was cancelled before the replacement data could be rendered when the filter blocks
    in DocumentLoader::dataReceived().
The result was that only when the load was blocked after DocumentLoader::notifyFinished() would the replacement
data be shown properly, and only when problem (1) wasn't occurring.

This patch addresses these issues by using the substitute data mechanism to deliver replacement data. By using
substitute data, we can ensure that the original load is cancelled at the earliest opportunity and that the
replacement data is loaded with the proper content type and encoding.

Accomplishing this required changing the way ContentFilter interacts with DocumentLoader. Instead of placing
ContentFilter hooks throughout DocumentLoader, this patch makes ContentFilter itself the client of the
CachedRawResource for the duration of the filtering. If the filter decides to allow the load, DocumentLoader
adds itself as a client causing CachedRawResource to deliver to it the response and buffered data. If the
filter decides to block the load, DocumentLoader schedules a substitute data load. An added benefit of this
approach is that ContentFilter can reuse CachedRawResource's original data buffer instead of keeping its own.

* loader/ContentFilter.cpp:
(WebCore::ContentFilter::createIfNeeded): Changed to take a DecisionFunction rather than a ResourceResponse and DocumentLoader.
(WebCore::ContentFilter::ContentFilter): Ditto.
(WebCore::ContentFilter::~ContentFilter): Removed ourself as a CachedRawResource client if needed.
(WebCore::ContentFilter::startFilteringMainResource): Became the client of the CachedRawResource in order to start the filtering process.
(WebCore::ContentFilter::unblockHandler): Returned the unblock handler.
(WebCore::ContentFilter::replacementData): Returned the replacement data.
(WebCore::ContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
(WebCore::ContentFilter::responseReceived): Called responseReceived() on each filter using forEachContentFilterUntilBlocked().
(WebCore::ContentFilter::dataReceived): Ditto for dataReceived().
(WebCore::ContentFilter::notifyFinished): Ditto for finishedLoading().
(WebCore::ContentFilter::forEachContentFilterUntilBlocked): For each filter that needs more data, called the function.
If the filter blocked the load, called didDecide() with State::Blocked.
If all filters allowed the load, called didDecide() with State::Allowed.
(WebCore::ContentFilter::didDecide): Set m_state and called m_decisionFunction().
(WebCore::ContentFilter::addData): Deleted.
(WebCore::ContentFilter::finishedAddingData): Deleted.
(WebCore::ContentFilter::needsMoreData): Deleted.
(WebCore::ContentFilter::didBlockData): Deleted.
(WebCore::ContentFilter::getReplacementData): Deleted.
* loader/ContentFilter.h:
(WebCore::ContentFilter::type):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader): Called ContentFilter::createIfNeeded() if not loading substitute data.
(WebCore::DocumentLoader::finishedLoading): Removed old ContentFilter code.
(WebCore::DocumentLoader::responseReceived): Ditto.
(WebCore::DocumentLoader::commitData): Ditto.
(WebCore::DocumentLoader::dataReceived): Ditto.
(WebCore::DocumentLoader::detachFromFrame): Set m_contentFilter to nullptr.
(WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClientIfFilterAllows() instead of
becoming m_mainResource's client.
(WebCore::DocumentLoader::clearMainResource): Set m_contentFilter to nullptr.
(WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): If ContentFilter is initialized, called
ContentFilter::startFilteringMainResource(). Otherwise added ourself as a client of m_mainResource.
(WebCore::DocumentLoader::installContentFilterUnblockHandler): Added a helper for creating and notifying
FrameLoaderClient of the unblock handler.
(WebCore::DocumentLoader::contentFilterDidDecide): Set m_contentFilter to nullptr. If the content filter
allowed the load, then added ourself as the CachedRawResource's client. Otherwise, installed the unblock handler
and scheduled a substitute data load with the replacement data.
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::prepareForLoadStart): Removed call to PolicyChecker::prepareForLoadStart().
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Added a ScheduledNavigation subclass that
calls FrameLoader::load() with a FrameLoadRequest containing substitute data.
(WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Scheduled a substitute data load.
* loader/NavigationScheduler.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy): Reset m_contentFilterUnblockHandler if it couldn't handle the request.
(WebCore::PolicyChecker::prepareForLoadStart): Deleted.
* loader/PolicyChecker.h:
* platform/ContentFilterUnblockHandler.h:
(WebCore::ContentFilterUnblockHandler::unreachableURL):
(WebCore::ContentFilterUnblockHandler::setUnreachableURL):
(WebCore::ContentFilterUnblockHandler::unblockURLScheme): Renamed to ContentFilter::urlScheme().
* platform/PlatformContentFilter.h:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Added a helper to wrap the unblock handler with an outer DecisionHandlerFunction.
(WebCore::ContentFilterUnblockHandler::encode): Added m_unreachableURL to the encoding.
(WebCore::ContentFilterUnblockHandler::decode): Ditto for the decoding.
(WebCore::ContentFilterUnblockHandler::canHandleRequest): Changed to call ContentFilter::urlScheme().
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(replacementDataFromDecisionInfo): Added a helper to extract replacement data from the decisionInfo dictionary.
(WebCore::NetworkExtensionContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
(WebCore::NetworkExtensionContentFilter::create): Created a new object.
(WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Created a NEFilterSource immediately when using the modern API.
(WebCore::NetworkExtensionContentFilter::responseReceived): Created a NEFilterSource when using the legacy API.
Called -[NEFilterSource receivedResponse:decisionHandler:] when using the modern API.
(WebCore::NetworkExtensionContentFilter::addData): Stopped buffering the original data.
(WebCore::NetworkExtensionContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
(WebCore::NetworkExtensionContentFilter::canHandleResponse): Deleted.
(WebCore::createNEFilterSource): Deleted.
(WebCore::NetworkExtensionContentFilter::getReplacementData): Deleted.
* platform/cocoa/ParentalControlsContentFilter.h:
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
(WebCore::ParentalControlsContentFilter::create): Created a new object.
(WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Initialized m_filterState to kWFEStateBuffering.
(WebCore::canHandleResponse): Added a helper to check if the response can be filtered.
(WebCore::ParentalControlsContentFilter::responseReceived): If !canHandleResponse(), set m_filterState to kWFEStateAllowed and return.
Otherwise created a new WebFilterEvaluator with the response.
(WebCore::ParentalControlsContentFilter::addData): Called updateFilterState().
(WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
(WebCore::ParentalControlsContentFilter::needsMoreData): Changed to check m_filterState.
(WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
(WebCore::ParentalControlsContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
(WebCore::ParentalControlsContentFilter::updateFilterState): Updated m_filterState by calling -[WebFilterEvaluator filterState].
(WebCore::ParentalControlsContentFilter::canHandleResponse): Deleted.
(WebCore::ParentalControlsContentFilter::getReplacementData): Deleted.
* platform/spi/cocoa/NEFilterSourceSPI.h:
* platform/spi/cocoa/WebFilterEvaluatorSPI.h:
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
(WebCore::MockContentFilter::create): Created a new object.
(WebCore::MockContentFilter::responseReceived): Called maybeDetermineStatus().
(WebCore::MockContentFilter::addData): Stopped buffering the original data.
(WebCore::MockContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
(WebCore::MockContentFilter::unblockHandler): Asserted that we blocked data.
(WebCore::MockContentFilter::canHandleResponse): Deleted.
(WebCore::MockContentFilter::MockContentFilter): Deleted.
(WebCore::MockContentFilter::getReplacementData): Deleted.
* testing/MockContentFilter.h:
* testing/MockContentFilterSettings.cpp:
(WebCore::MockContentFilterSettings::unblockRequestURL): Changed to use a StringBuilder.

Source/WebKit2:

Reviewed by Andreas Kling.

* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didStartProvisionalLoad): Stopped clearing m_contentFilterUnblockHandler here.
(WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Started doing it here instead.

LayoutTests:

Reviewed by Andreas Kling.

* TestExpectations: Unskipped block-after-add-data.html.
* contentfiltering/block-after-add-data-expected.html: Added a passing expectation.
* contentfiltering/block-after-response-expected.html: Ditto.

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

4 years agoAX: Heuristic: Avoid exposing an element as clickable if mouse event delegation is...
cfleizach@apple.com [Sun, 5 Apr 2015 06:51:15 +0000 (06:51 +0000)]
AX: Heuristic: Avoid exposing an element as clickable if mouse event delegation is handled on an AXElement with more than one descendant AXElement
https://bugs.webkit.org/show_bug.cgi?id=136247

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Modify the logic for determining whether an element supports the press action by trying to filter out objects being handled by event delegation.
The heuristic is if an element handles click actions and has more than one of a {static text, image, control, link, heading}, then we think
it's using event delegation, and do not expose the press action.

Test: platform/mac/accessibility/press-action-not-exposed-for-event-delegation.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsPressAction):

LayoutTests:

* platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler-expected.txt: Removed.
* platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler.html: Removed.
* platform/mac/accessibility/press-action-not-exposed-for-event-delegation-expected.txt: Added.
* platform/mac/accessibility/press-action-not-exposed-for-event-delegation.html: Added.

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

4 years agoMore const in CSSToStyleMap
simon.fraser@apple.com [Sun, 5 Apr 2015 06:11:00 +0000 (06:11 +0000)]
More const in CSSToStyleMap
https://bugs.webkit.org/show_bug.cgi?id=143409

Reviewed by Andreas Kling.

The CSSValues passed to CSSToStyleMap functions can mostly be treated
as |const|, except for CSSImageValues which have special behavior.

This makes it clearer what the inputs and outputs of these
functions are.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeDegrees):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::computeTime):
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillAttachment):
(WebCore::CSSToStyleMap::mapFillClip):
(WebCore::CSSToStyleMap::mapFillComposite):
(WebCore::CSSToStyleMap::mapFillBlendMode):
(WebCore::CSSToStyleMap::mapFillOrigin):
(WebCore::CSSToStyleMap::mapFillRepeatX):
(WebCore::CSSToStyleMap::mapFillRepeatY):
(WebCore::CSSToStyleMap::mapFillSize):
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
(WebCore::CSSToStyleMap::mapFillMaskSourceType):
(WebCore::CSSToStyleMap::mapAnimationDelay):
(WebCore::CSSToStyleMap::mapAnimationDirection):
(WebCore::CSSToStyleMap::mapAnimationDuration):
(WebCore::CSSToStyleMap::mapAnimationFillMode):
(WebCore::CSSToStyleMap::mapAnimationIterationCount):
(WebCore::CSSToStyleMap::mapAnimationName):
(WebCore::CSSToStyleMap::mapAnimationPlayState):
(WebCore::CSSToStyleMap::mapAnimationProperty):
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
(WebCore::CSSToStyleMap::mapAnimationTrigger):
* css/CSSToStyleMap.h:

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

4 years agoFix some bad test results committed earlier.
simon.fraser@apple.com [Sun, 5 Apr 2015 03:09:24 +0000 (03:09 +0000)]
Fix some bad test results committed earlier.

* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash-expected.txt:

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

4 years agoTried to fix the build.
mitz@apple.com [Sun, 5 Apr 2015 03:01:24 +0000 (03:01 +0000)]
Tried to fix the build.

* loader/icon/IconController.cpp:
(WebCore::iconsFromLinkElements):

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

4 years agoStreamline icon-related code, mostly unused
darin@apple.com [Sun, 5 Apr 2015 01:01:49 +0000 (01:01 +0000)]
Streamline icon-related code, mostly unused
https://bugs.webkit.org/show_bug.cgi?id=143306

Reviewed by Antti Koivisto.

Source/WebCore:

I started on this path because Document::iconURLs had a poor implementation,
storing results in a data member with no benefit, using HTMLCollection for
iteration of the children of the head element instead of using the simpler
faster technique we use inside the engine. Then, I discovered this function was
mostly-unused code left over from before the Blink fork. I removed most of it.
We can add this back later if someone finds a use for it, but if we do we
should do a higher quality implementation without the quirks of the old one.

Refactoring also made it clear that logic isn't exactly sensible. There's a
set of rules about what order to return the list in that is not followed by
the code that tries to find the "default touch icon". Later we could add some
more test coverage and tighten up the logic. But the reality is that at this
time, with some small exceptions, icon logic is in the web browsers, not in WebKit.

* CMakeLists.txt: Removed IconURL.cpp.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* dom/DOMAllInOne.cpp: Ditto.

* dom/Document.cpp:
(WebCore::Document::evaluate): Tweaked formatting.
(WebCore::Document::shortcutIconURLs): Removed. Unused function.
(WebCore::Document::iconURLs): Removed. Moved code to IconController.
(WebCore::Document::addIconURL): Removed. Moved code to LinkLoader.

* dom/Document.h: Removed shortcutIconURLs, iconURLs, addIconURL,
and m_iconURLs.

* dom/IconURL.cpp: Removed.
* dom/IconURL.h: Removed everything from this header except for the
IconType enum. Added a FIXME about possibly renaming the header.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement): Pass a reference when creating
the link loading.
(WebCore::HTMLLinkElement::setDisabledState): Access members of the struct
LinkRelElement without "m_" prefix.
(WebCore::HTMLLinkElement::parseAttribute): Changed to use early return style,
and made the part of this for parsing title use a more normal idiom.
(WebCore::HTMLLinkElement::process): Removed many unneeded arguments, made the
logic of the code a little easier to follow.
(WebCore::HTMLLinkElement::removedFrom): Removed a call to a function that had
an empty body.
(WebCore::HTMLLinkElement::iconType): Updated for change to LinkRelElement.
(WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
* html/HTMLLinkElement.h: More of the same.

* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute): Initialize data members in the
struct itself. Got rid of "m_" prefix since this is a struct, not a class.
Changed code to use modern for loop; even better would be to eliminate the
splitting into a vector entirely and use StringView (do that next time).
* html/LinkRelAttribute.h: See above.

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
Updated for chnages to LinkRelAttribute and give the local variable a clearer name.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didChangeIcons): Removed.
* loader/FrameLoader.h: Removed didChangeIcons.

* loader/FrameLoaderClient.h: Added include for String since it's no longer
taken care of by IconURLs.h.

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::LinkLoader): Take a reference instead of a pointer.
(WebCore::LinkLoader::linkLoadTimerFired): Use m_client reference instead of pointer.
(WebCore::LinkLoader::linkLoadingErrorTimerFired): Ditto.
(WebCore::LinkLoader::notifyFinished): Use nullptr.
(WebCore::LinkLoader::loadLink): Tweak formatting. Move the dispatchDidChangeIcons
call in here instead of going through Document to FrameLoader and then FrameLoader to
FrameLoaderClient, and passing extra unused arguments, the way the old code did.
Use a reference instead of a pointer for the document.
(WebCore::LinkLoader::released): Removed. Empty function.

* loader/LinkLoader.h: Changed constructor argument to be a reference. Made more
things private. Removed empty released function.

* loader/icon/IconController.cpp:
(WebCore::IconController::IconController): Moved initialization of data members to
the class definition in the header.
(WebCore::iconsFromLinkElements): Added. This function replaces the existing
Document::iconURLs function, but has a simpler implementation and interface.
It focuses on exactly what the code in this file needs. If we want to add some
more features to the icon controller we might make this more complex again.
Even now, building a vector is not necessarily helpful; the only client of this
function ends up extracting only one of the URLs this function returns.
(WebCore::IconController::url): Rewrote this. It's the only function actually
using the icon URLs. This contains a combination of the logic from the various
functions in this class before, including iconURL, urlsForTypes, appendToIconURLs,
and defaultURL. Among other improvements, replaced the unusual code to construct
the icon URL with a call to Document::completeURL.
(WebCore::IconController::startLoader): Refactored a bit to remove a local variable.
(WebCore::IconController::continueLoadWithDecision): Ditto.

* loader/icon/IconController.h: Removed unneeded includes, unneeded use of
WTF_MAKE_NONCOPYABLE (since classes with data members of reference type are
automatically noncopyable), unused fucntions. Also initialize m_waitingForLoadDecision.

* testing/Internals.cpp:
(WebCore::Internals::iconURLs): Removed.
(WebCore::Internals::shortcutIconURLs): Left this in place since it is used by
tests. Changed it to return the actual value from the IconController::url function,
since that's the interface to our icon machinery that is actually exposed on some
platforms. That means this returns only a single URL.
(WebCore::Internals::allIconURLs): Removed.
* testing/Internals.h: Removed allIconURLs and iconURLs.
* testing/Internals.idl: Removed allIconURLs.

LayoutTests:

* fast/dom/icon-url-list-apple-touch-expected.txt: Removed.
* fast/dom/icon-url-list-apple-touch.html: Removed. This tested code that was
not actually used in any WebKit port.

* fast/dom/icon-url-list.html: Updated to expect only a single icon URL;
the icon machinery in WebKit doesn't return arrays at this time. It's better to
test what we actually expose.

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

4 years agoFix EFL and Gtk build.
simon.fraser@apple.com [Sun, 5 Apr 2015 00:53:22 +0000 (00:53 +0000)]
Fix EFL and Gtk build.

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

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

4 years agoCrash under Document::absoluteRegionForEventTargets on build.webkit.org/dashboard
simon.fraser@apple.com [Sun, 5 Apr 2015 00:51:53 +0000 (00:51 +0000)]
Crash under Document::absoluteRegionForEventTargets on build.webkit.org/dashboard
https://bugs.webkit.org/show_bug.cgi?id=143406
rdar://problem/20407080

Reviewed by Ryosuke Niwa.

Source/WebCore:

We failed to remove elements from Document's m_wheelEventTargets HashSet when the
elements were destroyed with wheel handlers still on them. Fix by removing the
node from the set via Node::willBeDeletedFrom().

Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash.html
       platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash.html
       platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash.html

* dom/Document.cpp:
(WebCore::removeHandlerFromSet): Helper to remove one or all handlers on the given node.
(WebCore::Document::didRemoveWheelEventHandler): Add a parameter to specify whether we're
removing all handlers on the given node.
(WebCore::Document::didRemoveTouchEventHandler): Use removeHandlerFromSet().
* dom/Document.h:
* dom/Node.cpp:
(WebCore::Node::willBeDeletedFrom): Tell the document we're removing all handlers
for this node.

LayoutTests:

Test configurations of elements with different parenting and event handlers adding orders, and multiple handlers on
the same node.

* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash.html: Added.

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

4 years ago[WK2][Cocoa] Add a way to temporarily disable the WebKit Network Cache for testing
cdumez@apple.com [Sun, 5 Apr 2015 00:19:29 +0000 (00:19 +0000)]
[WK2][Cocoa] Add a way to temporarily disable the WebKit Network Cache for testing
https://bugs.webkit.org/show_bug.cgi?id=143392
<rdar://problem/20315669>

Reviewed by Antti Koivisto.

Add a way to temporarily disable the WebKit Network Cache for testing.
It will be used temporarily for comparing page load times with and
without the WebKit network disk cache enabled.

This is in addition to the existing "WebKitNetworkCacheEnabled"
NSUserDefaults:
webkitNetworkCacheIsEnabled = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey]
    && ![defaults boolForKey:WebKitNetworkCacheTemporarilyDisabledForTestingKey];

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

4 years agoLogically empty WeakBlocks should not pin down their MarkedBlocks indefinitely.
akling@apple.com [Sat, 4 Apr 2015 23:16:21 +0000 (23:16 +0000)]
Logically empty WeakBlocks should not pin down their MarkedBlocks indefinitely.
<https://webkit.org/b/143210>

Reviewed by Geoffrey Garen.

Since a MarkedBlock cannot be destroyed until all the WeakBlocks pointing into it are gone,
we had a little problem where WeakBlocks with only null pointers would still keep their
MarkedBlock alive.

This patch fixes that by detaching WeakBlocks from their MarkedBlock once a sweep discovers
that the WeakBlock contains no pointers to live objects. Ownership of the WeakBlock is passed
to the Heap, which will sweep the list of these detached WeakBlocks as part of a full GC,
destroying them once they're fully dead.

This allows the garbage collector to reclaim the 64kB MarkedBlocks much sooner, and resolves
a mysterious issue where doing two full garbage collections back-to-back would free additional
memory in the second collection.

Management of detached WeakBlocks is implemented as a Vector<WeakBlock*> in Heap, along with
an index of the next block in that vector that needs to be swept. The IncrementalSweeper then
calls into Heap::sweepNextLogicallyEmptyWeakBlock() to sweep one block at a time.

* heap/Heap.h:
* heap/Heap.cpp:
(JSC::Heap::collectAllGarbage): Add a final pass where we sweep the logically empty WeakBlocks
owned by Heap, after everything else has been swept.

(JSC::Heap::notifyIncrementalSweeper): Set up an incremental sweep of logically empty WeakBlocks
after a full garbage collection ends. Note that we don't do this after Eden collections, since
they are unlikely to cause entire WeakBlocks to go empty.

(JSC::Heap::addLogicallyEmptyWeakBlock): Added. Interface for passing ownership of a WeakBlock
to the Heap when it's detached from a WeakSet.

(JSC::Heap::sweepAllLogicallyEmptyWeakBlocks): Helper for collectAllGarbage() that sweeps all
of the logically empty WeakBlocks owned by Heap.

(JSC::Heap::sweepNextLogicallyEmptyWeakBlock): Sweeps one logically empty WeakBlock if needed
and updates the next-logically-empty-weak-block-to-sweep index.

(JSC::Heap::lastChanceToFinalize): call sweepAllLogicallyEmptyWeakBlocks() here, since there
won't be another chance after this.

* heap/IncrementalSweeper.h:
(JSC::IncrementalSweeper::hasWork): Deleted.

* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::fullSweep):
(JSC::IncrementalSweeper::doSweep):
(JSC::IncrementalSweeper::sweepNextBlock): Restructured IncrementalSweeper a bit to simplify
adding a new sweeping stage for the Heap's logically empty WeakBlocks. sweepNextBlock() is
changed to return a bool (true if there's more work to be done.)

* heap/WeakBlock.cpp:
(JSC::WeakBlock::sweep): This now figures out if the WeakBlock is logically empty, i.e doesn't
contain any pointers to live objects. The answer is stored in a new SweepResult member.

* heap/WeakBlock.h:
(JSC::WeakBlock::isLogicallyEmptyButNotFree): Added. Can be queried after a sweep to determine
if the WeakBlock could be detached from the MarkedBlock.

(JSC::WeakBlock::SweepResult::SweepResult): Deleted in favor of initializing member variables
when declaring them.

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

4 years agoREGRESSION (r182215): Feedly crashes when closing article
simon.fraser@apple.com [Sat, 4 Apr 2015 22:39:29 +0000 (22:39 +0000)]
REGRESSION (r182215): Feedly crashes when closing article
https://bugs.webkit.org/show_bug.cgi?id=143405
rdar://problem/20382734, rdar://problem/20395497

Reviewed by Tim Horton.

Source/WebCore:

Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
is bad, because it can cause FrameView::layout() to get called in the middle of
RenderObject destruction, which leaves the render tree in a bad state.

Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.

AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
a flag to say that the non-fast region needs to be recomputed, and that schedules
a scrolling tree commit. When the commit happens, we recompute the region. If the
region didn't change, and no other changes are pending, there's no need to commit.

Test: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty):
(WebCore::AsyncScrollingCoordinator::willCommitTree):
(WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): Need to eagerly update
the non-fast scrollable region.
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::ScrollingCoordinator):
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::willCommitTree):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
(WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
(WebCore::ScrollingCoordinatorMac::commitTreeState):

Source/WebKit2:

Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
is bad, because it can cause FrameView::layout() to get called in the middle of
RenderObject destruction, which leaves the render tree in a bad state.

Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.

AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
a flag to say that the non-fast region needs to be recomputed, and that schedules
a scrolling tree commit. When the commit happens, we recompute the region. If the
region didn't change, and no other changes are pending, there's no need to commit.

* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::buildTransaction):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs.

LayoutTests:

Test that triggers a crash without the fix (thanks to Zalan for the test).

* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html: Added.

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

4 years agoDifferentiate between composited scrolling, and async scrolling
simon.fraser@apple.com [Sat, 4 Apr 2015 19:24:45 +0000 (19:24 +0000)]
Differentiate between composited scrolling, and async scrolling
https://bugs.webkit.org/show_bug.cgi?id=143291

Reviewed by Sam Weinig.

Source/WebCore:

ScrollableArea::usesCompositedScrolling() meant "uses aysnc scrolling", but
FrameView::contentsInCompositedLayer() covered a related concept, that scrolling
happens by moving compositing layers around.

Make the difference between these more explicit by adding ScrollableArea::usesAsyncScrolling(),
which means that scrolling for that ScrollableArea is asynchronous and managed
by a ScrollingCoordinator. This is the meaning that ScrollingCoordinator::computeNonFastScrollableRegion()
understands.

ScrollableArea::usesCompositedScrolling() is now repurposed to mean "scrolling
occurs by moving layers around, not requiring repaint". FrameView::contentsInCompositedLayer()
is renamed to usesCompositedScrolling(), and overrides the base class function.

This only changes behavior in tests that call setScrollingTreeIncludesFrames(true).

* page/FrameView.cpp:
(WebCore::FrameView::useSlowRepaints):
(WebCore::FrameView::usesCompositedScrolling):
(WebCore::FrameView::usesAsyncScrolling):
(WebCore::FrameView::scrollContentsFastPath):
(WebCore::FrameView::scrollContentsSlowPath):
(WebCore::FrameView::contentsInCompositedLayer): Deleted.
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::usesAsyncScrolling):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::usesAsyncScrolling):
* rendering/RenderLayer.h:

LayoutTests:

Rebaseline tests that call setScrollingTreeIncludesFrames(true), where those subframes
are now excluded from the non-fast scrollable region.

* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt:

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

4 years ago[Streams API] Collecting a ReadableStreamReader should not unlock its stream
youenn.fablet@crf.canon.fr [Sat, 4 Apr 2015 17:16:21 +0000 (17:16 +0000)]
[Streams API] Collecting a ReadableStreamReader should not unlock its stream
https://bugs.webkit.org/show_bug.cgi?id=143333

Reviewed by Benjamin Poulain.

Source/WebCore:

This patch stores as a boolean whether the stream is locked to a reader.
In case the reader forget to unlock the stream, the reader can be collected and destructor called.
In that case, the link between reader and stream will be reset but the stream will remain in locked state.

Covered by new test in streams/readablestreamreader-constructor.html.

* Modules/streams/ReadableStream.h:
(WebCore::ReadableStream::isLocked):
(WebCore::ReadableStream::lock):
(WebCore::ReadableStream::release):
(WebCore::ReadableStream::releaseButKeepLocked): Introduced to cut the link between reader and stream but stil keeping the stream locked.
* Modules/streams/ReadableStreamReader.cpp:
(WebCore::ReadableStreamReader::~ReadableStreamReader):
* bindings/js/JSReadableStreamCustom.cpp:
(WebCore::JSReadableStream::getReader):
* bindings/js/JSReadableStreamReaderCustom.cpp:
(WebCore::constructJSReadableStreamReader):

LayoutTests:

* streams/readablestreamreader-constructor-expected.txt:
* streams/readablestreamreader-constructor.html:

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

4 years agoImplement ES6 Object.getOwnPropertySymbols
utatane.tea@gmail.com [Sat, 4 Apr 2015 14:32:53 +0000 (14:32 +0000)]
Implement ES6 Object.getOwnPropertySymbols
https://bugs.webkit.org/show_bug.cgi?id=141106

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch implements `Object.getOwnPropertySymbols`.
One technical issue is that, since we use private symbols (such as `@Object`) in the
privileged JS code in `builtins/`, they should not be exposed.
To distinguish them from the usual symbols, check the target `StringImpl*` is a not private name
before adding it into PropertyNameArray.

To check the target `StringImpl*` is a private name, we leverage privateToPublic map in `BuiltinNames`
since all private symbols are held in this map.

* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutableInternal):
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::isPrivateName):
* runtime/CommonIdentifiers.cpp:
(JSC::CommonIdentifiers::isPrivateName):
* runtime/CommonIdentifiers.h:
* runtime/EnumerationMode.h:
(JSC::EnumerationMode::EnumerationMode):
(JSC::EnumerationMode::includeSymbolProperties):
* runtime/ExceptionHelpers.cpp:
(JSC::createUndefinedVariableError):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::getOwnNonIndexPropertyNames):
* runtime/JSSymbolTableObject.cpp:
(JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::finishCreation):
(JSC::objectConstructorGetOwnPropertySymbols):
(JSC::defineProperties):
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
* runtime/ObjectConstructor.h:
(JSC::ObjectConstructor::create):
* runtime/Structure.cpp:
(JSC::Structure::getPropertyNamesFromStructure):
* tests/stress/object-get-own-property-symbols-perform-to-object.js: Added.
(compare):
* tests/stress/object-get-own-property-symbols.js: Added.
(forIn):
* tests/stress/symbol-define-property.js: Added.
(testSymbol):
* tests/stress/symbol-seal-and-freeze.js: Added.
* tests/stress/symbol-with-json.js: Added.

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

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

4 years agoMediaDevices possesses a vtable despite using ImplementationLacksVTable IDL attribute
zandobersek@gmail.com [Sat, 4 Apr 2015 06:08:31 +0000 (06:08 +0000)]
MediaDevices possesses a vtable despite using ImplementationLacksVTable IDL attribute
https://bugs.webkit.org/show_bug.cgi?id=143367

Reviewed by Eric Carlson.

* Modules/mediastream/MediaDevices.idl: MediaDevices ends up with a vtable
because of inheriting from ContextDestructionObserver. This collides with
the ImplementationLacksVTable IDL attribute, causing compilation errors
with Clang. Since MediaDevices isn't being inherited from, but will still
end up with a vtable, the IDL attribute should be removed.

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

4 years agoAttempted build fix.
bdakin@apple.com [Sat, 4 Apr 2015 01:55:56 +0000 (01:55 +0000)]
Attempted build fix.

* UIProcess/API/mac/WKView.mm:

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

4 years agoFix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone...
simon.fraser@apple.com [Sat, 4 Apr 2015 00:42:06 +0000 (00:42 +0000)]
Fix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone on iOS
https://bugs.webkit.org/show_bug.cgi?id=143394

Reviewed by Tim Horton.

A client reshuffle at some point broke the dispatch of the ReachedSessionRestorationRenderTreeSizeThreshold
milestone. Fix by using WebPageProxy::didLayout() to fire the milestone.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCommitLayerTree):

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

4 years agofast/fixed-layout/fixed-layout.html is flaky
timothy_horton@apple.com [Sat, 4 Apr 2015 00:07:54 +0000 (00:07 +0000)]
fast/fixed-layout/fixed-layout.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=143379

Reviewed by Simon Fraser.

* TestExpectations:
Un-flakify the fixed layout test.

* fast/css-grid-layout/flex-content-sized-columns-resize-expected.html:
Remove a mistaken line in the original test; this function doesn't exist in WebKit
and was presumably ported directly from the Blink test (and then never noticed because
JS exceptions thrown in -expected files go nowhere).

* fast/fixed-layout/fixed-layout.html:
Make the fixed layout test less racy by waiting for the resize event (which can be
very asynchronous). Also, force a layout before resizing to ensure that we
always do get a resize event.

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

4 years agohttps://bugs.webkit.org/show_bug.cgi?id=143387
bdakin@apple.com [Fri, 3 Apr 2015 23:52:27 +0000 (23:52 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=143387
Improvements to webkitmouseforce web API
-and corresponding-
rdar://problem/20281808
rdar://problem/20281853

Reviewed by Darin Adler.

This patch:
1. Dispatches webkitmouseforceup and webkitmouseforceclick at the right time.
2. Dispatches webkitmouseforcechanged from mousedown all the way through through
mouseup.
3. Uses force values from pressureChangeWithEvent instead of the immediate action
gesture recognizer.

Listen for this NSResponder method, and pass the relevant info to WebPageProxy to
dispatch to the web process.
* UIProcess/API/mac/WKView.mm:
(-[WKView pressureChangeWithEvent:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::inputDeviceForceDidChange):
(WebKit::WebPageProxy::immediateActionDidUpdate):
* UIProcess/WebPageProxy.h:

The web process still needs to know when the immediate action gesture recognizer
is updating, but it doesn’t need the force information. That will come from
pressureChangeWithEvent.
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):

Cache m_lastForceStage so that we can determine if we are
transitioning to a new stage.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:

New message for InputDeviceForceDidChange and modified message for
ImmediateActionDidUpdate
* WebProcess/WebPage/WebPage.messages.in:

inputDeviceForceDidChange now takes care of dispatching mouseforcechanged,
mouseforcedown, mouseforceup, and mouseforceclick.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::inputDeviceForceDidChange):

We still need to keep track of the ImmediateActionStages in WebCore::EventHandler
so that we can have the right default behavior on mouseup based on whether or not
that action began and was completed. (In other words, to ensure we don’t navigate
to a link after force clicking it.)
(WebKit::WebPage::immediateActionDidUpdate):
(WebKit::WebPage::immediateActionDidComplete):

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

4 years agoAdd Options::jitPolicyScale() as a single knob to make all compilations happen sooner.
mark.lam@apple.com [Fri, 3 Apr 2015 22:52:00 +0000 (22:52 +0000)]
Add Options::jitPolicyScale() as a single knob to make all compilations happen sooner.
<https://webkit.org/b/143385>

Reviewed by Geoffrey Garen.

For debugging purposes, sometimes, we want to be able to make compilation happen
sooner to see if we can accelerate the manifestation of certain events / bugs.
Currently, in order to achieve this, we'll have to tweak multiple JIT thresholds
which make up the compilation policy.  Let's add a single knob that can tune all
the thresholds up / down in one go proportionately so that we can easily tweak
how soon compilation occurs.

* runtime/Options.cpp:
(JSC::scaleJITPolicy):
(JSC::recomputeDependentOptions):
* runtime/Options.h:

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

4 years agois* API methods should be @properties
ggaren@apple.com [Fri, 3 Apr 2015 22:18:05 +0000 (22:18 +0000)]
is* API methods should be @properties
https://bugs.webkit.org/show_bug.cgi?id=143388

Reviewed by Mark Lam.

This appears to be the preferred idiom in WebKit, CA, AppKit, and
Foundation.

* API/JSValue.h: Be @properties.

* API/tests/testapi.mm:
(testObjectiveCAPI): Use the @properties.

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

4 years ago[Content Extensions] Add memory reporting.
achristensen@apple.com [Fri, 3 Apr 2015 21:44:41 +0000 (21:44 +0000)]
[Content Extensions] Add memory reporting.
https://bugs.webkit.org/show_bug.cgi?id=143386

Reviewed by Benjamin Poulain.

* contentextensions/CompiledContentExtension.cpp:
(WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
* contentextensions/CompiledContentExtension.h:
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
* contentextensions/ContentExtension.h:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* contentextensions/ContentExtensionsDebugging.h:
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::getBits):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
* contentextensions/DFABytecodeInterpreter.h:
(WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
(WebCore::ContentExtensions::DFABytecodeInterpreter::~DFABytecodeInterpreter):
Keep track of which memory pages in the bytecode are being hit if CONTENT_EXTENSIONS_MEMORY_REPORTING is 1.
When CONTENT_EXTENSIONS_MEMORY_REPORTING is 0, this makes an empty vector in ContentExtension
and passes some pointers on the stack, many of which can be optimized out by the C++ compiler.

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

4 years agoExpand test infrastructure to support scrolling tests
bfulgham@apple.com [Fri, 3 Apr 2015 21:32:59 +0000 (21:32 +0000)]
Expand test infrastructure to support scrolling tests
https://bugs.webkit.org/show_bug.cgi?id=143383

Reviewed by Darin Adler.

No new tests: No change in behavior.

This is an initial set of changes that clean up a few things I noticed while extending testing support
for scroll animations and wheel event gestures.
1. Reduce the amount of #ifdef code in EventHandler{Mac}.
2. Consolidate the idea of an "End Gesture" in the PlatformWheelEvent class.
3. Remove a number of unneeded null checks in EventHandler.
4. ScrollController must always have a client, so hold a reference instead of using a pointer.

* page/EventHandler.cpp:
(WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
(WebCore::EventHandler::handleWheelEvent): Call 'platformNotifySnapIfNecessary' at method exit points.
(WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformCompleteWheelEvent):  Remove unneeded null checks for 'view'. Remove
CSS_SNAP-specific call to 'platformNotifySnapIfNecessary'. This logic is now handled in the new
'platformNotifyIfEndGesture' method.
(WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
(WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Pass 'this' as
reference to ScrollController constructor.
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::shouldResetLatching): Call new 'isEndGesture' method.
(WebCore::PlatformWheelEvent::isEndGesture): Added method to encapsulate some code that was duplicated
in a number of places.
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::ScrollAnimator): Pass 'this' as reference to ScrollController constructor.
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::ScrollController): Update to reflect m_client is now a reference.
(WebCore::ScrollController::handleWheelEvent): Ditto.
(WebCore::ScrollController::snapRubberBandTimerFired): Ditto. Also, a drive-by fix for ending rubberband
snapping. This end-state wasn't deactivating the timer (even when the animation finished). This isn't a
huge problem, but I (will) rely on the state of the animation timer in a future patch to decide if
tests should run or continue waiting.
(WebCore::ScrollController::isRubberBandInProgress): Ditto.
(WebCore::ScrollController::startSnapRubberbandTimer): Ditto.
(WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
(WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
(WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Ditto.
(WebCore::ScrollController::startScrollSnapTimer): Ditto.
(WebCore::ScrollController::stopScrollSnapTimer): Ditto.
(WebCore::ScrollController::scrollSnapAnimationUpdate): Ditto.
(WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
(WebCore::ScrollController::computeSnapDelta): Ditto.
(WebCore::ScrollController::computeGlideDelta): Ditto.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::gestureShouldBeginSnap): Use new PlatformWheelEvent::isEndGesture() method.

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

4 years agoAX: Toggling check box state not speaking using plain space, not VO space.
cfleizach@apple.com [Fri, 3 Apr 2015 21:21:24 +0000 (21:21 +0000)]
AX: Toggling check box state not speaking using plain space, not VO space.
https://bugs.webkit.org/show_bug.cgi?id=143356

Reviewed by Darin Adler.

Source/WebCore:

The checkbox state change needs to result in a value change being generated, otherwise accessibility won't know the value has changed through keyboard usage.

Test: platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):

LayoutTests:

* platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space-expected.txt: Added.
* platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html: Added.

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

4 years agorun-jsc-stress-tests --remote should add libllvmForJSC.so to the bundle on Linux
ossy@webkit.org [Fri, 3 Apr 2015 21:20:40 +0000 (21:20 +0000)]
run-jsc-stress-tests --remote should add libllvmForJSC.so to the bundle on Linux
https://bugs.webkit.org/show_bug.cgi?id=143372

Reviewed by Darin Adler.

* Scripts/run-jsc-stress-tests:

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

4 years agoSome JSC Options refactoring and enhancements.
mark.lam@apple.com [Fri, 3 Apr 2015 21:01:43 +0000 (21:01 +0000)]
Some JSC Options refactoring and enhancements.
<https://webkit.org/b/143384>

Rubber stamped by Benjamin Poulain.

Create a better encapsulated Option class to make working with options easier.  This
is a building block towards a JIT policy scaling debugging option I will introduce later.

This work entails:
1. Convert Options::Option into a public class Option (who works closely with Options).
2. Convert Options::EntryType into an enum class Options::Type and make it public.
3. Renamed Options::OPT_<option name> to Options::<option name>ID because it reads better.
4. Add misc methods to class Option to make it more useable.

* runtime/Options.cpp:
(JSC::Options::dumpOption):
(JSC::Option::dump):
(JSC::Option::operator==):
(JSC::Options::Option::dump): Deleted.
(JSC::Options::Option::operator==): Deleted.
* runtime/Options.h:
(JSC::Option::Option):
(JSC::Option::operator!=):
(JSC::Option::name):
(JSC::Option::description):
(JSC::Option::type):
(JSC::Option::isOverridden):
(JSC::Option::defaultOption):
(JSC::Option::boolVal):
(JSC::Option::unsignedVal):
(JSC::Option::doubleVal):
(JSC::Option::int32Val):
(JSC::Option::optionRangeVal):
(JSC::Option::optionStringVal):
(JSC::Option::gcLogLevelVal):
(JSC::Options::Option::Option): Deleted.
(JSC::Options::Option::operator!=): Deleted.

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

4 years agoAdd time series segmentation algorithms as moving averages
rniwa@webkit.org [Fri, 3 Apr 2015 20:46:11 +0000 (20:46 +0000)]
Add time series segmentation algorithms as moving averages
https://bugs.webkit.org/show_bug.cgi?id=143362

Reviewed by Chris Dumez.

This patch implements two preliminary time series segmentation algorithms as moving averages.

Recursive t-test: Compute Welch's t-statistic at each point in a given segment of the time series.
If Welch's t-test implicates a statistically significance difference, then split the segment into two
sub segments with the maximum t-statistic (i.e. the point at which if split would yield the highest
probability that two segments do not share the same "underlying" mean in classical / frequentist sense).
We repeat this process recursively. See [1] for the evaluation of this particular algorithm.

Schwarz criterion: Use Schwarz or Bayesian information criterion to heuristically find the optimal
segmentation. Intuitively, the problem of finding the best segmentation comes down to minimizing the
residual sum of squares in each segment as in linear regressions. That is, for a given segment with
values y_1 through y_n with mean y_avg, we want to minimize the sum of (y_i - y_avg)^2 over i = 1
through i = n. However, we also don't want to split every data point into a separate segment so we need
to account the "cost" of introducing new segments. We use a cost function that's loosely based on two
models discussed in [2] for simplicity. We will tune this cost function further in the future.

The problem of finding the best segmentation then reduces to a search problem. Unfortunately, our problem
space is exponential with respect to the size of the time series since we could split at each data point.
We workaround this problem by first splitting the time series into a manageable smaller grids, and only
considering segmentation of a fixed size (i.e. the number of segments is constant). Since time series
tend to contain a lot more data points than segments, this strategy finds the optimal solution without
exploring much of the problem space.

Finding the optimal segmentation of a fixed size is, itself, another search problem that is equivalent to
finding the shortest path of a fixed length in DAG. Here, we use dynamic programming with a matrix of size
n by n where n is the length of the time series (grid). Each entry in this matrix at (i, k) stores
the minimum cost of segmenting data points 1 through i using k segments. We start our search at i = 1.
Clearly C(1, 0) = 0 (note the actual code uses 0-based index). In i-th iteration, we compute the cost
S(i, j) of each segment starting at i and ending at another point j after i and update C(j, k + 1) by
min( C(j, k + 1), C(i, k) + S(i, j) ) for all values of j above i.

[1] Kensuke Fukuda, H. Eugene Stanley, and Luis A. Nunes Amaral, "Heuristic segmentation of
a nonstationary time series", Physical Review E 69, 021108 (2004)

[2] Marc Lavielle, Gilles Teyssi`ere, "Detection of Multiple Change–Points in Multivariate Time Series"
Lithuanian Mathematical Journal, vol 46, 2006

* public/v2/index.html: Show the optional description for the chosen moving average strategy.
* public/v2/js/statistics.js:
(Statistics.testWelchsT):
(Statistics.computeWelchsT): Extracted from testWelchsT. Generalized to take the offset and the length
of each value array between which Welch's t-statistic is computed. This generalization helps the
Schwarz criterion segmentation algorithm avoid splitting values array O(n^2) times.
(.sampleMeanAndVarianceForValues): Ditto for the generalization.
(.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Added. Implements recursive t-test.
(.splitIntoSegmentsUntilGoodEnough): Added. Implements Schwarz criterion.
(.findOptimalSegmentation): Added. Implements the algorithm to find the optimal segmentation of a fixed
segment count.
(.SampleVarianceUpperTriangularMatrix): Added. Stores S(i, j) used by findOptimalSegmentation.
(.SampleVarianceUpperTriangularMatrix.prototype.costBetween): Added.

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

4 years agoREGRESSION: Perf dashboard sometimes fails to update zooming level
rniwa@webkit.org [Fri, 3 Apr 2015 20:43:56 +0000 (20:43 +0000)]
REGRESSION: Perf dashboard sometimes fails to update zooming level
https://bugs.webkit.org/show_bug.cgi?id=143359

Reviewed by Darin Adler.

The bug was caused by various bugs that ended up in an exception.

* public/v2/app.js:
(App.Pane._handleFetchErrors): Removed superfluous console.log.
(App.Pane.computeStatus): Fixed the bug in r182185 that previousPoint could be null.
(App.PaneController.actions.zoomed): Update the overview when the main chart triggered a zoom.
* public/v2/index.html: Replaced all instances of href="#" by href="javascript:false" to avoid navigating
to # when Ember.js fails to attach event listeners on time.
* public/v2/interactive-chart.js:
(App.InteractiveChartComponent._updateDimensionsIfNeeded): Avoid using a negative width or height when
the containing element's size is 0.
(App.InteractiveChartComponent._updateBrush): Ditto.

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

4 years ago2015-04-03 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Fri, 3 Apr 2015 20:16:53 +0000 (20:16 +0000)]
2015-04-03  Geoffrey Garen  <ggaren@apple.com>

        JavaScriptCore API should support type checking for Array and Date
        https://bugs.webkit.org/show_bug.cgi?id=143324

        Follow-up to address a comment by Dan.

        * API/WebKitAvailability.h: __MAC_OS_X_VERSION_MIN_REQUIRED <= 101100
        is wrong, since this API is available when __MAC_OS_X_VERSION_MIN_REQUIRED
        is equal to 101100.

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

4 years agoInjectedBundleNodeHandle::renderedImage() needs to be exposed from the Cocoa WebAPI...
commit-queue@webkit.org [Fri, 3 Apr 2015 20:12:25 +0000 (20:12 +0000)]
InjectedBundleNodeHandle::renderedImage() needs to be exposed from the Cocoa WebAPI layer.
https://bugs.webkit.org/show_bug.cgi?id=143341.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-04-03
Reviewed by Anders Carlsson.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Expose rendered
image injected bundle API from the Cocoa layer. A node in the page can be
rendered to an NSImage on MacOS and to a UIImage on iOS.

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

4 years agoUnreviewed, kick the GTK bots to fix an incremental build issue.
ossy@webkit.org [Fri, 3 Apr 2015 18:49:25 +0000 (18:49 +0000)]
Unreviewed, kick the GTK bots to fix an incremental build issue.

* Source/cmake/OptionsGTK.cmake:

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

4 years agoSimple line layout: Use pre-computed simple line runs to produce innerText content.
zalan@apple.com [Fri, 3 Apr 2015 18:27:55 +0000 (18:27 +0000)]
Simple line layout: Use pre-computed simple line runs to produce innerText content.
https://bugs.webkit.org/show_bug.cgi?id=143351

Reviewed by Antti Koivisto.

This is in preparation to cover <br> with simple line layout.
Runs provide line layout information that can be used to cover hard line break cases.
(similar to TextIterator::handleTextBox())

Covered by existing tests.

* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::emitCharacter):
(WebCore::TextIterator::emitText):
* editing/TextIterator.h:
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::isEndOfLine):

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

4 years ago2015-04-03 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Fri, 3 Apr 2015 17:55:06 +0000 (17:55 +0000)]
2015-04-03  Geoffrey Garen  <ggaren@apple.com>

        JavaScriptCore API should support type checking for Array and Date
        https://bugs.webkit.org/show_bug.cgi?id=143324

        Follow-up to address a comment by Dan.

        * API/WebKitAvailability.h: Do use 10.0 because it was right all along.
        Added a comment explaining why.

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

4 years ago[WK2][iOS] We should prevent NetworkProcess suspension while it has pending SQL trans...
cdumez@apple.com [Fri, 3 Apr 2015 17:54:47 +0000 (17:54 +0000)]
[WK2][iOS] We should prevent NetworkProcess suspension while it has pending SQL transactions
https://bugs.webkit.org/show_bug.cgi?id=143278
<rdar://problem/20180799>

Reviewed by Anders Carlsson.

Prevent NetworkProcess suspension while it has pending SQL transactions,
similarly to what we already did for WebProcesses. This patch moves the
WebSQLiteDatabaseTracker from WebProcess/ to Shared/ and make it usable
by the NetworkProcess class as well.

Whenever there are locked files to due SQL transactions, the
NetworkProcess will send an IPC message to the NetworkProcessProxy
which will hold a background process assertion until the NetworkProcess'
SQL transactions are complete. This way, it is no longer possible for
the NetworkProcess to get suspended while SQL transactions are running
and a database file is locked.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* Shared/WebSQLiteDatabaseTracker.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp.
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
(WebKit::m_childProcessType):
(WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
(WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
(WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
* Shared/WebSQLiteDatabaseTracker.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeConnection):
* WebProcess/WebProcess.h:

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

4 years agoRe-skip tests that got recently enabled, but time out.
ap@apple.com [Fri, 3 Apr 2015 17:24:40 +0000 (17:24 +0000)]
Re-skip tests that got recently enabled, but time out.

* platform/mac-wk2/TestExpectations:

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

4 years agoSource/WebCore:
antti@apple.com [Fri, 3 Apr 2015 17:23:39 +0000 (17:23 +0000)]
Source/WebCore:
Add non-counting bloom filter class
https://bugs.webkit.org/show_bug.cgi?id=143366

Reviewed by Sam Weinig.

* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::setupParentStack):
* css/SelectorFilter.h:

Update names.

Source/WebKit2:
Add non-counting Bloom filter implementation
https://bugs.webkit.org/show_bug.cgi?id=143366

Reviewed by Sam Weinig.

* NetworkProcess/cache/NetworkCacheStorage.h:

Source/WTF:
Add non-counting Bloom filter implementation
https://bugs.webkit.org/show_bug.cgi?id=143366

Reviewed by Sam Weinig.

Add a traditional single-bit-per-bucket Bloom filter in addition to the existing counting implementation.

- rename BloomFilter -> CountingBloomFilter.
- add a new basic BloomFilter type.
- update some terminology to match http://en.wikipedia.org/wiki/Bloom_filter and modernize the code a bit.
- add API tests.

* wtf/BloomFilter.h:
(WTF::BloomFilter::BloomFilter):
(WTF::BloomFilter::add):

    Also support merging.

(WTF::BloomFilter::mayContain):
(WTF::BloomFilter::arrayIndex):
(WTF::BloomFilter::bitMask):
(WTF::BloomFilter<keyBits>::mayContain):
(WTF::BloomFilter<keyBits>::add):
(WTF::BloomFilter<keyBits>::isBitSet):
(WTF::BloomFilter<keyBits>::setBit):
(WTF::BloomFilter<keyBits>::clear):
(WTF::CountingBloomFilter::CountingBloomFilter):
(WTF::CountingBloomFilter::mayContain):
(WTF::CountingBloomFilter::firstBucket):
(WTF::CountingBloomFilter::secondBucket):
(WTF::CountingBloomFilter<keyBits>::add):
(WTF::CountingBloomFilter<keyBits>::remove):
(WTF::CountingBloomFilter<keyBits>::clear):
(WTF::CountingBloomFilter<keyBits>::likelyEmpty):
(WTF::CountingBloomFilter<keyBits>::isClear):
(WTF::BloomFilter::maximumCount): Deleted.
(WTF::BloomFilter::firstSlot): Deleted.
(WTF::BloomFilter::secondSlot): Deleted.
(WTF::BloomFilter<keyBits>::remove): Deleted.
(WTF::BloomFilter<keyBits>::likelyEmpty): Deleted.
(WTF::BloomFilter<keyBits>::isClear): Deleted.

Tools:
Add non-counting bloom filter class
https://bugs.webkit.org/show_bug.cgi?id=143366

Reviewed by Sam Weinig.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/BloomFilter.cpp: Added.
(TestWebKitAPI::generateRandomHashes):
(TestWebKitAPI::TEST):

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

4 years agoRemove dead code.
commit-queue@webkit.org [Fri, 3 Apr 2015 16:46:27 +0000 (16:46 +0000)]
Remove dead code.
https://bugs.webkit.org/show_bug.cgi?id=143352

Patch by Alex Christensen <achristensen@webkit.org> on 2015-04-03
Reviewed by Gyuyoung Kim.

* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::openDateTimeChooser): Deleted.
* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::openDateTimeChooser): Deleted.
* page/Chrome.h:
* page/ChromeClient.h:
Remove ChromeClient::openDateTimeChooser.

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

4 years agofast/fixed-layout/fixed-layout.html is flaky
ap@apple.com [Fri, 3 Apr 2015 16:38:01 +0000 (16:38 +0000)]
fast/fixed-layout/fixed-layout.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=143379

* TestExpectations: Marking it as such.

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

4 years agoFTL JIT tests should fail if LLVM library isn't available
ossy@webkit.org [Fri, 3 Apr 2015 16:01:34 +0000 (16:01 +0000)]
FTL JIT tests should fail if LLVM library isn't available
https://bugs.webkit.org/show_bug.cgi?id=143374

Reviewed by Mark Lam.

Source/JavaScriptCore:

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* runtime/Options.h:

Tools:

* Scripts/run-jsc-stress-tests:

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

4 years ago[EFL] Speedup jhbuild with disable running autogen.sh
ossy@webkit.org [Fri, 3 Apr 2015 12:52:10 +0000 (12:52 +0000)]
[EFL] Speedup jhbuild with disable running autogen.sh
https://bugs.webkit.org/show_bug.cgi?id=143369

Reviewed by Gyuyoung Kim.

* efl/jhbuild.modules:

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

4 years ago[WK2] Unskip now passing tests after r135595
ossy@webkit.org [Fri, 3 Apr 2015 12:30:03 +0000 (12:30 +0000)]
[WK2] Unskip now passing tests after r135595
https://bugs.webkit.org/show_bug.cgi?id=127428

Unreviewed gardening.

* platform/mac-wk2/TestExpectations: Mark editing/selection/context-menu-text-selection.html as timeouting test.
* platform/wk2/TestExpectations: Unskip now passing tests.

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

4 years agoFix the EFL and GTK build after r182243
zandobersek@gmail.com [Fri, 3 Apr 2015 12:23:06 +0000 (12:23 +0000)]
Fix the EFL and GTK build after r182243
https://bugs.webkit.org/show_bug.cgi?id=143361

Reviewed by Csaba Osztrogonác.

.:

* Source/PlatformEfl.cmake: Add a custom command that copies
the InspectorBackendCommands.js file into the proper directory
under DerivedSources/WebInspectorUI/.

Source/JavaScriptCore:

* CMakeLists.txt: InspectorBackendCommands.js is generated in the
DerivedSources/JavaScriptCore/inspector/ directory.

Source/WebKit2:

* PlatformGTK.cmake: Add a custom command that copies the
InspectorBackendCommands.js file into the proper directory
under DerivedSources/WebInspectorUI/.

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

4 years agoUnreviewed, fixing Clang builds of the GTK port on Linux.
zandobersek@gmail.com [Fri, 3 Apr 2015 12:20:06 +0000 (12:20 +0000)]
Unreviewed, fixing Clang builds of the GTK port on Linux.

Source/JavaScriptCore:

* runtime/Options.cpp:
Include the <math.h> header for isnan().

Source/WebCore:

* Modules/mediastream/MediaDevices.h:
Include the <functional> header for uses of std::function<>.

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

4 years ago[EFL] Fix 18 crashing compositing tests after r182101
ossy@webkit.org [Fri, 3 Apr 2015 11:23:23 +0000 (11:23 +0000)]
[EFL] Fix 18 crashing compositing tests after r182101
https://bugs.webkit.org/show_bug.cgi?id=143214

Unreviewed gardening, comment out the original expectations after r182311.

* platform/efl/TestExpectations:

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

4 years ago[EFL] Fix 18 crashing compositing tests after r182101
ossy@webkit.org [Fri, 3 Apr 2015 10:55:21 +0000 (10:55 +0000)]
[EFL] Fix 18 crashing compositing tests after r182101
https://bugs.webkit.org/show_bug.cgi?id=143214

Unreviewed gardening, add crash expectations until proper fix.

* platform/efl/TestExpectations:

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

4 years agoUnreviewed gardening. Skip fast/fixed-layout, because it made the following tests...
ossy@webkit.org [Fri, 3 Apr 2015 10:27:52 +0000 (10:27 +0000)]
Unreviewed gardening. Skip fast/fixed-layout, because it made the following tests fail.

* platform/efl/TestExpectations:

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

4 years agoUnreviewed, GTK build fix.
philn@webkit.org [Fri, 3 Apr 2015 09:17:46 +0000 (09:17 +0000)]
Unreviewed, GTK build fix.

* UIProcess/API/gtk/WebKitContextMenuClient.cpp:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
* UIProcess/gtk/WebContextMenuProxyGtk.h:

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

4 years ago[Streams API] Split ReadableStream/Reader implementation according source type (JS...
youenn.fablet@crf.canon.fr [Fri, 3 Apr 2015 08:07:34 +0000 (08:07 +0000)]
[Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
https://bugs.webkit.org/show_bug.cgi?id=143130

Reviewed by Benjamin Poulain.

Introduce ReadableJSStream and ReadableJSStreamReader as subclasses of ReadableStream and ReadableStreamReader.
These classes manage JS based sources: ReadableStream JS constructor instantiates ReadableJStream.
These classes are expected to handle JS source specific handling, in particular JSValue error storage and JSValue chunk queue.
Making ReadableStream and ReadableStreamReader abstract, to be subclassed for native sources.

Current tests cover the changes.

* Modules/streams/ReadableStream.cpp:
(WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ease subclassing.
(WebCore::ReadableStream::create): Deleted as ReadableStream is now abstarct.
* Modules/streams/ReadableStream.h: Made createReader virtual pure.
* Modules/streams/ReadableStream.idl: Skipping VTable validation as subclasses of ReadableStream may be JS wrapped.
* Modules/streams/ReadableStreamReader.cpp: Removed ReadableStreamReader::create.
* Modules/streams/ReadableStreamReader.h: Ditto.
* Modules/streams/ReadableStreamReader.idl: Skipping VTable validation as subclasses of ReadableStreamReader may be JS wrapped.
* bindings/js/JSReadableStreamCustom.cpp:
(WebCore::constructJSReadableStream): Instantiating ReadableJSStream in lieu of ReadableStream within JS constructor.
* bindings/js/ReadableStreamJSSource.cpp:
(WebCore::ReadableJSStream::create):
(WebCore::ReadableJSStream::createReader): Instantiating ReadableJSStreamReader.
(WebCore::ReadableJSStream::ReadableJSStream):
(WebCore::ReadableJSStreamReader::create):
(WebCore::ReadableJSStreamReader::ReadableJSStreamReader):
* bindings/js/ReadableStreamJSSource.h: Definition of ReadableJSStream and ReadableJSStreamReader.

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

4 years agoTypo fix.
ossy@webkit.org [Fri, 3 Apr 2015 06:39:27 +0000 (06:39 +0000)]
Typo fix.

* PlatformGTK.cmake:

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

4 years agoScrollbars are left in the wrong position when resizing a fixed layout view
timothy_horton@apple.com [Fri, 3 Apr 2015 06:37:15 +0000 (06:37 +0000)]
Scrollbars are left in the wrong position when resizing a fixed layout view
https://bugs.webkit.org/show_bug.cgi?id=143360

Reviewed by Beth Dakin.

Test: fast/fixed-layout/fixed-layout.html

* platform/ScrollView.cpp:
(WebCore::ScrollView::setFrameRect):
Update scrollbars when the ScrollView frameRect changes. We were previously
depending on the layout that always happens after this to update scrollbars,
but with fixed layout mode, there won't be a layout! Also, FrameView's
setFrameRect override will sync this scrollbar update with the scrollbar
layers (via RenderLayerCompositor::frameViewDidChangeSize) immediately afterwards.

* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Turn off fixed layout when resetting state.

(WebCore::Internals::setUseFixedLayout):
(WebCore::Internals::setFixedLayoutSize):
* testing/Internals.h:
* testing/Internals.idl:
Add internals functions to set the fixed layout size and to turn on fixed layout.

* fast/fixed-layout/fixed-layout-expected.png: Added.
* fast/fixed-layout/fixed-layout-expected.txt: Added.
* fast/fixed-layout/fixed-layout.html: Added.
Add a simple fixed layout test. We can add more (or recover some from
when the Qt tests were purged) now that it's testable again.

This test also happens to test the aforementioned setFrameRect change,
because without it, the RenderView's layer would be left at the wrong
size (800x600) because the scrollbars would be left behind in the resize.

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

4 years agoURTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and...
ossy@webkit.org [Fri, 3 Apr 2015 06:36:09 +0000 (06:36 +0000)]
URTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and GTK.

* PlatformEfl.cmake:
* PlatformGTK.cmake:
* Shared/efl/NativeContextMenuItemEfl.cpp: Added.
(WebKit::NativeContextMenuItem::NativeContextMenuItem):
* Shared/gtk/NativeContextMenuItemGtk.cpp: Added.
(WebKit::NativeContextMenuItem::NativeContextMenuItem):

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