WebKit-https.git
7 years agoFix lifetime handling of SVGPropertyTearOffs
ddkilzer@apple.com [Sat, 1 Mar 2014 16:26:15 +0000 (16:26 +0000)]
Fix lifetime handling of SVGPropertyTearOffs
<http://webkit.org/b/129211>
<rdar://problem/15696025>

Reviewed by Maciej Stachowiak.

Merged from Blink (patch by Ojan Vafai):
https://src.chromium.org/viewvc/blink?revision=157801&view=revision
http://crbug.com/288771

    -Replace SVGStaticPropertyWithParentTearOff with SVGMatrixTearOff
    since it's only used in that one place. This means we can get rid
    of the templatizing and the method pointer.
    -Change SVGPropertyTearOff to keep track of it's child tearoffs
    and call detachWrapper on its child tearoffs when it's destroyed
    or when it's wrapper is detached.
    -Have SVGPropertyTearOff hold WeakPtrs to the child tearoffs
    to avoid having a cycle.

Source/WebCore:

Test: svg/transforms/svg-matrix-tearoff-crash.html

* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue):
* svg/properties/SVGMatrixTearOff.h: Renamed from Source/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h.
(WebCore::SVGMatrixTearOff::create):
(WebCore::SVGMatrixTearOff::commitChange):
(WebCore::SVGMatrixTearOff::SVGMatrixTearOff):
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::addChild):
(WebCore::SVGPropertyTearOff::detachChildren):

LayoutTests:

* svg/transforms/svg-matrix-tearoff-crash-expected.txt: Added.
* svg/transforms/svg-matrix-tearoff-crash.html: Added.

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

7 years agoUnreviewed build fix after r164913.
zandobersek@gmail.com [Sat, 1 Mar 2014 09:35:33 +0000 (09:35 +0000)]
Unreviewed build fix after r164913.

* platform/CountedUserActivity.h: Some ports don't (yet) support forwarding headers for WebCore,
so UserActivity.h should be included as non-forwarding.

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

7 years agoUnreviewed follow-up to r164905 and r164912.
zandobersek@gmail.com [Sat, 1 Mar 2014 09:08:04 +0000 (09:08 +0000)]
Unreviewed follow-up to r164905 and r164912.

* Platform/IPC/Connection.h: Only declare setShouldCloseConnectionOnMachExceptions() for the Mac port.
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::didFinishLaunching): Only call setShouldCloseConnectionOnMachExceptions() on the Mac port.

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

7 years agoChange PageActivityAssertionToken to use a WeakPtr
barraclough@apple.com [Sat, 1 Mar 2014 09:01:58 +0000 (09:01 +0000)]
Change PageActivityAssertionToken to use a WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=129526

Reviewed by Sam Weinig.

PageThrottler effectively implements a bespoke weak pointer mechanism; remove this & just use WeakPtr.

* page/PageActivityAssertionToken.cpp:
(WebCore::PageActivityAssertionToken::PageActivityAssertionToken):
(WebCore::PageActivityAssertionToken::~PageActivityAssertionToken):
    - addActivityToken->incrementActivityCount, removeActivityToken->decrementActivityCount
* page/PageActivityAssertionToken.h:
    - removed invalidate, made m_throttler a WeakPtr
* page/PageThrottler.cpp:
(WebCore::PageThrottler::PageThrottler):
    - initialize m_weakPtrFactory, m_activityCount.
(WebCore::PageThrottler::~PageThrottler):
    - removed called to invalidate.
(WebCore::PageThrottler::startThrottleHysteresisTimer):
    - m_activityTokens.size()->m_activityCount
(WebCore::PageThrottler::throttleHysteresisTimerFired):
    - m_activityTokens.size()->m_activityCount
(WebCore::PageThrottler::incrementActivityCount):
    - m_activityTokens.add->++
(WebCore::PageThrottler::decrementActivityCount):
    - m_activityTokens.remove->--
* page/PageThrottler.h:
(WebCore::PageThrottler::weakPtr):
    - replaced HashSet with WeakPtrFactory & count.

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

7 years agoSplit UserActivity/CountedUserActivity
barraclough@apple.com [Sat, 1 Mar 2014 08:49:34 +0000 (08:49 +0000)]
Split UserActivity/CountedUserActivity
https://bugs.webkit.org/show_bug.cgi?id=129520

Reviewed by Sam Weinig.

UserActivity currently provides an interface allowing counted, nested calls to enable/disable.
In some cases it would be easier to use if it were a simpler boolean enabled/disabled interface.

Source/WebCore:

* WebCore.exp.in:
    - beginActivity->start, endActivity->stop.
* WebCore.xcodeproj/project.pbxproj:
* page/PageThrottler.cpp:
(WebCore::PageThrottler::PageThrottler):
(WebCore::PageThrottler::~PageThrottler):
(WebCore::PageThrottler::throttlePage):
(WebCore::PageThrottler::unthrottlePage):
(WebCore::PageThrottler::setIsVisuallyIdle):
    - beginActivity->increment, endActivity->decrement.
* page/PageThrottler.h:
    - UserActivity->CountedUserActivity for m_pageActivity
* platform/CountedUserActivity.h: Copied from Source/WebCore/platform/UserActivity.h.
(WebCore::CountedUserActivity::CountedUserActivity):
(WebCore::CountedUserActivity::increment):
(WebCore::CountedUserActivity::decrement):
    - Added, provides counted interface to UserActivity.
* platform/UserActivity.cpp:
(WebCore::UserActivity::UserActivity):
    - m_count removed
(WebCore::UserActivity::start):
(WebCore::UserActivity::stop):
    - beginActivity->start, endActivity->stop, implentation now empty.
* platform/UserActivity.h:
    - beginActivity->start, endActivity->stop, m_count moved to HAVE(NS_ACTIVITY)
* platform/mac/UserActivityMac.mm:
(WebCore::UserActivity::UserActivity):
    - m_count->m_started
(WebCore::UserActivity::isValid):
    - m_count->m_started
(WebCore::UserActivity::start):
(WebCore::UserActivity::stop):
    - beginActivity->start, endActivity->stop, no longer nest

Source/WebKit2:

* PluginProcess/PluginProcess.h:
(WebKit::PluginProcess::connectionActivity):
    - UserActivity->CountedUserActivity
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializeProcess):
    - beginActivity->start
* Shared/ActivityAssertion.cpp:
(WebKit::ActivityAssertion::ActivityAssertion):
(WebKit::ActivityAssertion::~ActivityAssertion):
    - beginActivity->increment, endActivity->decrement.
* Shared/ActivityAssertion.h:
    - UserActivity->CountedUserActivity
* Shared/ChildProcess.cpp:
(WebKit::ChildProcess::setProcessSuppressionEnabled):
    - beginActivity->start, endActivity->stop.
* Shared/ChildProcess.h:
    - removed processSuppressionEnabled()
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
    - beginActivity->start, endActivity->stop.

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

7 years agoUnreviewed trivial Linux buildfix after r164905.
ossy@webkit.org [Sat, 1 Mar 2014 08:35:23 +0000 (08:35 +0000)]
Unreviewed trivial Linux buildfix after r164905.

setShouldCloseConnectionOnMachExceptions() is defined in the Mac only
Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp inside !PLATFORM(IOS)
which means PLATFORM(MAC), because nobody else uses this source file.

But ChildProcessProxy.cpp is used by Linux ports too, so we have to
use the most specific #if guard here, which is PLATFORM(MAC).

* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::didFinishLaunching):

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

7 years agoCaller saved registers can be accidentally discarded when clearing the local stack
benjamin@webkit.org [Sat, 1 Mar 2014 06:13:09 +0000 (06:13 +0000)]
Caller saved registers can be accidentally discarded when clearing the local stack
https://bugs.webkit.org/show_bug.cgi?id=129532

Reviewed by Andreas Kling.

Source/WebCore:

Tests: fast/selectors/tree-modifying-case-insensitive-selectors.html
       fast/selectors/tree-modifying-selectors.html

StackAllocator::discard() no longer make sense now that we can use caller saved regsiter.
We should instead discard everything up to the beginning of the local stack.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
* cssjit/StackAllocator.h:
(WebCore::StackAllocator::popAndDiscardUpTo):

LayoutTests:

* fast/selectors/tree-modifying-case-insensitive-selectors.html: Added.
* fast/selectors/tree-modifying-selectors.html: Added.

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

7 years ago[iOS] Assertions and bad behavior when zooming into an iframe containing apple.com
simon.fraser@apple.com [Sat, 1 Mar 2014 05:36:01 +0000 (05:36 +0000)]
[iOS] Assertions and bad behavior when zooming into an iframe containing apple.com
https://bugs.webkit.org/show_bug.cgi?id=129537

Reviewed by Benjamin Poulain.

When building RemoteLayerTreeTransactions, the ordering of setting created
layers and doing the recursive tree walk was wrong, such that we failed
to noticed layers created during the recursiveBuildTransaction().

Also harden the UI-side code against Obj-C exceptions thrown when layers
are missing.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties): Assert when
children are not found, and protect against Obj-C exceptions.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
Initialize the members.
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::buildTransaction): Do the recursive walk
before setting created and destroyed layers, since the walk can create
layers (especially when swapping into tiled layers).

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

7 years agoFix WebKit2 build after r164890
jinwoo7.song@samsung.com [Sat, 1 Mar 2014 05:34:19 +0000 (05:34 +0000)]
Fix WebKit2 build after r164890
https://bugs.webkit.org/show_bug.cgi?id=129533

Reviewed by Simon Fraser.

LayerRepresentation.h is included to WebPageProxy.h in r164890
but it is not used in non Mac or iOS port.

* UIProcess/WebPageProxy.h:

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

7 years ago[Mac] Remove MailQuirksUserScript.js
mitz@apple.com [Sat, 1 Mar 2014 05:31:34 +0000 (05:31 +0000)]
[Mac] Remove MailQuirksUserScript.js
https://bugs.webkit.org/show_bug.cgi?id=129536

Reviewed by Andy Estes.

../WebKit:

* WebKit.xcodeproj/project.pbxproj: Removed reference to the file.

../WebKit/mac:

* Configurations/WebKit.xcconfig: Removed from EXCLUDED_SOURCE_FILE_NAMES_iphoneos.
* Misc/MailQuirksUserScript.js: Removed. This file has been unused since r147447.

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

7 years ago[iOS] FrameLoader has a NULL m_progressTracker when initialized with initForSynthesiz...
aestes@apple.com [Sat, 1 Mar 2014 05:14:42 +0000 (05:14 +0000)]
[iOS] FrameLoader has a NULL m_progressTracker when initialized with initForSynthesizedDocument()
https://bugs.webkit.org/show_bug.cgi?id=129534

Reviewed by Simon Fraser.

No new tests because TestWebKitAPI does not yet support iOS. See <http://webkit.org/b/129535>.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::initForSynthesizedDocument): Create a FrameProgressTracker.

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

7 years ago[Mac] Extract _data->_thumbnailView checks into a helper function
ap@apple.com [Sat, 1 Mar 2014 05:05:16 +0000 (05:05 +0000)]
[Mac] Extract _data->_thumbnailView checks into a helper function
https://bugs.webkit.org/show_bug.cgi?id=129517

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKView.mm:
(-[WKView shouldIgnoreMouseEvents]):
(-[WKView scrollWheel:]):
(-[WKView mouseMoved:]):
(-[WKView mouseDown:]):
(-[WKView mouseUp:]):
(-[WKView mouseDragged:]):

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

7 years ago[iOS][WebKit2] Don't use any of the mach exception handling code on iOS
psolanki@apple.com [Sat, 1 Mar 2014 04:10:24 +0000 (04:10 +0000)]
[iOS][WebKit2] Don't use any of the mach exception handling code on iOS
https://bugs.webkit.org/show_bug.cgi?id=129516

Reviewed by Sam Weinig.

This code is not used on iOS after my fix in r164883. We can just move it all under
!PLATFORM(IOS).

* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.cpp:
(IPC::Connection::platformInvalidate):
(IPC::Connection::platformInitialize):
(IPC::Connection::open):
* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::didFinishLaunching):

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

7 years agoJSObject::findPropertyHashEntry() should take VM instead of ExecState.
akling@apple.com [Sat, 1 Mar 2014 04:01:06 +0000 (04:01 +0000)]
JSObject::findPropertyHashEntry() should take VM instead of ExecState.
<https://webkit.org/b/129529>

Callers already have VM in a local, and findPropertyHashEntry() only
uses the VM, no need to go all the way through ExecState.

Reviewed by Geoffrey Garen.

* runtime/JSObject.cpp:
(JSC::JSObject::put):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::findPropertyHashEntry):
* runtime/JSObject.h:

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

7 years agoASSERT(isMainThread()) hit under platformUserPreferredLanguages() with WebKit1 and...
weinig@apple.com [Sat, 1 Mar 2014 03:11:49 +0000 (03:11 +0000)]
ASSERT(isMainThread()) hit under platformUserPreferredLanguages() with WebKit1 and WebKit2 in the same process
https://bugs.webkit.org/show_bug.cgi?id=129528

Reviewed by Andreas Kling.

* platform/mac/Language.mm:
(WebCore::preferredLanguagesMutex):
(WebCore::preferredLanguages):
(+[WebLanguageChangeObserver languagePreferencesDidChange:]):
(WebCore::httpStyleLanguageCode):
(WebCore::platformUserPreferredLanguages):
Add a mutex and do an isolated copy of the strings to allow this function to be called from multiple threads.

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

7 years agoDeadlock remotely inspecting iOS Simulator
commit-queue@webkit.org [Sat, 1 Mar 2014 02:51:39 +0000 (02:51 +0000)]
Deadlock remotely inspecting iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=129511

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

Avoid synchronous setup. Do it asynchronously, and let
the RemoteInspector singleton know later if it failed.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::setupFailed):
* inspector/remote/RemoteInspectorDebuggableConnection.h:
* inspector/remote/RemoteInspectorDebuggableConnection.mm:
(Inspector::RemoteInspectorDebuggableConnection::setup):

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

7 years agoCrash at ebay.com when viewing auction items at com.apple.WebCore: WebCore::GraphicsC...
dino@apple.com [Sat, 1 Mar 2014 02:05:14 +0000 (02:05 +0000)]
Crash at ebay.com when viewing auction items at com.apple.WebCore: WebCore::GraphicsContext3D::getExtensions + 10
https://bugs.webkit.org/show_bug.cgi?id=129523

Reviewed by Simon Fraser.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getSupportedExtensions): Early return if the
context is pending policy resolution.

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

7 years agoMicro-optimize JSNodeOwner::isReachableFromOpaqueRoots().
akling@apple.com [Sat, 1 Mar 2014 01:11:23 +0000 (01:11 +0000)]
Micro-optimize JSNodeOwner::isReachableFromOpaqueRoots().
<https://webkit.org/b/129518>

Only do image and audio element specific checks for element nodes.
Time spent in here goes from 0.8% to 0.5% on DYEB.

Reviewed by Benjamin Poulain.

* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):

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

7 years agoJSC Assertion failure every time I start Safari (r164846)
ggaren@apple.com [Sat, 1 Mar 2014 00:45:21 +0000 (00:45 +0000)]
JSC Assertion failure every time I start Safari (r164846)
https://bugs.webkit.org/show_bug.cgi?id=129510

Reviewed by Mark Hahnenberg.

Take the lock before allocating objects because afterward is too late.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::windowScriptNPObject):
(WebCore::ScriptController::jsObjectForPluginElement):

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

7 years agoWeb Inspector: ASSERT in WebCore::JSDOMWindowBase::supportsRichSourceInfo inspecting iOS
commit-queue@webkit.org [Sat, 1 Mar 2014 00:42:29 +0000 (00:42 +0000)]
Web Inspector: ASSERT in WebCore::JSDOMWindowBase::supportsRichSourceInfo inspecting iOS
https://bugs.webkit.org/show_bug.cgi?id=129512

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-02-28
Reviewed by Simon Fraser.

* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):

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

7 years agoVisitedLinkStore should be able to invalidate link styles for associated pages
andersca@apple.com [Sat, 1 Mar 2014 00:40:22 +0000 (00:40 +0000)]
VisitedLinkStore should be able to invalidate link styles for associated pages
https://bugs.webkit.org/show_bug.cgi?id=129515

Reviewed by Dan Bernstein.

* page/Page.cpp:
(WebCore::Page::Page):
Add the VisitedLinkStore if we have one.

(WebCore::Page::~Page):
Remove the VisitedLinkStore if we have one.

* page/VisitedLinkStore.cpp:
(WebCore::VisitedLinkStore::~VisitedLinkStore):
Assert that we don't have any pages.

(WebCore::VisitedLinkStore::addPage):
Add the page to the set.

(WebCore::VisitedLinkStore::removePage):
Remove the page from the set.

(WebCore::VisitedLinkStore::invalidateStylesForAllLinks):
Traverse all the pages and invalidate the style for all links.

(WebCore::VisitedLinkStore::invalidateStylesForLink):
Traverse all the pages and invalidate the style for a given link.

* page/VisitedLinkStore.h:
Add new members.

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

7 years agoSource/WebCore: [iOS][WK2] highlight rects should never big bigger than the view
benjamin@webkit.org [Fri, 28 Feb 2014 23:55:24 +0000 (23:55 +0000)]
Source/WebCore: [iOS][WK2] highlight rects should never big bigger than the view
https://bugs.webkit.org/show_bug.cgi?id=129472

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-02-28
Reviewed by Enrica Casucci.

* WebCore.exp.in:

Source/WebKit2: [iOS][WK2] highlight rects should never big bigger than the view
https://bugs.webkit.org/show_bug.cgi?id=129472
<rdar://problem/15673655>

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-02-28
Reviewed by Enrica Casucci.

The unobscuredRect on WebPageProxy is the "true" view rect as seen by the user.
Use that to constrain our highlight rects.

* UIProcess/ios/WKContentViewInteraction.mm:
(highlightedQuadsFitInRect):
(-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):

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

7 years agoTurn off margin tiles on iOS
bdakin@apple.com [Fri, 28 Feb 2014 23:38:08 +0000 (23:38 +0000)]
Turn off margin tiles on iOS
https://bugs.webkit.org/show_bug.cgi?id=129509
-and corresponding-
<rdar://problem/16200383>

Reviewed by Simon Fraser.

* page/FrameView.cpp:
(WebCore::FrameView::needsExtendedBackgroundRectForPainting):

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

7 years agoMake UIViews for compositing layers in the UI process on iOS
simon.fraser@apple.com [Fri, 28 Feb 2014 23:36:02 +0000 (23:36 +0000)]
Make UIViews for compositing layers in the UI process on iOS
https://bugs.webkit.org/show_bug.cgi?id=129508

Reviewed by Sam Weinig.

In order to parent UIScrollViews for -webkit-overflow-scrolling:touch,
we need to use UIViews in the compositing layer hierarchy on iOS.

Make much of the code that currently uses CALayers layer-or-view
agnostic by using a typedef LayerOrView.

Fix RemoteLayerTreePropertyApplier to apply properties to UIViews
or CALayers; on iOS, we need both paths because we have to set properties
on CALayer for remotely hosted content.

Add iOS-specific implementation files for RemoteLayerTreeHost and RemoteScrollingCoordinatorProxy,
since these need to see the UIView implementation. WebVideoFullscreenManagerProxy.cpp also needs
to be come a .mm file.

* Shared/mac/RemoteLayerTreePropertyApplier.h:
* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(-[UIView setSubviews:]):
(WebKit::applyPropertiesToLayer):
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
* UIProcess/Cocoa/LayerRepresentation.h: Copied from Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h.
(asLayer):
* UIProcess/PageClient.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/LayerRepresentation.mm: Copied from Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h.
(asLayer):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setAcceleratedCompositingRootLayer):
(WebKit::PageClientImpl::acceleratedCompositingRootLayer):
* UIProcess/ios/RemoteLayerTreeHostIOS.mm: Added.
(+[WKTransformView layerClass]):
(-[WKRemoteView initWithFrame:contextID:]):
(+[WKRemoteView layerClass]):
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: Added.
(WebKit::layerRepresentationFromLayerOrView):
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _setAcceleratedCompositingRootView:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.cpp.
(WebKit::WebVideoFullscreenManagerProxy::create):
(WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy):
(WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy):
(WebKit::WebVideoFullscreenManagerProxy::didCommitLayerTree):
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerID):
(WebKit::WebVideoFullscreenManagerProxy::enterFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::requestExitFullScreen):
(WebKit::WebVideoFullscreenManagerProxy::play):
(WebKit::WebVideoFullscreenManagerProxy::pause):
(WebKit::WebVideoFullscreenManagerProxy::togglePlayState):
(WebKit::WebVideoFullscreenManagerProxy::seekToTime):
(WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
* UIProcess/mac/RemoteLayerTreeHost.h:
(WebKit::RemoteLayerTreeHost::rootLayer):
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::getLayer):
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
(WebKit::WebPageProxy::acceleratedCompositingRootLayer):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::recursiveBuildTransaction):

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

7 years agoWebKit2.TerminateTwice test is failing.
andersca@apple.com [Fri, 28 Feb 2014 23:11:22 +0000 (23:11 +0000)]
WebKit2.TerminateTwice test is failing.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetStateAfterProcessExited):
Turns out this can be called even when we're in the launching state so don't try to
remove the process from the visited link provider when in that state.

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

7 years agoSubpixel rendering: Add subpixel support to border type of double, groove, ridge...
zalan@apple.com [Fri, 28 Feb 2014 23:05:58 +0000 (23:05 +0000)]
Subpixel rendering: Add subpixel support to border type of double, groove, ridge, inset and outset.
https://bugs.webkit.org/show_bug.cgi?id=129226

Reviewed by Simon Fraser.

This is the conversion of double, inset, outset, groove and ridge border type
painting to support device pixel precision width/height.

Regression is covered by existing tests.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::drawLineForBoxSide):
* rendering/RenderObject.h:

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

7 years agoAX: Crash in WebKit::WebPageProxy::registerWebProcessAccessibilityToken
cfleizach@apple.com [Fri, 28 Feb 2014 23:04:05 +0000 (23:04 +0000)]
AX: Crash in WebKit::WebPageProxy::registerWebProcessAccessibilityToken
https://bugs.webkit.org/show_bug.cgi?id=127387

Reviewed by Alexey Proskuryakov.

Speculative fix for crasher. We should check if the connection is still valid before proceeding.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::registerWebProcessAccessibilityToken):

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

7 years agoFilters should test for area instead of single dimension
cavalcantii@gmail.com [Fri, 28 Feb 2014 22:54:47 +0000 (22:54 +0000)]
Filters should test for area instead of single dimension
https://bugs.webkit.org/show_bug.cgi?id=123716

Reviewed by Dirk Schulze.

A filtered SVG element with a sigle dimension bigger than 5000
(counting the margin/border) will fail to render. So an element
with 4000x4000 will render fine, while another with 5000x10
won't. This patch instead tests against the total element area,
which fixes such cases.

Source/WebCore:

It also fixes some layer violations where FilterEffectRenderer and
RenderSVGResourceFilter were directly accessing the maximum filter
size in FilterEffect. Since before a somewhat bigger filter would
be aborted, it required to change the maximum kernel size
for blur filter (some filters are slower to run than others for
bigger SVGs).

Tests: svg/filters/big-height-filter-expected.svg
       svg/filters/big-height-filter.svg
       svg/filters/big-width-filter-expected.svg
       svg/filters/big-width-filter.svg

* platform/graphics/filters/FEGaussianBlur.cpp:
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::maxFilterArea): New function, returns the
maximum allowed element area (currently is 4096 x 4096).
(WebCore::FilterEffect::isFilterSizeValid): Now it tests for
element area instead of a single dimension. This code is reused by
FilterEffectRenderer.
* platform/graphics/filters/FilterEffect.h:
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::updateBackingStoreRect): Uses the
new function in FilterEffect to test for valid sizes.
(WebCore::FilterEffectRendererHelper::beginFilterEffect): Same case.
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::fitsInMaximumImageSize): Test
for maximum area and properly changes the scale of transformed
element to fit.

LayoutTests:

The current patch fixes the rendering issue and at same time,
fixes some layer violations where FilterEffectRenderer and
RenderSVGResourceFilter were directly accessing the kMax value
in FilterEffect. Since before a somewhat bigger filter would
be aborted, it required to change the maximum kernel size
for blur filter (some filters are slower to run than others for
bigger SVGs).

* svg/filters/big-height-filter-expected.svg: Added.
* svg/filters/big-height-filter.svg: Added.
* svg/filters/big-width-filter-expected.svg: Added.
* svg/filters/big-width-filter.svg: Added.

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

7 years agoEnable breakpoints when adding a new breakpoint or enabling an existing breakpoint.
timothy@apple.com [Fri, 28 Feb 2014 22:54:18 +0000 (22:54 +0000)]
Enable breakpoints when adding a new breakpoint or enabling an existing breakpoint.

This eliminates a multi-step process for the user that can be confusing.

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

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.set breakpointsEnabled):
(WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointsEnabledDidChange):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointsToggleButtonClicked):

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

7 years agoProperly handle when Test.html is not present in Production builds.
timothy@apple.com [Fri, 28 Feb 2014 22:51:45 +0000 (22:51 +0000)]
Properly handle when Test.html is not present in Production builds.

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

Reviewed by Joseph Pecoraro.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController inspectorTestPagePath]):
(-[WebInspectorWindowController webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):

Source/WebKit2:

* UIProcess/WebInspectorProxy.cpp:
(WebKit::isMainOrTestInspectorPage):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectorTestPageURL):

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

7 years ago[iOS][WebKit2] Don't grab mach exception port on iOS
psolanki@apple.com [Fri, 28 Feb 2014 22:10:56 +0000 (22:10 +0000)]
[iOS][WebKit2] Don't grab mach exception port on iOS
https://bugs.webkit.org/show_bug.cgi?id=129505
<rdar://problem/15972749>

Reviewed by Anders Carlsson.

Don't grab the mach exception port on iOS so we get crash logs for web process and network
process.

* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::didFinishLaunching):

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

7 years agoAdd hiDPI support to DumpRenderTree/WebKitTestRunner without the need of reloading...
zalan@apple.com [Fri, 28 Feb 2014 21:43:18 +0000 (21:43 +0000)]
Add hiDPI support to DumpRenderTree/WebKitTestRunner without the need of reloading the test case.
https://bugs.webkit.org/show_bug.cgi?id=129438

Reviewed by Simon Fraser.

'hidpi-' prefixed test cases now trigger 2x scale factor on the testing
offscreen window. It makes testing subpixel rendering and positioning possible.

Both the offscreen window's and WebKit's scaling are set accordingly.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow): cleanup
(destroyWebViewAndOffscreenWindow): cleanup
(dumpRenderTree):
(changeWindowScaleIfNeeded):
(runTest):
* DumpRenderTree/mac/DumpRenderTreeWindow.h:
* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
(-[DumpRenderTreeWindow initWithContentRect:styleMask:backing:defer:]): cleanup
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::changeWindowScaleIfNeeded):
(WTR::TestInvocation::invoke):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::changeWindowScaleIfNeeded):
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::changeWindowScaleIfNeeded):
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::changeWindowScaleIfNeeded):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::changeWindowScaleIfNeeded):

LayoutTests:

* fast/borders/hidpi-simple-hairline-border-painting-expected.html: Added.
* fast/borders/hidpi-simple-hairline-border-painting.html: Added.

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

7 years ago[Mac, iOS] Incorrect ordering of construction arguments for out-of-band text elements
bfulgham@apple.com [Fri, 28 Feb 2014 21:12:54 +0000 (21:12 +0000)]
[Mac, iOS] Incorrect ordering of construction arguments for out-of-band text elements
https://bugs.webkit.org/show_bug.cgi?id=129501
<rdar://problem/16198587>

Reviewed by Eric Carlson.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): Correct order of arguments
to PlatformTextTrack.

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

7 years agoREGRESSION(r164835): It broke 10 JSC stress test on 32 bit platforms
oliver@apple.com [Fri, 28 Feb 2014 21:03:41 +0000 (21:03 +0000)]
REGRESSION(r164835): It broke 10 JSC stress test on 32 bit platforms
https://bugs.webkit.org/show_bug.cgi?id=129488

Reviewed by Mark Lam.

Whoops, modify the right register.

* jit/JITCall32_64.cpp:
(JSC::JIT::compileLoadVarargs):

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

7 years agoUnreviewed build fix after r164832.
bfulgham@apple.com [Fri, 28 Feb 2014 21:00:12 +0000 (21:00 +0000)]
Unreviewed build fix after r164832.

* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::updateProcessState): Switch from removed
'isValid' to 'state() != State::Running'

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

7 years agoFTL should be able to call sin/cos directly on platforms where the intrinsic is busted
fpizlo@apple.com [Fri, 28 Feb 2014 20:40:55 +0000 (20:40 +0000)]
FTL should be able to call sin/cos directly on platforms where the intrinsic is busted
https://bugs.webkit.org/show_bug.cgi?id=129503

Reviewed by Mark Lam.

* ftl/FTLIntrinsicRepository.h:
* ftl/FTLOutput.h:
(JSC::FTL::Output::doubleSin):
(JSC::FTL::Output::doubleCos):
(JSC::FTL::Output::intrinsicOrOperation):

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

7 years agoSource/WebKit2: VisitedLinkProvider should keep track of processes, not pages
andersca@apple.com [Fri, 28 Feb 2014 19:32:11 +0000 (19:32 +0000)]
Source/WebKit2: VisitedLinkProvider should keep track of processes, not pages
https://bugs.webkit.org/show_bug.cgi?id=129497

Reviewed by Dan Bernstein.

Use a counted set of WebProcessProxy pointers instead of a set of pages.

* UIProcess/VisitedLinkProvider.cpp:
(WebKit::VisitedLinkProvider::~VisitedLinkProvider):
Assert that m_processes is null.

(WebKit::VisitedLinkProvider::addProcess):
Add the process to the set.

(WebKit::VisitedLinkProvider::removeProcess):
Remove the process from the set.

* UIProcess/VisitedLinkProvider.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
If our process is currently running, add it to the visited link provider.
Otherwise it will be added in connectionWillOpen.

(WebKit::WebPageProxy::close):
If our process is running, remove it from the visited link provider.
Otherwise it's either crashed or not yet launched and will not have been added.

(WebKit::WebPageProxy::connectionWillOpen):
Add the process to the visited link provider.

(WebKit::WebPageProxy::resetStateAfterProcessExited):
Remove the process from the visited link provider.

Tools: Remove logging.

Reviewed by Dan Bernstein.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController browsingContextController:decidePolicyForNavigationAction:decisionHandler:]):

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

7 years agoProperly clear m_logicallyLastRun to remove use-after-free possibility
bjonesbe@adobe.com [Fri, 28 Feb 2014 19:19:03 +0000 (19:19 +0000)]
Properly clear m_logicallyLastRun to remove use-after-free possibility
https://bugs.webkit.org/show_bug.cgi?id=129489

Reviewed by David Hyatt.

A use-after-free issue was caught in Blink because m_logicallyLastRun
is not cleared when the item it points to is deleted. Clearing it
turns the use-after-free into a segfault, and prevents any future
use-after-frees from happening.

* platform/text/BidiRunList.h:
(WebCore::BidiRunList<Run>::deleteRuns):

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

7 years ago[Mac] Disambiguate calls to [[window contentView] layer] and [... setLayer:]
jer.noble@apple.com [Fri, 28 Feb 2014 18:59:00 +0000 (18:59 +0000)]
[Mac] Disambiguate calls to [[window contentView] layer] and [... setLayer:]
https://bugs.webkit.org/show_bug.cgi?id=129491

Reviewed by Alexey Proskuryakov.

-[NSWindow contentView] returns a bare id, leading to ambiguity when calling
certain methods, including -layer and -setLayer:. Resolve the ambiguity by
explicitly casting the -contentView call to a NSView*.

* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController setupVideoOverlay:]):
(-[WebVideoFullscreenController windowDidLoad]):
(-[WebVideoFullscreenController windowDidExitFullscreen]):

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

7 years agoparagraphs with different directionality in textarea with unicode-bidi: plaintext...
ap@apple.com [Fri, 28 Feb 2014 18:58:07 +0000 (18:58 +0000)]
paragraphs with different directionality in textarea with unicode-bidi: plaintext are aligned the same
https://bugs.webkit.org/show_bug.cgi?id=71194

* platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:
Updated Mac results for Mavericks (the original patch only updated Mountain Lion results).

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

7 years agoMouseEvent.offsetX/Y should just return 0,0 for simulated clicks.
akling@apple.com [Fri, 28 Feb 2014 18:44:10 +0000 (18:44 +0000)]
MouseEvent.offsetX/Y should just return 0,0 for simulated clicks.
<https://webkit.org/b/129477>

Source/WebCore:

There's no need to compute the exact target-relative coordinates for
simulated mouse events, e.g those fired by HTMLElement.click().

The offsetX/Y properties are not supported by Firefox.

Test: fast/events/relative-offset-of-simulated-click.html

Reviewed by Alexey Proskuryakov.

* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::offsetX):
(WebCore::MouseRelatedEvent::offsetY):

LayoutTests:

Add a test documenting the behavior of offsetX/Y on the simulated
mouse events that get sent by HTMLElement.click().

Reviewed by Alexey Proskuryakov.

* fast/events/relative-offset-of-simulated-click-expected.txt: Added.
* fast/events/relative-offset-of-simulated-click.html: Added.

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

7 years ago[CSS Grid Layout] Fix positioning grid items using named grid lines/areas
svillar@igalia.com [Fri, 28 Feb 2014 18:34:48 +0000 (18:34 +0000)]
[CSS Grid Layout] Fix positioning grid items using named grid lines/areas
https://bugs.webkit.org/show_bug.cgi?id=129372

Reviewed by Darin Adler.

Source/WebCore:

Our code was assuming that a <custom-ident> in
-webkit-grid-{column|row}-{start|end} and
-webkit-grid-{column|row} was always a grid area name. That's
wrong because the <custom-ident> could be also a explicitly named
grid line or the an implicitly named grid line created by a grid
area definition.

The style resolution code was not correct either. This patch fixes
it so it now matches the spec, which means that:
- first we try to match any existing grid area.
- then if there is a named grid line with the name
<custom-ident>-{start|end} for -webkit-grid-{column|row}-{start|end}
defined before the grid area then we use it instead of the grid
area.
- otherwise if there is a named grid line we resolve to the first such line.
- otherwise we treat it as 'auto'.

Fixing this uncovered a bug in GridPosition, we were not using the
name of the stored grid area to check if two GridPositions were
the same.

Tests: fast/css-grid-layout/grid-item-position-changed-dynamic.html
       fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html

* css/StyleResolver.cpp:
(WebCore::gridLineDefinedBeforeGridArea): New function to check if
a given named grid line was defined before an implicit named grid
line created by a grid area definition.
(WebCore::StyleResolver::adjustNamedGridItemPosition): New
function that adjusts the position of a GridPosition parsed as a
grid area.
(WebCore::StyleResolver::adjustGridItemPosition): Use the new
function adjustNamedGridItemPosition to adjust the positions of
named grid lines.
* css/StyleResolver.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::resolveNamedGridLinePositionFromStyle): Use GridPosition:: namespace.
(WebCore::RenderGrid::resolveGridPositionFromStyle): Ditto.
(WebCore::RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): Ditto.
* rendering/RenderGrid.h:
* rendering/style/GridPosition.h:
(WebCore::GridPosition::adjustGridPositionForRowEndColumnEndSide): Moved from RenderGrid.cpp.
(WebCore::GridPosition::adjustGridPositionForSide): Ditto.
(WebCore::GridPosition::operator==): Use the named grid line to check equality.

LayoutTests:

Added a new test that checks that we correctly position grid items
using named grid lines, grid areas and also with the implicit
named grid lines created by grid areas.

I'm also importing a test from Blink that checks that we can
dynamically change the position of a grid item by changing the
name of the grid lines used to position it.

* fast/css-grid-layout/grid-item-position-changed-dynamic-expected.txt:
Merged from Blink r153913 by <jchaffraix@chromium.org>.
* fast/css-grid-layout/grid-item-position-changed-dynamic.html: Ditto.
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution-expected.txt: Added.
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html: Added.

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

7 years ago[CSS Shapes] Update line segments for ShapeInside only if the new line is wide enough
zoltan@webkit.org [Fri, 28 Feb 2014 18:14:41 +0000 (18:14 +0000)]
[CSS Shapes] Update line segments for ShapeInside only if the new line is wide enough
https://bugs.webkit.org/show_bug.cgi?id=129461

Reviewed by David Hyatt.

Shape-inside can make a line only narrower than the original line width, thus we don't need
to update the line/shape segments in fitBelowFloats for every single line inside shape-inside.
This patch adds a helper function, which updates the line segments, furthermore it updates the
line segments only when the content would fit without the shape.

No new tests, no behavior change.

* rendering/line/BreakingContextInlineHeaders.h: Use new helper.
(WebCore::updateSegmentsForShapes):
* rendering/line/LineWidth.cpp: Use new helper.
(WebCore::LineWidth::updateLineSegment): Add new helper.
(WebCore::LineWidth::fitBelowFloats):

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

7 years agoparagraphs with different directionality in textarea with unicode-bidi: plaintext...
mario.prada@samsung.com [Fri, 28 Feb 2014 18:12:52 +0000 (18:12 +0000)]
paragraphs with different directionality in textarea with unicode-bidi: plaintext are aligned the same
https://bugs.webkit.org/show_bug.cgi?id=71194

Reviewed by David Hyatt.

Merged from Blink r157263 by <igor.o@sisa.samsung.com>
<https://src.chromium.org/viewvc/blink?revision=157263&view=revision>

Source/WebCore:

In the css3-text spec (http://www.w3.org/TR/css3-text/#bidi-linebox):

The start and end edges of a line box are determined by the inline
base direction of the line box. In most cases, this is given by
its containing block's computed ‘direction’. However if its
containing block has ‘unicode-bidi: plaintext’, the inline base
direction the line box must be determined by the base direction of
the bidi paragraph to which it belongs: that is, the bidi
paragraph for which the line box holds content.

This patch just implements the behavior described above modifying
updateLogicalWidthForAlignment and setting the bidi level of the
RootInlineBox.

* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
(WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
(WebCore::RenderBlockFlow::checkLinesForTextOverflow):
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):

LayoutTests:

Modified expectations for two layout tests to make them conforming to the spec.

* fast/text/international/unicode-bidi-plaintext-expected.html:
* platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:
* platform/mac-mountainlion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:

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

7 years agoUpdate meta-referrer behavior for invalid policies
jochen@chromium.org [Fri, 28 Feb 2014 18:09:24 +0000 (18:09 +0000)]
Update meta-referrer behavior for invalid policies
https://bugs.webkit.org/show_bug.cgi?id=129475

Source/WebCore:

This patch aligns the behavior with the CSP 1.1 referrer directive,
where the fallback for an invalid value is the "never" policy.

Original patch from Mike West: https://src.chromium.org/viewvc/blink?view=rev&revision=165627

Reviewed by Alexey Proskuryakov.

Test: http/tests/security/referrer-policy-invalid.html

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

LayoutTests:

Reviewed by Alexey Proskuryakov.

* http/tests/security/referrer-policy-invalid-expected.txt: Added.
* http/tests/security/referrer-policy-invalid.html: Added.

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

7 years ago[iOS] DumpRenderTree Perl Support may build against wrong SDK and toolchain
dbates@webkit.org [Fri, 28 Feb 2014 17:53:30 +0000 (17:53 +0000)]
[iOS] DumpRenderTree Perl Support may build against wrong SDK and toolchain
https://bugs.webkit.org/show_bug.cgi?id=129163

Reviewed by David Kilzer.

Fixes an issue where DumpRenderTree Perl Support may build with the specified
iOS Simulator SDK and toolchain instead of using the OS X SDK and toolchain.
This issue manifests itself in a build failure when building the IPhoneSimulatorNotification
bundle.

Currently we build DumpRenderTree Perl Support with respect to the variable SDKROOT,
which is specified either explicitly when building with MAKE(1) or implicitly by
build-{dumprendertree, webkit}. Instead we should always build Perl Support using
the OS X SDK and toolchain since the built products are only applicable to OS X.

* DumpRenderTree/ios/PerlSupport/Makefile:

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

7 years agoFix !ENABLE(GGC) builds
mhahnenberg@apple.com [Fri, 28 Feb 2014 17:46:12 +0000 (17:46 +0000)]
Fix !ENABLE(GGC) builds

* heap/Heap.cpp:
(JSC::Heap::markRoots):
(JSC::Heap::gatherJSStackRoots): Also fix one of the names of the GC phases.

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

7 years agoSubresourceLoader::didFinishLoading() should not assert when a decode error occurs
dbates@webkit.org [Fri, 28 Feb 2014 17:30:36 +0000 (17:30 +0000)]
SubresourceLoader::didFinishLoading() should not assert when a decode error occurs
https://bugs.webkit.org/show_bug.cgi?id=127029

Reviewed by Darin Adler.

Source/WebCore:

SubresourceLoader::didFinishLoading() can be called for a resource (e.g. an image) that
failed to be decoded or, in the case of an image, whose estimated decoded size exceeds
the maximum decoded size (Settings::maximumDecodedImageSize()).

Test: fast/images/decoded-size-exceeds-max-decoded-size.html

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):

LayoutTests:

Added a test to ensure that we don't cause an assertion failure when an image fails
to load because of a decode error. In particular, the estimated decoded image size
exceeds the maximum decoded image size.

* fast/images/decoded-size-exceeds-max-decoded-size-expected.txt: Added.
* fast/images/decoded-size-exceeds-max-decoded-size.html: Added.

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

7 years agoClean up Heap::collect and Heap::markRoots
mhahnenberg@apple.com [Fri, 28 Feb 2014 16:56:17 +0000 (16:56 +0000)]
Clean up Heap::collect and Heap::markRoots
https://bugs.webkit.org/show_bug.cgi?id=129464

Reviewed by Geoffrey Garen.

These functions have built up a lot of cruft recently.
We should do a bit of cleanup to make them easier to grok.

* heap/Heap.cpp:
(JSC::Heap::finalizeUnconditionalFinalizers):
(JSC::Heap::gatherStackRoots):
(JSC::Heap::gatherJSStackRoots):
(JSC::Heap::gatherScratchBufferRoots):
(JSC::Heap::clearLivenessData):
(JSC::Heap::visitSmallStrings):
(JSC::Heap::visitConservativeRoots):
(JSC::Heap::visitCompilerWorklists):
(JSC::Heap::markProtectedObjects):
(JSC::Heap::markTempSortVectors):
(JSC::Heap::markArgumentBuffers):
(JSC::Heap::visitException):
(JSC::Heap::visitStrongHandles):
(JSC::Heap::visitHandleStack):
(JSC::Heap::traceCodeBlocksAndJITStubRoutines):
(JSC::Heap::converge):
(JSC::Heap::visitWeakHandles):
(JSC::Heap::clearRememberedSet):
(JSC::Heap::updateObjectCounts):
(JSC::Heap::resetVisitors):
(JSC::Heap::markRoots):
(JSC::Heap::copyBackingStores):
(JSC::Heap::deleteUnmarkedCompiledCode):
(JSC::Heap::collect):
(JSC::Heap::collectIfNecessaryOrDefer):
(JSC::Heap::suspendCompilerThreads):
(JSC::Heap::willStartCollection):
(JSC::Heap::deleteOldCode):
(JSC::Heap::flushOldStructureIDTables):
(JSC::Heap::flushWriteBarrierBuffer):
(JSC::Heap::stopAllocation):
(JSC::Heap::reapWeakHandles):
(JSC::Heap::sweepArrayBuffers):
(JSC::Heap::snapshotMarkedSpace):
(JSC::Heap::deleteSourceProviderCaches):
(JSC::Heap::notifyIncrementalSweeper):
(JSC::Heap::rememberCurrentlyExecutingCodeBlocks):
(JSC::Heap::resetAllocators):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::didFinishCollection):
(JSC::Heap::resumeCompilerThreads):
* heap/Heap.h:

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

7 years agoASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result...
commit-queue@webkit.org [Fri, 28 Feb 2014 16:35:27 +0000 (16:35 +0000)]
ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result) in WebCore::RenderGeometryMap::mapToContainer
https://bugs.webkit.org/show_bug.cgi?id=119626

Source/WebCore:

SVGRenderSupport::mapLocalToContainer() was trying to apply transforms
in the incorrect order. Specifically, it would attempt to apply its
localToParentTransform before its localToBorderBoxTransform. This
was causing an ASSERT to fail when the computed transforms didn't
match up to those computed by RenderGeometryMap.

Blink: https://codereview.chromium.org/143363004
Patch by Martin Hodovan <mhodovan@inf.u-szeged.hu> on 2014-02-28
Reviewed by Simon Fraser.

Test: svg/transforms/svg-geometry-crash.html

* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::mapLocalToContainer):

LayoutTests:

Blink: https://codereview.chromium.org/143363004
Patch by Martin Hodovan <mhodovan@inf.u-szeged.hu> on 2014-02-28
Reviewed by Simon Fraser.

* svg/transforms/svg-geometry-crash-expected.txt: Added.
* svg/transforms/svg-geometry-crash.html: Added.

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

7 years agoUnreviewed, rolling out r164859.
commit-queue@webkit.org [Fri, 28 Feb 2014 15:52:17 +0000 (15:52 +0000)]
Unreviewed, rolling out r164859.
http://trac.webkit.org/changeset/164859
https://bugs.webkit.org/show_bug.cgi?id=129483

caused WK1 crashes (DumpRenderTree) (Requested by zalan on
#webkit).

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
(dumpRenderTree):
(runTest):
* DumpRenderTree/mac/DumpRenderTreeWindow.h:
* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
(-[DumpRenderTreeWindow initWithContentRect:styleMask:backing:defer:]):
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(-[WebKitTestRunnerWindow frameRespectingFakeOrigin]):

LayoutTests:

* fast/borders/hidpi-simple-hairline-border-painting-expected.html: Removed.
* fast/borders/hidpi-simple-hairline-border-painting.html: Removed.

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

7 years agoAdd hiDPI support to DumpRenderTree/WebKitTestRunner without the need of reloading...
zalan@apple.com [Fri, 28 Feb 2014 15:24:18 +0000 (15:24 +0000)]
Add hiDPI support to DumpRenderTree/WebKitTestRunner without the need of reloading the test case.
https://bugs.webkit.org/show_bug.cgi?id=129438

Reviewed by Simon Fraser.

'hidpi-' prefixed test cases now trigger 2x scale factor on the testing
offscreen window. It makes testing subpixel rendering and positioning possible.

Both the offscreen window's and WebKit's scaling are set accordingly.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow): unrelated cleanup.
(destroyWebViewAndOffscreenWindow): unrelated cleanup.
(dumpRenderTree):
(changeOffscreenWindowScaleIfNeeded):
(runTest):
* DumpRenderTree/mac/DumpRenderTreeWindow.h:
* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
(-[DumpRenderTreeWindow initWithContentRect:styleMask:backing:defer:]): cleanup.
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::changeOffscreenWindowScaleIfNeeded):
(WTR::TestInvocation::invoke):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::changeOffscreenWindowScaleIfNeeded):

LayoutTests:

* fast/borders/hidpi-simple-hairline-border-painting-expected.html: Added.
* fast/borders/hidpi-simple-hairline-border-painting.html: Added.

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

7 years ago[CSSRegions] ASSERTION FAILED: !m_regionsInvalidated in RenderFlowThread::regionAtBlo...
mihnea@adobe.com [Fri, 28 Feb 2014 14:34:08 +0000 (14:34 +0000)]
[CSSRegions] ASSERTION FAILED: !m_regionsInvalidated in RenderFlowThread::regionAtBlockOffset
https://bugs.webkit.org/show_bug.cgi?id=129371

Source/WebCore:

Reviewed by Andrei Bucur.

regionAtBlockOffset method is meant to be used after the flow thread validated
its region chain, otherwise we cannot rely on regionAtBlockOffset to determine correctly
the target region based on the offset in flow thread coordinates.

When the video element is collected in a named flow and displayed in a region, we ensure
that the region's decorations are taken into account to properly position the video.
However, we have to do that only if the named flow regions are validated.

I changed the method cachedRegionForCompositedLayer to check only the "cached" region
for a layer and not update the layer to region mappings before returning the region.
Because method cachedRegionForCompositedLayer does not update the region - layer mappings,
the code does not call regionAtBlockOffset in situations where the region chain is not validated yet.

Test: compositing/regions/video-in-overflow-region.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::getLayerListForRegion): Make it a getter that relies on
cached information and refrain from updating the mappings. Make it const too.
(WebCore::RenderFlowThread::cachedRegionForCompositedLayer):
* rendering/RenderFlowThread.h:

LayoutTests:

Reviewed Andrei Bucur.

* compositing/regions/video-in-overflow-region-expected.txt: Added.
* compositing/regions/video-in-overflow-region.html: Added.

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

7 years ago[GTK] Finetune captions menu as per design team
calvaris@igalia.com [Fri, 28 Feb 2014 10:06:29 +0000 (10:06 +0000)]
[GTK] Finetune captions menu as per design team
https://bugs.webkit.org/show_bug.cgi?id=129432

Reviewed by Eric Carlson.

Some design fine tuning of the captions dialog was required.

No new tests, current suffice.

* Modules/mediacontrols/mediaControlsApple.js:
Added out class.
* Modules/mediacontrols/mediaControlsGtk.js:
(ControllerGtk.prototype.buildCaptionMenu): Setting out class when
menu is going to show overlap the panel right border.
* css/mediaControlsGtk.css:
(video::-webkit-media-controls-closed-captions-container.out):
Setting all borders to 5px;
(video::-webkit-media-controls-closed-captions-container h3):
Reduced font size and increasing top padding.
(video::-webkit-media-controls-closed-captions-container ul):
Increased top padding.

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

7 years agoElement::attributeChanged shouldn't do any work when attribute value didn't change
rniwa@webkit.org [Fri, 28 Feb 2014 07:50:20 +0000 (07:50 +0000)]
Element::attributeChanged shouldn't do any work when attribute value didn't change
https://bugs.webkit.org/show_bug.cgi?id=129467

Reviewed by Geoffrey Garen.

Exit early in childrenChanged when the attribute value didn't change.

* dom/Attr.cpp:
(WebCore::Attr::setValue):
(WebCore::Attr::childrenChanged):
* dom/Element.cpp:
(WebCore::Element::setAttributeInternal):
(WebCore::Element::attributeChanged):
(WebCore::Element::parserSetAttributes):
(WebCore::Element::removeAttributeInternal):
(WebCore::Element::didAddAttribute):
(WebCore::Element::didModifyAttribute):
(WebCore::Element::didRemoveAttribute):
(WebCore::Element::cloneAttributesFromElement):
* dom/Element.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
* dom/StyledElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::attributeChanged):
* mathml/MathMLElement.h:
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::attributeChanged):
* mathml/MathMLSelectElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::attributeChanged):
* svg/SVGElement.h:

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

7 years ago[EFL] Remove duplicated keyboard string key from keyMap
jinwoo7.song@samsung.com [Fri, 28 Feb 2014 06:32:18 +0000 (06:32 +0000)]
[EFL] Remove duplicated keyboard string key from keyMap
https://bugs.webkit.org/show_bug.cgi?id=129469

Reviewed by Gyuyoung Kim.

"Down" key is duplicated in keyMap().

* platform/efl/EflKeyboardUtilities.cpp:
(WebCore::createKeyMap):

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

7 years agoUnify the three call sites of SelectorQueryCache
benjamin@webkit.org [Fri, 28 Feb 2014 05:54:09 +0000 (05:54 +0000)]
Unify the three call sites of SelectorQueryCache
https://bugs.webkit.org/show_bug.cgi?id=129249

Reviewed by Andreas Kling.

The three call sites of SelectorQueryCache were doing the exact same thing.
That code is mvoed to a new function Document::selectorQueryForString().

Also use String instead of AtomicString for querySelector() and querySelectorAll().
This prevent the call sites from creating AtomicString just for the time of the call.
This causes a tiny slow down on microbenchmarks that continuously query the same string
but has no negative impact on realistic/good test cases (and the bindings are simplified).

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::querySelector):
(WebCore::ContainerNode::querySelectorAll):
* dom/ContainerNode.h:
* dom/Document.cpp:
(WebCore::Document::selectorQueryForString):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::webkitMatchesSelector):
* dom/SelectorQuery.cpp:
(WebCore::SelectorQueryCache::add):
* dom/SelectorQuery.h:

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

7 years agoJSC ignores the extra memory cost of HTMLCollection after a major GC
rniwa@webkit.org [Fri, 28 Feb 2014 05:53:29 +0000 (05:53 +0000)]
JSC ignores the extra memory cost of HTMLCollection after a major GC
https://bugs.webkit.org/show_bug.cgi?id=129450

Reviewed by Andreas Kling.

Report the extra memory cost of HTMLCollection to JSC.

Unfortunately, the existing mechanism to report the extra memory cost in toJS is insufficient for
HTMLCollection since collection caches are populated later when HTMLCollection is accessed. Also,
the extra memory cost reported by Heap::reportExtraMemoryCost will be thrown away after a major GC.

To work around this limitation, added a visitor.reportExtraMemoryUsage call inside visitChildren
for interfaces with a newly added ReportExtraMemoryCost IDL extension flag to report the extra cost.

Since we may need to generate visitChildren when this flag is set, we can't automatically detect
and generate calls using C++ template as done in r148648.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/webaudio/AudioBuffer.idl:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMBinding.h:
* bindings/scripts/CodeGeneratorJS.pm:
(InstanceNeedsVisitChildren):
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::toJS):
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::toJS):
* dom/ChildNodeList.h:
* dom/CollectionIndexCache.cpp: Added.
(WebCore::reportExtraMemoryCostForCollectionIndexCache):
* dom/CollectionIndexCache.h:
(WebCore::CollectionIndexCache::memoryCost):
(WebCore::NodeType>::CollectionIndexCache):
(WebCore::NodeType>::nodeCount):
(WebCore::NodeType>::computeNodeCountUpdatingListCache):
(WebCore::NodeType>::nodeAt):
(WebCore::NodeType>::invalidate):
* dom/DOMAllInOne.cpp:
* dom/LiveNodeList.cpp:
(WebCore::LiveNodeList::memoryCost):
* dom/LiveNodeList.h:
* dom/NodeList.h:
(WebCore::NodeList::memoryCost):
* dom/NodeList.idl:
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::updateNamedElementCache):
* html/HTMLCollection.h:
(WebCore::CollectionNamedElementCache::didPopulate):
(WebCore::CollectionNamedElementCache::memoryCost):
(WebCore::CollectionNamedElementCache::find):
(WebCore::HTMLCollection::memoryCost):
* html/HTMLCollection.idl:
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::updateNamedElementCache):

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

7 years agoCompile attribute value matching
benjamin@webkit.org [Fri, 28 Feb 2014 05:52:33 +0000 (05:52 +0000)]
Compile attribute value matching
https://bugs.webkit.org/show_bug.cgi?id=129228

Reviewed by Geoffrey Garen.

Source/WebCore:

Add support for compiling value matching when matching attributes in Selector.
This patch only adds exact matching, the other cases will follow.

There is a little infrastructure changes since FunctionCall now needs to support
calls taking 2 arguments. The fun begins when the arguments are not in the right
registers and need to be moved to the right place. Otherwise the code is straightforward.

In SelectorCompiler, it is necessary to handle two different cases of matching: case sensitive
and case insensitive. The choice is done in part at compilation time by asking HTMLDocument
if the name filter can include case insensitive attribute. The other part is done at runtime
by querying the element for its type and document.

Test: fast/selectors/case-insensitive-value-matching.html

* css/SelectorChecker.cpp:
(WebCore::attributeValueMatches): Null values matching should never happen, when an attribute
has no value, its value is empty.

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::FunctionCall):
Add support for calls with two arguments.
(WebCore::FunctionCall::setOneArgument):
(WebCore::FunctionCall::setTwoArguments):
(WebCore::FunctionCall::swapArguments):
Here we need to swap two registers, but we cannot allocate a new register (because the context
of the function call may have taken all the available registers already).

On x86, the solution is simple, we can swap the two registers without side effects.

On other platforms, it is a little more complex. If there is any available register, we can just
use it as a temporary to make the swap.
If there are no available registers, we know that all the registers are taken. Since swapArguments()
was called after pushing all the arguments on the stack, we can safely trash the value of any of those.
We take the first available register that is not a function argument and use it as a temporary.

(WebCore::FunctionCall::prepareAndCall):
This is the fun part, we have two registers where the values must go before the function call. The values
can be in any combination of the allocated registers. The code here needs to move the two values to
their target register while avoiding conflicts.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::AttributeMatchingInfo::AttributeMatchingInfo):
(WebCore::SelectorCompiler::AttributeMatchingInfo::canDefaultToCaseSensitiveValueMatch):
(WebCore::SelectorCompiler::AttributeMatchingInfo::selector):
The value of HTMLDocument::isCaseSensitiveAttribute is needed at compilation time to compute the number
of required registers. As a result, we need to keep it along in the selector fragment.

(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
(WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
(WebCore::SelectorCompiler::attributeValueTestingRequiresExtraRegister):
(WebCore::SelectorCompiler::minimumRegisterRequirements):
(WebCore::SelectorCompiler::SelectorCodeGenerator::markParentElementIfResolvingStyle):
(WebCore::SelectorCompiler::canMatchStyleAttribute):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSynchronizeStyleAttribute):
(WebCore::SelectorCompiler::canMatchAnimatableSVGAttribute):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSynchronizeAllAnimatedSVGAttribute):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
The matching code is moved in a local scope. This is done to recover the register of qualifiedNameImpl
before doing any value matching. That register can then be used to store the expected value when matching
an attribute value.
It is unfortunate there is so much register pressure in this part.

Value matching is done outside the loop. The idea is to keep the loop really small since in the vast majority
of cases, name matching fails.
If the value matching fails, we jump back into the tight loop.

This is not ideal in all situation. For example trivial name matching with trivial value matching should
be done in loop. There is a FIXME to improve those cases later.

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
(WebCore::SelectorCompiler::testIsHTMLClassOnDocument):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
In the case sensitive branch, things are really simple. We have to AtomicStringImpl pointers, if they
don't match, it is a failure.

The case sensitive branch start by comparing the pointers in case the values are equal. This is a common
case and it simplifies the cases for SVG, XHTML, etc.
If the two values are not equal, we must first find if the context requires case insensitive comparison
(HTMLElement in HTMLDocument). If the conditions require case insensitive matching, we then fall back
to a function call.

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
* dom/Attribute.h:
(WebCore::Attribute::valueMemoryOffset):
* dom/Document.h:
(WebCore::Document::documentClassesMemoryOffset):
(WebCore::Document::isHTMLDocumentClassFlag):
* dom/Node.h:
(WebCore::Node::treeScopeMemoryOffset):
* dom/TreeScope.h:
(WebCore::TreeScope::documentScopeMemoryOffset):

LayoutTests:

* fast/selectors/case-insensitive-value-matching-expected.txt: Added.
* fast/selectors/case-insensitive-value-matching.html: Added.
Test the various cases that require more register than the common case.

The values match Firefox behavior.

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

7 years agoindexOf and lastIndexOf shouldn't resolve ropes when needle is longer than haystack
rniwa@webkit.org [Fri, 28 Feb 2014 05:30:09 +0000 (05:30 +0000)]
indexOf and lastIndexOf shouldn't resolve ropes when needle is longer than haystack
https://bugs.webkit.org/show_bug.cgi?id=129466

Reviewed by Michael Saboff.

Refactored the code to avoid calling JSString::value when needle is longer than haystack.

* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncIndexOf):
(JSC::stringProtoFuncLastIndexOf):

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

7 years agocss3/compositing/isolation-isolate-blended-child.html fails
ap@apple.com [Fri, 28 Feb 2014 05:11:55 +0000 (05:11 +0000)]
css3/compositing/isolation-isolate-blended-child.html fails
https://bugs.webkit.org/show_bug.cgi?id=129468

* platform/mac-wk2/TestExpectations: Marked as failing on OS X 10.8 Debug WK2.
Not sure if it's hardware related or dependent on confuguration in some other way.

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

7 years agoBuild break when disabled CSS_GRID_LAYOUT
ryuan.choi@samsung.com [Fri, 28 Feb 2014 03:31:09 +0000 (03:31 +0000)]
Build break when disabled CSS_GRID_LAYOUT
https://bugs.webkit.org/show_bug.cgi?id=129459

Reviewed by Gyuyoung Kim.

* css/CSSValue.h: Added guards of CSS_GRID_LAYOUT for GridTemplateAreasClass.

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

7 years agoEnable support of X-Content-Type-Options: nosniff header for EFL
pmolnar.u-szeged@partner.samsung.com [Fri, 28 Feb 2014 02:32:32 +0000 (02:32 +0000)]
Enable support of X-Content-Type-Options: nosniff header for EFL
https://bugs.webkit.org/show_bug.cgi?id=128673

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/OptionsEfl.cmake:
Enabled NOSNIFF feature flag for EFL.

LayoutTests:

* http/tests/security/contentTypeOptions/nosniff-script-blocked-expected.txt:
* http/tests/security/contentTypeOptions/nosniff-script-without-content-type-blocked-expected.txt:
Updated expectations as console output now includes line numbers.
* platform/efl/TestExpectations:
Unskipped http/tests/security/contentTypeOptions tests.

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

7 years ago[Mac] Stop using some deprecated functions in WKView.mm
ap@apple.com [Fri, 28 Feb 2014 02:05:28 +0000 (02:05 +0000)]
[Mac] Stop using some deprecated functions in WKView.mm
https://bugs.webkit.org/show_bug.cgi?id=129455

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView firstRectForCharacterRange:actualRange:]): Use convertRectToScreen,
which is a replacement for convertBaseToScreen. Don't check for window being null,
because isn't that crazy talk?
(-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]): Use event's location
in window instead of current mouse location. Using location that is not synced to
event stream rarely makes sense, and it doesn't look like this is one of those cases.
(-[WKView performDictionaryLookupAtCurrentMouseLocation]): Ditto.

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

7 years agoUse a RegExp when when using CodeMirror's SearchCursor.
timothy@apple.com [Fri, 28 Feb 2014 01:18:55 +0000 (01:18 +0000)]
Use a RegExp when when using CodeMirror's SearchCursor.

This avoids doing toLowerCase() on every line of the TextEditor.

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

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TextEditor.js:
(TextEditor.prototype.performSearch): Use a RegExp for query. Pass false for the caseFold
argument, but it is ignored for RegExp searches anyway.

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

7 years agoImprove how ContentSearchUtilities::lineEndings works by supporting the three common...
timothy@apple.com [Fri, 28 Feb 2014 01:17:37 +0000 (01:17 +0000)]
Improve how ContentSearchUtilities::lineEndings works by supporting the three common line endings.

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

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::textPositionFromOffset): Remove assumption about line ending length.
(Inspector::ContentSearchUtilities::getRegularExpressionMatchesByLines): Remove assumption about
line ending type and don't try to strip the line ending. Use size_t
(Inspector::ContentSearchUtilities::lineEndings): Use findNextLineStart to find the lines.
This will include the line ending in the lines, but that is okay.
(Inspector::ContentSearchUtilities::buildObjectForSearchMatch): Use size_t.
(Inspector::ContentSearchUtilities::searchInTextByLines): Modernize.

LayoutTests:

* inspector-protocol/debugger/resources/mac-linebreaks.js: Added.
* inspector-protocol/debugger/resources/mixed-linebreaks.js: Added.
* inspector-protocol/debugger/resources/unix-linebreaks.js: Added.
* inspector-protocol/debugger/resources/windows-linebreaks.js: Added.
* inspector-protocol/debugger/searchInContent-linebreaks-expected.txt: Added.
* inspector-protocol/debugger/searchInContent-linebreaks.html: Added.

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

7 years agoUnreviewed. Fix build after r164832
ljaehun.lim@samsung.com [Fri, 28 Feb 2014 01:03:09 +0000 (01:03 +0000)]
Unreviewed. Fix build after r164832

* UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
(WebKit::CoordinatedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):

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

7 years agoUnreviewed, update test expectations after r164830.
bburg@apple.com [Fri, 28 Feb 2014 00:46:49 +0000 (00:46 +0000)]
Unreviewed, update test expectations after r164830.

Inspector test dom/dom-search-crash.html times out in release builds
https://bugs.webkit.org/show_bug.cgi?id=129462

Web Inspector model tests load wrong inspector page under WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=129460

* TestExpectations: Updating test expectations.
* platform/wk2/TestExpectations: Updating test expectations.

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

7 years agotext-decoration-skip: ink does not skip over SVG fonts
mmaxfield@apple.com [Fri, 28 Feb 2014 00:22:32 +0000 (00:22 +0000)]
text-decoration-skip: ink does not skip over SVG fonts
https://bugs.webkit.org/show_bug.cgi?id=128936

Reviewed by Darin Adler.

Source/WebCore:

When drawing glyphs in an SVG font, the glyphs are converted to paths and then filled. This patch moves
the glyph -> path conversion into a helper class, GlyphToPathTranslator, and creates an implementation
for the SVG drawing code. Once this helper class is created, it can be used to trace paths in order
to make underlines skip over SVG glyphs. This helper class also has an implementation for non-SVG glyphs,
which allows for the glyph tracing code to be paramaterized over the implementation of the helper class
rather than if the FontData itself is SVG or not.

Tests: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-svg.html

* platform/graphics/Font.h:
(WebCore::GlyphToPathTranslator::~GlyphToPathTranslator): Virtual implementation of helper class
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::Path): Created constructor that takes a RefPtr<CGMutablePathRef>
* platform/graphics/Path.h:
* platform/graphics/TextRun.h: Give RenderingContext a factory function to create the helper class
instance
* platform/graphics/mac/FontMac.mm: Implementation of helper class used for skipping underlines on
regular (CoreText) glyphs
(WebCore::MacGlyphToPathTranslator::MacGlyphToPathTranslator):
(WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph):
(WebCore::MacGlyphToPathTranslator::incrementIndex):
(WebCore::Font::dashesForIntersectionsWithRect): Call the relevant factory function, and use it
to successively generate Paths
* rendering/svg/SVGTextRunRenderingContext.cpp: Implementation of helper class used for SVG fonts
(WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator):
(WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph):
(WebCore::SVGGlyphToPathTranslator::incrementIndex):
(WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
(WebCore::SVGTextRunRenderingContext::drawSVGGlyphs): Use the above implementation
* rendering/svg/SVGTextRunRenderingContext.h: Factory function declaration

LayoutTests:

This font simply draws some underlined text with a SVG font and makes sure the underline skips.

* fast/css3-text/css3-text-decoration/text-decoration-skip/resources/Litherum.svg: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-svg-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-svg.html: Added.

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

7 years agoFix build after r164832
mrobinson@webkit.org [Fri, 28 Feb 2014 00:09:40 +0000 (00:09 +0000)]
Fix build after r164832

* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState): WebProcessProxy::isLaunching() has been replaced
by WebProcessProxy::state().

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

7 years agoCrash in RemoteLayerTreePropertyApplier::applyPropertiesToLayer
timothy_horton@apple.com [Fri, 28 Feb 2014 00:04:24 +0000 (00:04 +0000)]
Crash in RemoteLayerTreePropertyApplier::applyPropertiesToLayer
https://bugs.webkit.org/show_bug.cgi?id=129456
<rdar://problem/16182676>

Reviewed by Simon Fraser.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
We were dereferencing the RemoteLayerBackingStore without checking if it exists,
in the accelerated drawing codepath. This case will occur if a layer
previously drew contents, but now does not.

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

7 years ago[WebRTC] Removing MediaConstraints argument from RTCPeerConnection addStream, updateI...
thiago.lacerda@openbossa.org [Thu, 27 Feb 2014 23:58:28 +0000 (23:58 +0000)]
[WebRTC] Removing MediaConstraints argument from RTCPeerConnection addStream, updateIce methods and constructor
https://bugs.webkit.org/show_bug.cgi?id=129449

Reviewed by Eric Carlson.

According to WebRTC editor's draft, MediaConstraints will no longer be an argument of those methods and
constructor.

Source/WebCore:

Existing tests were updated.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
(WebCore::RTCPeerConnection::RTCPeerConnection):
(WebCore::RTCPeerConnection::updateIce):
(WebCore::RTCPeerConnection::addStream):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* bindings/js/JSRTCPeerConnectionCustom.cpp:
(WebCore::JSRTCPeerConnectionConstructor::constructJSRTCPeerConnection):
* platform/mediastream/RTCPeerConnectionHandler.h:
* platform/mock/RTCPeerConnectionHandlerMock.cpp:
(WebCore::RTCPeerConnectionHandlerMock::initialize):
(WebCore::RTCPeerConnectionHandlerMock::updateIce):
(WebCore::RTCPeerConnectionHandlerMock::addStream):
* platform/mock/RTCPeerConnectionHandlerMock.h:

LayoutTests:

* fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt:
* fast/mediastream/RTCPeerConnection-AddRemoveStream.html:
* fast/mediastream/RTCPeerConnection-expected.txt:
* fast/mediastream/RTCPeerConnection.html:

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

7 years ago[Mac] Warning: Multiple build commands for output file GCSegmentedArray and Inspector...
commit-queue@webkit.org [Thu, 27 Feb 2014 23:56:06 +0000 (23:56 +0000)]
[Mac] Warning: Multiple build commands for output file GCSegmentedArray and InspectorAgent
https://bugs.webkit.org/show_bug.cgi?id=129446

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

Remove duplicate header entries in Copy Header build phase.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

7 years ago[CSS Regions] Move named-flow specific method decorationsClipRectForBoxInRegion to...
stavila@adobe.com [Thu, 27 Feb 2014 23:52:23 +0000 (23:52 +0000)]
[CSS Regions] Move named-flow specific method decorationsClipRectForBoxInRegion to RenderNamedFlowThread
https://bugs.webkit.org/show_bug.cgi?id=129428

Reviewed by Andreas Kling.

Since the decorationsClipRectForBoxInRegion method is a named flow specific method, it makes
sense to be in the named flow specific class, RenderNamedFlowThread, instead of the more
generic RenderFlowThread.

No new tests required. No new functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderFlowThread.cpp:
* rendering/RenderFlowThread.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
* rendering/RenderNamedFlowThread.h:

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

7 years agoWhoops, include all of last patch.
oliver@apple.com [Thu, 27 Feb 2014 23:36:23 +0000 (23:36 +0000)]
Whoops, include all of last patch.

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

7 years agoSlow cases for function.apply and function.call should not require vm re-entry
oliver@apple.com [Thu, 27 Feb 2014 23:25:29 +0000 (23:25 +0000)]
Slow cases for function.apply and function.call should not require vm re-entry
https://bugs.webkit.org/show_bug.cgi?id=129454

Reviewed by Geoffrey Garen.

Implement call and apply using builtins. Happily the use
of @call and @apply don't perform function equality checks
and just plant direct var_args calls. This did expose a few
codegen issues, but they're all covered by existing tests
once call and apply are implemented in JS.

* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/Function.prototype.js: Added.
(call):
(apply):
* bytecompiler/NodesCodegen.cpp:
(JSC::CallFunctionCallDotNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* interpreter/Interpreter.cpp:
(JSC::sizeFrameForVarargs):
(JSC::loadVarargs):
* interpreter/Interpreter.h:
* jit/JITCall.cpp:
(JSC::JIT::compileLoadVarargs):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::makeFunctionCallNode):
* parser/Lexer.cpp:
(JSC::isSafeBuiltinIdentifier):
* runtime/CommonIdentifiers.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectBuiltinFunction):
(JSC::JSObject::putDirectBuiltinFunctionWithoutTransition):
* runtime/JSObject.h:

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

7 years agoAvoid calling logicalLeftOffsetForLine 2 times in LineWidth::fitBelowFloats
zoltan@webkit.org [Thu, 27 Feb 2014 23:24:05 +0000 (23:24 +0000)]
Avoid calling logicalLeftOffsetForLine 2 times in LineWidth::fitBelowFloats
https://bugs.webkit.org/show_bug.cgi?id=129433

Reviewed by Darin Adler.

This change updates fitBelowFloats and its helpers to call RenderBlock::logicalLeftOffsetForLine only once.

No new tests, no behavior change.

* rendering/line/LineWidth.cpp:
(WebCore::availableWidthAtOffset):
(WebCore::LineWidth::updateLineDimension):
(WebCore::LineWidth::wrapNextToShapeOutside):
(WebCore::LineWidth::fitBelowFloats):
* rendering/line/LineWidth.h:

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

7 years agoMicro-optimize elementAffectsDirectionality().
akling@apple.com [Thu, 27 Feb 2014 23:18:26 +0000 (23:18 +0000)]
Micro-optimize elementAffectsDirectionality().
<https://webkit.org/b/129444>

Tweak this function to skip an unnecessary bit check and use
fastHasAttribute() instead of hasAttribute() for looking up dirAttr.

~1% speedup on DYEB/AngularJS.

Reviewed by Ryosuke Niwa.

* html/HTMLElement.cpp:
(WebCore::elementAffectsDirectionality):

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

7 years agoSimplify WebProcessProxy state accessors
andersca@apple.com [Thu, 27 Feb 2014 23:16:41 +0000 (23:16 +0000)]
Simplify WebProcessProxy state accessors
https://bugs.webkit.org/show_bug.cgi?id=129453

Reviewed by Andreas Kling.

Replace WebProcessProxy::isLaunching() and WebProcessProxy::isValid() with a single
WebProcessProxy::state() that return one of three values: Launching, Running or Terminated.

* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::state):
(WebKit::ChildProcessProxy::sendMessage):
(WebKit::ChildProcessProxy::abortProcessLaunchIfNeeded):
* Shared/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::canSendMessage):
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
* UIProcess/Network/mac/NetworkProcessProxyMac.mm:
(WebKit::NetworkProcessProxy::setProcessSuppressionEnabled):
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::getPluginProcessConnection):
(WebKit::PluginProcessProxy::getSitesWithData):
(WebKit::PluginProcessProxy::clearSiteData):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::waitForDidUpdateViewState):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::requestTermination):
(WebKit::WebProcessProxy::enableSuddenTermination):
(WebKit::WebProcessProxy::disableSuddenTermination):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::updateProcessSuppressionState):

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

7 years agoCrash tapping on play button on video on iOS
simon.fraser@apple.com [Thu, 27 Feb 2014 22:55:44 +0000 (22:55 +0000)]
Crash tapping on play button on video on iOS
https://bugs.webkit.org/show_bug.cgi?id=129452

Reviewed by Benjamin Poulain.

node->computedStyle() can return null. Just use
renderer->style() to get the tap highlight color.

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

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

7 years agoWeb Inspector: model tests should use a special Test.html inspector page
bburg@apple.com [Thu, 27 Feb 2014 22:08:10 +0000 (22:08 +0000)]
Web Inspector: model tests should use a special Test.html inspector page
https://bugs.webkit.org/show_bug.cgi?id=129190

Reviewed by Timothy Hatcher.

Source/WebCore:

Convert InspectorController::isUnderTest() into a flag, and expose an
Internals method so it can be set by the test before opening the inspector.

Test: inspector/test-harness-trivially-works.html

* inspector/InspectorController.cpp:
(WebCore::InspectorController::evaluateForTestInFrontend):
* inspector/InspectorController.h:
* testing/Internals.cpp:
(WebCore::Internals::setInspectorIsUnderTest): Added.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebInspectorUI:

* UserInterface/Base/Test.js: Added.
(WebInspector.loaded):
(WebInspector.contentLoaded):
(WebInspector.updateDockedState):
(InspectorTest.log):
(InspectorTest.assert):
(InspectorTest.debugLog):
(InspectorTest.completeTest):
(InspectorTest.evaluateInPage):
(InspectorTest.addResult):
(InspectorTest.clearResults):
(InspectorTest.pageLoaded):
(InspectorTest.reportUncaughtException):
(.console.logType):
* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.dispatch):
(InspectorBackendClass.prototype.runAfterPendingDispatches):
(InspectorBackendClass.prototype._flushPendingScripts):
* UserInterface/Protocol/InspectorObserver.js:
(WebInspector.InspectorObserver.prototype.evaluateForTestInFrontend):
* UserInterface/Test.html: Added.

Source/WebKit/mac:

Support creating a separate test inspector page, based on the value of
InspectorController::isUnderTest(). Modify the navigation policy to check
the URL against both normal and test inspector pages.

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::openInspectorFrontend):
(-[WebInspectorWindowController init]):
(-[WebInspectorWindowController initWithInspectedWebView:isUnderTest:]):
Move the initial navigation of the inspector page to this method, and change
the URL based on the value of InspectorController::isUnderTest().

(-[WebInspectorWindowController inspectorTestPagePath]): Added.
(-[WebInspectorWindowController webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):

Source/WebKit2:

Support creating a separate test inspector page, based on the value of
InspectorController::isUnderTest(). Add this as a separate API call for
WebInspectorProxy. Modify the navigation policy to check the URL against
both normal and test inspector pages.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::isMainOrTestInspectorPage):
(WebKit::decidePolicyForNavigationAction):
(WebKit::WebInspectorProxy::createInspectorPageForTest):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::inspectorTestPageURL):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::inspectorTestPageURL):
* UIProcess/ios/WebInspectorProxyIOS.mm:
(WebKit::WebInspectorProxy::inspectorTestPageURL):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectorTestPageURL):
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::openInspectorFrontend):
* WebProcess/WebPage/WebInspector.cpp: Some drive-by nullptr refactorings.
(WebKit::WebInspector::WebInspector):
(WebKit::WebInspector::createInspectorPage):
(WebKit::WebInspector::createInspectorPageForTest):
(WebKit::WebInspector::destroyInspectorPage):
* WebProcess/WebPage/WebInspector.h:

Tools:

Remove code that immediately opens the Web Inspector based on the file path of the test.
Instead, the test page should request that the inspector open inside its `test()` method.

This change is necessary because otherwise, the inspector would be opened too early for
InspectorController::isUnderTest to get set in time, so the normal Web Inspector page
will get loaded instead of the minimal test page.

* DumpRenderTree/efl/DumpRenderTree.cpp:
(createTestRunner):
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(runTest):
* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* DumpRenderTree/win/DumpRenderTree.cpp:
(runTest):

LayoutTests:

Add a stripped-down version of the inspector test script that's used by
all inspector model tests. Clean up the namespaces so things accessible
from only the test page are part of the `InspectorTestProxy` object.

Add a minimal test that exercises the initialization and communication code
paths on the test page and the inspector page.

* http/tests/inspector-protocol/resources/InspectorTest.js: Add a FIXME.
* inspector/inspector-test.js: Added.
(InspectorTestProxy.register):
(runTest.initializeFrontend):
(runTest.runTestInFrontend):
(runTest):
(InspectorTestProxy.completeTest):
(InspectorTestProxy.debugLog):
(InspectorTestProxy.addResult):
(InspectorTestProxy.clearResults):
(InspectorTestProxy.reportUncaughtException):
* inspector/test-harness-trivially-works-expected.txt: Added.
* inspector/test-harness-trivially-works.html: Added.

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

7 years agoWeb Inspector: Better name for RemoteInspectorDebuggableConnection dispatch queue
commit-queue@webkit.org [Thu, 27 Feb 2014 21:50:14 +0000 (21:50 +0000)]
Web Inspector: Better name for RemoteInspectorDebuggableConnection dispatch queue
https://bugs.webkit.org/show_bug.cgi?id=129443

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

This queue is specific to the JSContext debuggable connections,
there is no XPC involved. Give it a better name.

* inspector/remote/RemoteInspectorDebuggableConnection.mm:
(Inspector::RemoteInspectorDebuggableConnection::RemoteInspectorDebuggableConnection):

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

7 years agoRemove jsc symlink if it already exists
ddkilzer@apple.com [Thu, 27 Feb 2014 21:41:27 +0000 (21:41 +0000)]
Remove jsc symlink if it already exists

This is a follow-up fix for:

Create symlink to /usr/local/bin/jsc during installation
<http://webkit.org/b/129399>
<rdar://problem/16168734>

* JavaScriptCore.xcodeproj/project.pbxproj:
(Create /usr/local/bin/jsc symlink): If a jsc symlink already
exists where we're about to create the symlink, remove the old
one first.

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

7 years agoUnreviewed build fix for Mac tools after r164814
msaboff@apple.com [Thu, 27 Feb 2014 21:35:14 +0000 (21:35 +0000)]
Unreviewed build fix for Mac tools after r164814

* Configurations/ToolExecutable.xcconfig:
- Added JavaScriptCore.framework/PrivateHeaders to ToolExecutable include path.
* JavaScriptCore.xcodeproj/project.pbxproj:
- Changed productName to testRegExp for testRegExp target.

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

7 years agoUnreviewed build fix after r164824.
joepeck@webkit.org [Thu, 27 Feb 2014 21:02:14 +0000 (21:02 +0000)]
Unreviewed build fix after r164824.

Accidentally re-added some code that was removed.

* page/ContentSecurityPolicy.cpp:

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

7 years agoCompile fix when not using TEXTURE_MAPPER_GL.
alex.christensen@flexsim.com [Thu, 27 Feb 2014 20:45:52 +0000 (20:45 +0000)]
Compile fix when not using TEXTURE_MAPPER_GL.
https://bugs.webkit.org/show_bug.cgi?id=129417

Reviewed by Darin Adler.

* platform/graphics/texmap/TextureMapperGL.cpp:
Protect platformCreateAccelerated with USE(TEXTURE_MAPPER_GL).

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

7 years agoWeb Inspector: JSContext inspection should report exceptions in the console
joepeck@webkit.org [Thu, 27 Feb 2014 20:45:08 +0000 (20:45 +0000)]
Web Inspector: JSContext inspection should report exceptions in the console
https://bugs.webkit.org/show_bug.cgi?id=128776

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

When JavaScript API functions have an exception, let the inspector
know so it can log the JavaScript and Native backtrace that caused
the exception.

Include some clean up of ConsoleMessage and ScriptCallStack construction.

* API/JSBase.cpp:
(JSEvaluateScript):
(JSCheckScriptSyntax):
* API/JSObjectRef.cpp:
(JSObjectMakeFunction):
(JSObjectMakeArray):
(JSObjectMakeDate):
(JSObjectMakeError):
(JSObjectMakeRegExp):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectGetPropertyAtIndex):
(JSObjectSetPropertyAtIndex):
(JSObjectDeleteProperty):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):
* API/JSValue.mm:
(reportExceptionToInspector):
(valueToArray):
(valueToDictionary):
* API/JSValueRef.cpp:
(JSValueIsEqual):
(JSValueIsInstanceOfConstructor):
(JSValueCreateJSONString):
(JSValueToNumber):
(JSValueToStringCopy):
(JSValueToObject):
When seeing an exception, let the inspector know there was an exception.

* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):
(Inspector::JSGlobalObjectInspectorController::reportAPIException):
Log API exceptions by also grabbing the native backtrace.

* inspector/ScriptCallStack.h:
* inspector/ScriptCallStack.cpp:
(Inspector::ScriptCallStack::firstNonNativeCallFrame):
(Inspector::ScriptCallStack::append):
Minor extensions to ScriptCallStack to make it easier to work with.

* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::ConsoleMessage):
(Inspector::ConsoleMessage::autogenerateMetadata):
Provide better default information if the first call frame was native.

* inspector/ScriptCallStackFactory.cpp:
(Inspector::createScriptCallStack):
(Inspector::extractSourceInformationFromException):
(Inspector::createScriptCallStackFromException):
Perform the handling here of inserting a fake call frame for exceptions
if there was no call stack (e.g. a SyntaxError) or if the first call
frame had no information.

* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::ConsoleMessage):
(Inspector::ConsoleMessage::autogenerateMetadata):
* inspector/ConsoleMessage.h:
* inspector/ScriptCallStackFactory.cpp:
(Inspector::createScriptCallStack):
(Inspector::createScriptCallStackForConsole):
* inspector/ScriptCallStackFactory.h:
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::enable):
(Inspector::InspectorConsoleAgent::addMessageToConsole):
(Inspector::InspectorConsoleAgent::count):
* inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
(Inspector::JSGlobalObjectDebuggerAgent::breakpointActionLog):
ConsoleMessage cleanup.

Source/WebCore:

Include some clean up of ConsoleMessage and ScriptCallStack construction.

Covered by existing tests.

* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
Simplify code now that createStackTraceFromException handles it.

* page/ContentSecurityPolicy.cpp:
(WebCore::gatherSecurityPolicyViolationEventData):
(WebCore::ContentSecurityPolicy::reportViolation):
ScriptCallStack can give us the first non-native callframe.

* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::buildInitiatorObject):
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::breakpointActionLog):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):
* page/Console.cpp:
(WebCore::internalAddMessage):
(WebCore::Console::profile):
(WebCore::Console::profileEnd):
(WebCore::Console::timeEnd):
* page/ContentSecurityPolicy.cpp:
(WebCore::gatherSecurityPolicyViolationEventData):
(WebCore::ContentSecurityPolicy::reportViolation):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):

Source/WebInspectorUI:

* UserInterface/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl.prototype._formatMessage):
(WebInspector.ConsoleMessageImpl.prototype._shouldHideURL):
(WebInspector.ConsoleMessageImpl.prototype._firstNonNativeCallFrame):
(WebInspector.ConsoleMessageImpl.prototype._populateStackTraceTreeElement):
Provide better handling for "[native code]" and legacy "undefined"
call frame URLs. Never linkify these. Also, when showing a link
for an exception, always use the first non-native call frame as
the link location.

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

7 years agoCreate symlink to /usr/local/bin/jsc during installation
ddkilzer@apple.com [Thu, 27 Feb 2014 20:37:51 +0000 (20:37 +0000)]
Create symlink to /usr/local/bin/jsc during installation
<http://webkit.org/b/129399>
<rdar://problem/16168734>

Reviewed by Dan Bernstein.

* JavaScriptCore.xcodeproj/project.pbxproj:
- Add "Create /usr/local/bin/jsc symlink" build phase script to
  create the symlink during installation.

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

7 years agoRemove FeatureObserver.
akling@apple.com [Thu, 27 Feb 2014 20:24:03 +0000 (20:24 +0000)]
Remove FeatureObserver.
<https://webkit.org/b/129439>

This code was only used by the Chromium port and nobody else is
making use of it.

Reviewed by Anders Carlsson.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* dom/EventTarget.h:
* html/ColorInputType.cpp:
* html/ColorInputType.h:
* html/DateInputType.cpp:
* html/DateInputType.h:
* html/DateTimeInputType.cpp:
* html/DateTimeInputType.h:
* html/DateTimeLocalInputType.cpp:
* html/DateTimeLocalInputType.h:
* html/EmailInputType.cpp:
* html/EmailInputType.h:
* html/HTMLDataListElement.cpp:
(WebCore::HTMLDataListElement::create):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::parseAttribute):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::parseAttribute):
* html/InputType.cpp:
* html/InputType.h:
* html/MonthInputType.cpp:
* html/MonthInputType.h:
* html/NumberInputType.cpp:
* html/NumberInputType.h:
* html/RangeInputType.cpp:
* html/RangeInputType.h:
* html/SearchInputType.cpp:
* html/SearchInputType.h:
* html/TelephoneInputType.cpp:
* html/TelephoneInputType.h:
* html/TextInputType.cpp:
* html/TextInputType.h:
* html/TimeInputType.cpp:
* html/TimeInputType.h:
* html/URLInputType.cpp:
* html/URLInputType.h:
* html/WeekInputType.cpp:
* html/WeekInputType.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
(WebCore::FrameLoader::dispatchDidCommitLoad):
* page/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didReceiveHeader):
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* page/FeatureObserver.cpp: Removed.
* page/FeatureObserver.h: Removed.
* page/Page.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* workers/SharedWorker.cpp:
(WebCore::SharedWorker::create):
* workers/Worker.cpp:
(WebCore::Worker::create):

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

7 years agoTransform more clip-path pixel tests to reference tests
krit@webkit.org [Thu, 27 Feb 2014 20:16:40 +0000 (20:16 +0000)]
Transform more clip-path pixel tests to reference tests
https://bugs.webkit.org/show_bug.cgi?id=129230

Reviewed by Simon Fraser.

Fix masking test.

* svg/masking/mask-negative-scale.svg:

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

7 years agoMake WebProcessProxy::pages() return an IteratorRange
andersca@apple.com [Thu, 27 Feb 2014 19:41:12 +0000 (19:41 +0000)]
Make WebProcessProxy::pages() return an IteratorRange
https://bugs.webkit.org/show_bug.cgi?id=129440

Reviewed by Dan Bernstein.

* UIProcess/API/C/WKPage.cpp:
(WKPageCopyRelatedPages):
Move the implementation of WebPageProxy::relatedPages here.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::createNewWebProcessRespectingProcessCountLimit):
Use std::min_element here instead of a manual loop.

* UIProcess/WebPageProxy.cpp:
Remove WebPageProxy::relatedPages().

* UIProcess/WebProcessProxy.cpp:
Remove WebProcessProxy::pages().

* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::pages):
Make this return an IteratorRange.

(WebKit::WebProcessProxy::pageCount):
New function that returns the page count.

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

7 years agoMath.{max, min}() must not return after first NaN value
commit-queue@webkit.org [Thu, 27 Feb 2014 19:39:42 +0000 (19:39 +0000)]
Math.{max, min}() must not return after first NaN value
https://bugs.webkit.org/show_bug.cgi?id=104147

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-02-27
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

According to the spec, ToNumber going to be called on each argument
even if a `NaN` value was already found

* runtime/MathObject.cpp:
(JSC::mathProtoFuncMax):
(JSC::mathProtoFuncMin):

LayoutTests:

Extended the Math.{max, min}() tests, to check that these methods are return after first NaN value or not.

* js/math-expected.txt:
* js/script-tests/math.js:

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

7 years ago[Mac][WK2] Remove hardcoded Cmd+B and Cmd+I from WKView.mm
ap@apple.com [Thu, 27 Feb 2014 19:20:08 +0000 (19:20 +0000)]
[Mac][WK2] Remove hardcoded Cmd+B and Cmd+I from WKView.mm
https://bugs.webkit.org/show_bug.cgi?id=129436

Reviewed by Darin Adler.

* UIProcess/API/mac/WKView.mm: Removed a historic WebKit1 behavior that we don't
need to preserve in WebKit2.

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

7 years agoAssertion failure at CachedResource.h:196: ASSERT(!m_purgeableData)
psolanki@apple.com [Thu, 27 Feb 2014 19:11:52 +0000 (19:11 +0000)]
Assertion failure at CachedResource.h:196: ASSERT(!m_purgeableData)
https://bugs.webkit.org/show_bug.cgi?id=129349
<rdar://problem/14871837>

Reviewed by Joseph Pecoraro.

The code for clearing out memory mapped notification callbacks is only needed when loading
PDFs. And in such cases, we always have dataSourceDelegate object. So make this code
conditional on its presence so that we don't trigger the assert for non-PDF main resources.

* WebView/WebDataSource.mm:
(-[WebDataSource dealloc]):

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

7 years ago[Mac] Remove unused SPI declarations from WKView.mm
ap@apple.com [Thu, 27 Feb 2014 19:00:33 +0000 (19:00 +0000)]
[Mac] Remove unused SPI declarations from WKView.mm
https://bugs.webkit.org/show_bug.cgi?id=129434

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKView.mm:

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

7 years agoJSType upper limit (0xff) assertion can be removed.
commit-queue@webkit.org [Thu, 27 Feb 2014 18:49:53 +0000 (18:49 +0000)]
JSType upper limit (0xff) assertion can be removed.
https://bugs.webkit.org/show_bug.cgi?id=129424

Patch by Gergo Balogh <gbalogh.u-szeged@partner.samsung.com> on 2014-02-27
Reviewed by Geoffrey Garen.

* runtime/JSTypeInfo.h:
(JSC::TypeInfo::TypeInfo):

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

7 years agoAuto generate bytecode information for bytecode parser and LLInt
msaboff@apple.com [Thu, 27 Feb 2014 18:48:37 +0000 (18:48 +0000)]
Auto generate bytecode information for bytecode parser and LLInt
https://bugs.webkit.org/show_bug.cgi?id=129181

Reviewed by Mark Lam.

Source/JavaScriptCore:

Added new bytecode/BytecodeList.json that contains a list of bytecodes and related
helpers.  It also includes bytecode length and other information used to generate files.
Added a new generator, generate-bytecode-files that generates Bytecodes.h and InitBytecodes.asm
in DerivedSources/JavaScriptCore/.

Added the generation of these files to the "DerivedSource" build step.
Slighty changed the build order, since the Bytecodes.h file is needed by
JSCLLIntOffsetsExtractor.  Moved the offline assembly to a separate step since it needs
to be run after JSCLLIntOffsetsExtractor.

Made related changes to OPCODE macros and their use.

Added JavaScriptCore.framework/PrivateHeaders to header file search path for building
jsc to resolve Mac build issue.

* CMakeLists.txt:
* Configurations/JSC.xcconfig:
* DerivedSources.make:
* GNUmakefile.am:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.vcxproj/copy-files.cmd:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/Opcode.h:
(JSC::padOpcodeName):
* llint/LLIntCLoop.cpp:
(JSC::LLInt::CLoop::initialize):
* llint/LLIntCLoop.h:
* llint/LLIntData.cpp:
(JSC::LLInt::initialize):
* llint/LLIntOpcode.h:
* llint/LowLevelInterpreter.asm:

Source/WebKit:

Added ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} to WebKit_INCLUDE_DIRECTORIES due to new
generated Bytecodes.h include file.

* CMakeLists.txt:

Source/WebKit2:

Added ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} to WebKit2_INCLUDE_DIRECTORIES due to new
generated Bytecodes.h include file.

* CMakeLists.txt:

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

7 years agoFix 32-bit V_JITOperation_EJ callOperation introduced in r162652.
commit-queue@webkit.org [Thu, 27 Feb 2014 18:47:54 +0000 (18:47 +0000)]
Fix 32-bit V_JITOperation_EJ callOperation introduced in r162652.
https://bugs.webkit.org/show_bug.cgi?id=129420

Patch by Julien Brianceau <jbriance@cisco.com> on 2014-02-27
Reviewed by Geoffrey Garen.

* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation): Payload and tag are swapped.
Also, EABI_32BIT_DUMMY_ARG is missing for arm EABI and mips.

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

7 years agoOctane/closure thrashes between flattening dictionaries during global object initiali...
fpizlo@apple.com [Thu, 27 Feb 2014 18:34:27 +0000 (18:34 +0000)]
Octane/closure thrashes between flattening dictionaries during global object initialization in a global eval
https://bugs.webkit.org/show_bug.cgi?id=129435

Reviewed by Oliver Hunt.

This is a 5-10% speed-up on Octane/closure.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionClearCodeCache):
* runtime/BatchedTransitionOptimizer.h:
(JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
(JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):

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

7 years agoAdded svn:ignore to two directories, so that .pyc files don't show up as unversioned.
ap@apple.com [Thu, 27 Feb 2014 18:27:08 +0000 (18:27 +0000)]
Added svn:ignore to two directories, so that .pyc files don't show up as unversioned.

* inspector/scripts: Added property svn:ignore.
* replay/scripts: Added property svn:ignore.

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