WebKit-https.git
6 years agoRefactoring editing/selection/13804.html
g.czajkowski@samsung.com [Wed, 23 Apr 2014 07:34:01 +0000 (07:34 +0000)]
Refactoring editing/selection/13804.html
https://bugs.webkit.org/show_bug.cgi?id=131986

Reviewed by Darin Adler.

This test does not need pixel baselines (MAC, EFL, GTK) to just
check whether spelling marker appears on 'adf'.

According to bug 125688, the test starts using asynchronous
spellchecking.

Since the test mostly verifies spelling behaviour, it was moved
to editing/spelling directory.
Its name was changed to spelling-backward.html.

* editing/selection/13804.html: Removed.
* editing/spelling/spelling-backward-expected.txt: Added, renamed from editing/selection/13804.html.
* editing/spelling/spelling-backward.html: Added.

* platform/efl/editing/selection/13804-expected.png: Removed.
* platform/efl/editing/selection/13804-expected.txt: Removed.
* platform/gtk/editing/selection/13804-expected.png: Removed.
* platform/gtk/editing/selection/13804-expected.txt: Removed.
* platform/mac/editing/selection/13804-expected.png: Removed.
* platform/mac/editing/selection/13804-expected.txt: Removed.
Get rid of platform specific expectation.

* platform/gtk/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
Mark spelling-backward.html as failure due to missing asynchronous spellchecking.

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

6 years agoCursor doesn't change back to pointer when leaving the Safari window
rniwa@webkit.org [Wed, 23 Apr 2014 06:11:22 +0000 (06:11 +0000)]
Cursor doesn't change back to pointer when leaving the Safari window
https://bugs.webkit.org/show_bug.cgi?id=132038

Reviewed by Alexey Proskuryakov.

Source/WebCore:
r147739 incorrectly added an early exit in EventHandler::selectCursor when hit test result didn't have
any node associated with it. Since we will hit this code when the cursor is outside of the WebView,
we still need to take the CURSOR_AUTO path as did the code before r147739.

No new test is added since this behavior can't be tested in DRT or WTR.

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

Source/WebKit/mac:
Since the cursor type is now updated asynchronously after r147739,
[window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0]
evalutes to false depending on how fast cursor is moving.

Instead, check whether the NSWindow of the WebView is the key window or not since
key window appears to control the cursor style in Cocoa as far as I've tested:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html

* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::setCursor):

Source/WebKit2:
Since the cursor type is now updated asynchronously after r147739,
[window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0]
evalutes to false depending on how fast cursor is moving.

Instead, check whether the NSWindow of the WebView is the key window or not since
key window appears to control the cursor style in Cocoa as far as I've tested:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setCursor):

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

6 years agoAdd SPI to expose provisional URL from Frame.
commit-queue@webkit.org [Wed, 23 Apr 2014 05:59:34 +0000 (05:59 +0000)]
Add SPI to expose provisional URL from Frame.
https://bugs.webkit.org/show_bug.cgi?id=132014

Add methods to return the provisional URL from WKWebProcessPlugInFrame.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2014-04-22
Reviewed by Dan Bernstein.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(-[WKWebProcessPlugInFrame _provisionalURL]):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:

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

6 years ago[iOS][WK2] Split iOS touch event dispatch for the regular touch event dispatch
benjamin@webkit.org [Wed, 23 Apr 2014 05:53:05 +0000 (05:53 +0000)]
[iOS][WK2] Split iOS touch event dispatch for the regular touch event dispatch
https://bugs.webkit.org/show_bug.cgi?id=132033

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

The generic touch event dispatching does not work well with iOS gesture recognizers.
Some events are required to be synchronous, while other needs can be asynchronous and
can even use event coalescing. We only need UI callback for the synchronous events.

Previously, that was implemented by changing the property ShouldSendEventsSynchronously
on WebPageProxy. That is causing issues when synchronous events are sent right after asynchronous
events because the responses in WebPageProxy::didReceiveEvent() easily get out of order.

This patch completely split the UIGestureRecognizerDispatching from the normal asynchronous event dispatching.

Synchronous events are sent directly to the WebProcess and report the result to the PageClient right away.

Asynchronous events are sent to the EventDispatcher where they are coalesced until the main thread is free
to process events.

There can be a race where a synchronous event comes before the asynchronous events are processed. In that case,
the synchronous event handler starts by getting the events out of the EventDispatcher and dispatch them first.

* Shared/NativeWebTouchEvent.h:
(WebKit::NativeWebTouchEvent::uniqueId): Deleted.
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleSynchronousTouchEvent):
(WebKit::WebPageProxy::sendAsynchronousTouchEvent):
(WebKit::WebPageProxy::didReceiveEvent):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _webTouchEvent:WebKit::preventsNativeGestures:]):
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::EventDispatcher):
(WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
(WebKit::EventDispatcher::getQueuedTouchEventsForPage):
(WebKit::EventDispatcher::touchEvent):
(WebKit::EventDispatcher::dispatchTouchEvents):
* WebProcess/WebPage/EventDispatcher.h:
* WebProcess/WebPage/EventDispatcher.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchTouchEvent):
(WebKit::WebPage::touchEventSync):
(WebKit::WebPage::touchEvent):
(WebKit::WebPage::touchEventSyncForTesting):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dispatchAsynchronousTouchEventsQueue):

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

6 years ago[EFL][WK1] There are many failures in fast/forms since r163033
ryuan.choi@samsung.com [Wed, 23 Apr 2014 05:28:20 +0000 (05:28 +0000)]
[EFL][WK1] There are many failures in fast/forms since r163033
https://bugs.webkit.org/show_bug.cgi?id=132039

Reviewed by Gyuyoung Kim.

* ewk/ewk_view.cpp: Added break statements which is missing while remove COMPILE_ASSERT_MATCHING_ENUM
(ewk_view_navigation_policy_decision):

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

6 years agoUnreviewed EFL gardening. media tests has been broken since r166395 on both EFL wk1...
gyuyoung.kim@samsung.com [Wed, 23 Apr 2014 05:03:07 +0000 (05:03 +0000)]
Unreviewed EFL gardening. media tests has been broken since r166395 on both EFL wk1 and wk2.

* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:

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

6 years agoSkip fast/events/ghostly-mousemoves-in-subframe.html on Mac/WK1.
akling@apple.com [Wed, 23 Apr 2014 03:13:41 +0000 (03:13 +0000)]
Skip fast/events/ghostly-mousemoves-in-subframe.html on Mac/WK1.

* platform/mac-wk1/TestExpectations:

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

6 years agoDo not paint border image when the border rect is empty.
zalan@apple.com [Wed, 23 Apr 2014 02:44:25 +0000 (02:44 +0000)]
Do not paint border image when the border rect is empty.
https://bugs.webkit.org/show_bug.cgi?id=131988

Reviewed by Darin Adler.

http://trac.webkit.org/changeset/167351 introduced an early return when border
rect is empty. This patch ensures that border image is not painted either in that case.

Source/WebCore:
Modified padding-margin-negative-border.html to cover border-image case.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder):

LayoutTests:
* fast/css/padding-margin-negative-border-expected.html: Borders in -expected.html does not get painted either, just
ensure that they are explicitly different colors.
* fast/css/padding-margin-negative-border.html:

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

6 years agoASSERTION FAILED: scrollerImp == scrollbarPainterForScrollbar(_scrollbar) on two...
timothy_horton@apple.com [Wed, 23 Apr 2014 01:37:39 +0000 (01:37 +0000)]
ASSERTION FAILED: scrollerImp == scrollbarPainterForScrollbar(_scrollbar) on two API tests
https://bugs.webkit.org/show_bug.cgi?id=132034
<rdar://problem/16624332>

Reviewed by Simon Fraser.

* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPainterDelegate shouldUseLayerPerPartForScrollerImp:]):
scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp: moves the delegate
from the old scrollerImp to the new one, and also happens to call shouldUseLayerPerPartForScrollerImp.
Since scrollerImpWithStyle: has not returned yet, the scrollbarPainterForScrollbar still returns the old scrollerImp,
so this assertion fires. It's safe to remove this because supportsUpdateOnSecondaryThread doesn't make use of the imp.

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

6 years agoDFG::Worklist should acquire the m_lock before iterating DFG plans.
mark.lam@apple.com [Wed, 23 Apr 2014 00:36:49 +0000 (00:36 +0000)]
DFG::Worklist should acquire the m_lock before iterating DFG plans.
<https://webkit.org/b/132032>

Reviewed by Filip Pizlo.

Currently, there's a rightToRun mechanism that ensures that no compilation
threads are running when the GC is iterating through the DFG worklists.
However, this does not prevent a Worker thread from doing a DFG compilation
and modifying the plans in the worklists thereby invalidating the plan
iterator that the GC is using.  This patch fixes the issue by acquiring
the worklist m_lock before iterating the worklist plans.

This issue was uncovered by running the fast/workers layout tests with
COLLECT_ON_EVERY_ALLOCATION enabled.

* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::isActiveForVM):
(JSC::DFG::Worklist::visitChildren):

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

6 years agoDumpRenderTree generates black snapshots on some platforms
timothy_horton@apple.com [Tue, 22 Apr 2014 23:54:49 +0000 (23:54 +0000)]
DumpRenderTree generates black snapshots on some platforms
https://bugs.webkit.org/show_bug.cgi?id=132029
<rdar://problem/16679363>

Reviewed by Simon Fraser.

* DumpRenderTree/mac/PixelDumpSupportMac.mm:
(createBitmapContextFromWebView):
DRT checks with the WebView to determine whether it can use the window's
backing store directly or (because of compositing) needs to take a WindowServer
snapshot. However, on some platforms and in some situations, the window can
be layer backed without the WebView necessarily currently being composited.
We should check with the window in addition to the WebView before going
ahead and using its backing store.

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

6 years agoAX: iOS hit-testing does not work when page is zoomed
cfleizach@apple.com [Tue, 22 Apr 2014 23:51:51 +0000 (23:51 +0000)]
AX: iOS hit-testing does not work when page is zoomed
https://bugs.webkit.org/show_bug.cgi?id=132013

Reviewed by Simon Fraser.

Implement accessibilityHitTest so that the point can be converted correctly.

* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

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

6 years agoREGRESSION (r157328): popover to check into flight ba.com dismisses instantly when...
rniwa@webkit.org [Tue, 22 Apr 2014 23:25:59 +0000 (23:25 +0000)]
REGRESSION (r157328): popover to check into flight ba.com dismisses instantly when focusing form
https://bugs.webkit.org/show_bug.cgi?id=131949

Reviewed by Darin Adler.

Source/WebCore:
The regression was caused by two bugs:
1. The event didn't stop propagating itself even when it should.
   If the related target is same as the event origin, the event propagation should stop when the event reaches
   the root of the related target's tree scope. Otherwise, it should stop when it reaches the related target.

2. Mouse event's related target exposed nodes inside a user-agent shadow DOM when the related target appeared
   inside the origin.

Fixed the bugs by re-introducing path shrinkage algorithm removed in r157328 into EventPath::setRelatedTarget
and adding an algorithm to determine the least common ancestor of the related target and the current target
in moveToParentOrShadowHost. The latter algorithm doesn't match the shadow DOM specification:
http://www.w3.org/TR/2013/WD-shadow-dom-20130514/
but it's good enough in terms of the Web exposed behavior as we don't support author defined insertion points.

Test: fast/events/shadow-event-path.html

* dom/EventDispatcher.cpp:
(WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
(WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope): Added.
(WebCore::EventDispatcher::dispatchEvent):
(WebCore::EventPath::setRelatedTarget):

LayoutTests:
Add a test that dumps the event target and the related target of every mouse event
when dispatched inside an input element inside a details element.

This catches the regression as well as other bugs I encountered while fixing the bug.

We need a WK2 specific results because WK1 mac results contain an extra fake mouse move event.

* fast/events/shadow-event-path-expected.txt: Added.
* fast/events/shadow-event-path.html: Added.
* platform/mac-wk2/fast/events/shadow-event-expected.txt: Added.

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

6 years agoRollout r156635 since the old behavior was intentional.
rniwa@webkit.org [Tue, 22 Apr 2014 23:05:53 +0000 (23:05 +0000)]
Rollout r156635 since the old behavior was intentional.

Source/WebCore:
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):

LayoutTests:
* editing/caret/selection-with-caret-type-progress-expected.txt: Removed.
* editing/caret/selection-with-caret-type-progress.html: Removed.

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

6 years agoDumpRenderTree generates white snapshots on some platforms
timothy_horton@apple.com [Tue, 22 Apr 2014 22:44:51 +0000 (22:44 +0000)]
DumpRenderTree generates white snapshots on some platforms
https://bugs.webkit.org/show_bug.cgi?id=132026
<rdar://problem/16679363>

Reviewed by Simon Fraser.

* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
Link DRT against QuartzCore.

* DumpRenderTree/mac/PixelDumpSupportMac.mm:
(createBitmapContextFromWebView):
Force CoreAnimation to synchronously update layers in a more explicit
way that doesn't depend on AppKit behavior. This is very similar to what
WebKitTestRunner does (indirectly) during its force repaint.

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

6 years agoUnreviewed, rolling out r167674.
commit-queue@webkit.org [Tue, 22 Apr 2014 22:05:46 +0000 (22:05 +0000)]
Unreviewed, rolling out r167674.
https://bugs.webkit.org/show_bug.cgi?id=132025

Going a different way with this (Requested by bradee-oh on
#webkit).

Reverted changeset:

"Change Image Controls replacement to use selection and paste"
https://bugs.webkit.org/show_bug.cgi?id=131992
http://trac.webkit.org/changeset/167674

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

6 years ago[Win] Support Python 2.7 in Cygwin
bfulgham@apple.com [Tue, 22 Apr 2014 21:58:42 +0000 (21:58 +0000)]
[Win] Support Python 2.7 in Cygwin
https://bugs.webkit.org/show_bug.cgi?id=132023

Reviewed by Michael Saboff.

Source/JavaScriptCore:
* DerivedSources.make: Use a conditional variable to define
the path to Python/Perl.

Source/WebCore:
* DerivedSources.make: Use proper path to Cygwin on
all platforms.

Source/WebInspectorUI:
* WebInspectorUI.vcxproj/build-webinspectorui.sh: use
proper path to Python under Cygwin.

Source/WebKit:
* WebKit.vcxproj/WebKit/WebKitVersion.cmd: Use correct
path to Python under Cygwin.

Source/WTF:
* WTF.vcxproj/WTFGenerated.make: Use proper path to Python.

Tools:
* Scripts/webkitdirs.pm:
(checkInstalledTools): Remove check for Python 2.7, since
it now works properly.

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

6 years agoREGRESSION (r151839): Subframe keeps getting mousemove events with the same coordinat...
akling@apple.com [Tue, 22 Apr 2014 21:55:59 +0000 (21:55 +0000)]
REGRESSION (r151839): Subframe keeps getting mousemove events with the same coordinates after hiding a hovered element.
<https://webkit.org/b/131974>
<rdar://problem/15907469>

Source/WebCore:
When the currently hovered element disappears as a result of style recalc,
we send a fake mousemove event to the page, to see if anything newly added
should become hovered.

The faking mechanism lives in EventHandler and simply synthesizes a new
mousemove event using the last seen mouse location.

The problem here is that we were sending this fake mousemove event to the
subframe where the hovered element lived. Since subframes aren't kept up
to date on recent mouse locations, this could cause some strange behavior
where a subframe would dispatch mousemove events with stale coordinates.

The solution is to always dispatch fake mousemove events from the main
frame's event handler. This is how real event delivery happens, and hit
testing will then find the appropriate subframe, if any.

Reviewed by Benjamin Poulain.

Test: fast/events/ghostly-mousemoves-in-subframe.html

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

LayoutTests:
Add a test that triggers the weirdness where removing the renderer from
a hovered element in a subframe would leave the subframe's EventHandler
in a state where it could dispatch fake mousemove events with stale
coordinates in response to style recalc.

Note that the final 500ms delay is because fake mousemove events are
sent on 250ms delay timers so we need to give it some time to catch up.

Reviewed by Benjamin Poulain.

* fast/events/ghostly-mousemoves-in-subframe-expected.txt: Added.
* fast/events/ghostly-mousemoves-in-subframe.html: Added.
* platform/mac-wk2/fast/events/resources/ghostly-mousemoves-in-subframe-the-actual-subframe.html: Added.

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

6 years ago[OS X] Glyph spacing for system fonts may be incorrect
mmaxfield@apple.com [Tue, 22 Apr 2014 21:07:11 +0000 (21:07 +0000)]
[OS X] Glyph spacing for system fonts may be incorrect
https://bugs.webkit.org/show_bug.cgi?id=131967

Unreviewed iOS build fix after r167679.

* platform/graphics/mac/SimpleFontDataMac.mm:

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

6 years agoRemove unused local variable
commit-queue@webkit.org [Tue, 22 Apr 2014 20:51:14 +0000 (20:51 +0000)]
Remove unused local variable
https://bugs.webkit.org/show_bug.cgi?id=132020

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-04-22
Reviewed by Alexey Proskuryakov.

* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]):

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

6 years ago[OS X] Glyph spacing for system fonts may be incorrect
mmaxfield@apple.com [Tue, 22 Apr 2014 20:49:13 +0000 (20:49 +0000)]
[OS X] Glyph spacing for system fonts may be incorrect
https://bugs.webkit.org/show_bug.cgi?id=131967

Unreviewed build fix after r167679.

* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::hasCustomTracking):

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

6 years agoREGRESSION: JSRegress's js/slow-stress/new-spread.html fails sometimes
timothy_horton@apple.com [Tue, 22 Apr 2014 20:40:49 +0000 (20:40 +0000)]
REGRESSION: JSRegress's js/slow-stress/new-spread.html fails sometimes
https://bugs.webkit.org/show_bug.cgi?id=132022
<rdar://problem/16690671>

* TestExpectations:
Mark the test as flaky pass/fail/timeout, because that's what it is.

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

6 years ago[OS X] Glyph spacing for system fonts may be incorrect
mmaxfield@apple.com [Tue, 22 Apr 2014 20:38:00 +0000 (20:38 +0000)]
[OS X] Glyph spacing for system fonts may be incorrect
https://bugs.webkit.org/show_bug.cgi?id=131967

Reviewed by Simon Fraser.

Source/WebCore:
Covered by existing tests.

* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformWidthForGlyph): Update to use CTFontGetAdvancesForGlyphs() for system fonts
(WebCore::hasCustomTracking):

LayoutTests:
Updating test to be more robust.

* fast/forms/search/intrinsic-search-width-with-decoration-border-padding-expected.txt:
* fast/forms/search/intrinsic-search-width-with-decoration-border-padding.html:

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

6 years ago[New Multicolumn] widows/orphans cause assertion failures.
hyatt@apple.com [Tue, 22 Apr 2014 20:31:47 +0000 (20:31 +0000)]
[New Multicolumn] widows/orphans cause assertion failures.
https://bugs.webkit.org/show_bug.cgi?id=131233

Reviewed by Dean Jackson.

* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::recordSpaceShortage):
Fix an obvious bug where the space shortage is recorded twice (and the
if statement that kept it from being negative is accidentally ignored).

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

6 years ago[New Multicolumn] Make sure columnTranslationForOffset has the same column-span-aware
hyatt@apple.com [Tue, 22 Apr 2014 20:05:29 +0000 (20:05 +0000)]
[New Multicolumn] Make sure columnTranslationForOffset has the same column-span-aware
translation that fragment collection does.
https://bugs.webkit.org/show_bug.cgi?id=131738

Reviewed by Anders Carlsson.

* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::collectLayerFragments):
Remove a FIXME that is no longer needed, since the translation offset of the
column set did get patched.

(WebCore::RenderMultiColumnSet::columnTranslationForOffset):
Add the exact same fix to columnTranslationForOffset that was applied to collectLayerFragments.

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

6 years agoWebCore::HTMLMediaElement::ensureMediaControlsInjectedScript() needs to acquire the...
mark.lam@apple.com [Tue, 22 Apr 2014 19:58:24 +0000 (19:58 +0000)]
WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript() needs to acquire the JSLock before calling into JS.
<https://webkit.org/b/132021>

Reviewed by Mark Hahnenberg.

Covered by existing layout test.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):

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

6 years agoREGRESSION (r167652): Broke fast/regions/cssom/region-range-for-box-crash.html in...
rego@igalia.com [Tue, 22 Apr 2014 19:48:29 +0000 (19:48 +0000)]
REGRESSION (r167652): Broke fast/regions/cssom/region-range-for-box-crash.html in debug mode
https://bugs.webkit.org/show_bug.cgi?id=131982

Reviewed by David Hyatt.

Source/WebCore:
The problem was creating the Range from the arguments received at RenderView::setSelection(). Specifically
in this test endPos is 1 when the element has not children which creates an invalid Range.

* rendering/RenderView.cpp:
(WebCore::RenderView::splitSelectionBetweenSubtrees): Pass 0 as startPos and endPos to Range::create() as we are
not interested in the positions at this point.

LayoutTests:
* TestExpectations: Unskip fast/regions/cssom/region-range-for-box-crash.html.

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

6 years agoChange Image Controls replacement to use selection and paste
beidson@apple.com [Tue, 22 Apr 2014 19:22:28 +0000 (19:22 +0000)]
Change Image Controls replacement to use selection and paste
<rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992

Reviewed by Tim Horton.

Source/WebCore:
* WebCore.exp.in: Remove deleted symbol.

* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::defaultEventHandler):

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::showImageControlsMenu): Select the image element
  before showing the menu.
(WebCore::ContextMenuController::replaceControlledImage): Deleted.
* page/ContextMenuController.h:

Source/WebKit/mac:
* Misc/WebSharingServicePickerController.mm:
(-[WebSharingServicePickerController sharingService:didShareItems:]): Write the
  replacement data to a special pasteboard, then replace the current selection from
  that pasteboard.

Source/WebKit2:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Write the
  replacement data to a special pasteboard, then replace the current selection from
  that pasteboard.

Remove all other code used to support the old replacement mechanism:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::replaceControlledImage): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/mac/WebContextMenuProxyMac.h:
(WebKit::WebContextMenuProxyMac::page):
(WebKit::WebContextMenuProxyMac::replaceControlledImage): Deleted.
* WebProcess/WebPage/WebContextMenu.cpp:
(WebKit::WebContextMenu::replaceControlledImage): Deleted.
* WebProcess/WebPage/WebContextMenu.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::replaceControlledImage): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

6 years agoREGRESSION: Hitting asserts in new flow thread selection code.
hyatt@apple.com [Tue, 22 Apr 2014 19:00:06 +0000 (19:00 +0000)]
REGRESSION: Hitting asserts in new flow thread selection code.
https://bugs.webkit.org/show_bug.cgi?id=132019

Reviewed by Anders Carlsson.

Null checking flowThreadController is not enough. The list of threads
can be null even when the flowThreadController is not. That's why you
use hasRenderNamedFlowThreads. I patched the two bad places in the code
to use hasRenderNamedFlowThreads to stop the crashes.

* rendering/RenderView.cpp:
(WebCore::RenderView::selectionBounds):
(WebCore::RenderView::repaintSelection):

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

6 years agoCheck (rather than assume) element is a RenderTableSection before using it
bfulgham@apple.com [Tue, 22 Apr 2014 18:36:52 +0000 (18:36 +0000)]
Check (rather than assume) element is a RenderTableSection before using it
https://bugs.webkit.org/show_bug.cgi?id=121858

Reviewed by David Kilzer.

Source/WebCore:
Test: fast/table/table-insert-object-before-td-crash.html

* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild): Check that lastBox is a table section before
using the node as if it was one.

LayoutTests:
* fast/table/table-insert-object-before-td-crash-expected.txt: Added.
* fast/table/table-insert-object-before-td-crash.html: Added.

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

6 years agoSwitch the LLVMForJSC target to using the LLVM in /usr/local rather than /usr/local...
fpizlo@apple.com [Tue, 22 Apr 2014 18:36:23 +0000 (18:36 +0000)]
Switch the LLVMForJSC target to using the LLVM in /usr/local rather than /usr/local/LLVMForJavaScriptCore on iOS
https://bugs.webkit.org/show_bug.cgi?id=130867
<rdar://problem/16432456>

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore:
* Configurations/Base.xcconfig:
* Configurations/LLVMForJSC.xcconfig:

Tools:
* Scripts/build-webkit:
* Scripts/copy-webkitlibraries-to-product-directory:

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

6 years agoBegin implementation of video using Media Foundation.
alex.christensen@flexsim.com [Tue, 22 Apr 2014 18:22:02 +0000 (18:22 +0000)]
Begin implementation of video using Media Foundation.
https://bugs.webkit.org/show_bug.cgi?id=131830

Reviewed by Brent Fulgham.

Source/WebCore:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
Added MediaPlayerPrivateMediaFoundation files.
* platform/graphics/MediaPlayer.cpp:
Include MediaPlayerPrivateMediaFoundation inside new USE(MEDIA_FOUNDATION) flag.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: Added.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Added.

Source/WebKit/win:
* FullscreenVideoController.cpp:
* WebView.cpp:
Added new USE(MEDIA_FOUNDATION) flag to prevent using the unsupported fullscreen api.

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

6 years ago[GTK] Fails to build documentation when output is redirected
gns@gnome.org [Tue, 22 Apr 2014 18:12:56 +0000 (18:12 +0000)]
[GTK] Fails to build documentation when output is redirected
https://bugs.webkit.org/show_bug.cgi?id=131178

Reviewed by Martin Robinson.

* gtk/generate-gtkdoc: set the output for stdout and stderr to UTF-8
explicitly to avoid encoding issues when they are redirected.

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

6 years ago[Win] Unreviewed build fix after my r167666.
alex.christensen@flexsim.com [Tue, 22 Apr 2014 18:08:53 +0000 (18:08 +0000)]
[Win] Unreviewed build fix after my r167666.

* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorCommon.props:
Added ../../../ again to include headers in Source/JavaScriptCore.

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

6 years ago[GTK] YCM choose a newer compile_commands.json in between Release or Debug
changseok.oh@collabora.com [Tue, 22 Apr 2014 17:38:15 +0000 (17:38 +0000)]
[GTK] YCM choose a newer compile_commands.json in between Release or Debug
https://bugs.webkit.org/show_bug.cgi?id=131911

Reviewed by Martin Robinson.

common.get_build_path returns release path even though Debug configuration
is newer than Release. So YouCompleteMe is used to refer old build setup inadvertently.

* gtk/ycm_extra_conf.py:
(get_build_path): Compare modified time of Release and Debug. And return a recent modified path.
(FlagsForFile):

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

6 years agoRemoved old stdbool and inttypes headers.
alex.christensen@flexsim.com [Tue, 22 Apr 2014 17:30:56 +0000 (17:30 +0000)]
Removed old stdbool and inttypes headers.
https://bugs.webkit.org/show_bug.cgi?id=131966

Reviewed by Brent Fulgham.

.:
* Source/cmake/OptionsWindows.cmake:
* Source/cmake/WebKitPackaging.cmake:
Removed references to os-win32 directory.

Source/JavaScriptCore:
* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorCommon.props:
* JavaScriptCore.vcxproj/testRegExp/testRegExpCommon.props:
Removed references to os-win32 directory.
* os-win32: Removed.
* os-win32/inttypes.h: Removed.
* os-win32/stdbool.h: Removed.

WebKitLibraries:
* win/tools/vsprops/WinCairo.props:
Removed references to os-win32 directory.

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

6 years ago[EFL][WK2] Remove duplicated code to set size to the DrawingArea.
eunmi15.lee@samsung.com [Tue, 22 Apr 2014 17:04:23 +0000 (17:04 +0000)]
[EFL][WK2] Remove duplicated code to set size to the DrawingArea.
https://bugs.webkit.org/show_bug.cgi?id=131972

Reviewed by Andreas Kling.

DrawingArea's size is set in the WebView.cpp when EwkView's size is
changed, so we don't have to set again in the PageViewportController.

* UIProcess/CoordinatedGraphics/PageViewportController.cpp:
(WebKit::PageViewportController::didChangeViewportSize):

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

6 years agoUnreviewed, rolling out r167658.
commit-queue@webkit.org [Tue, 22 Apr 2014 16:56:24 +0000 (16:56 +0000)]
Unreviewed, rolling out r167658.
https://bugs.webkit.org/show_bug.cgi?id=131993

Caused many crashes on media tests (Requested by ap on
#webkit).

Reverted changeset:

"[Mac] don't ask for AVAssetTrack properties before they are
available"
https://bugs.webkit.org/show_bug.cgi?id=131902
http://trac.webkit.org/changeset/167658

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

6 years ago[New Multicolumn] fast/multicol/multicol-with-child-renderLayer-for-input.html puts...
hyatt@apple.com [Tue, 22 Apr 2014 16:08:18 +0000 (16:08 +0000)]
[New Multicolumn] fast/multicol/multicol-with-child-renderLayer-for-input.html puts the textfield in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=131808

Reviewed by Brady Eidson.

Source/WebCore:

Make sure FrameView is patched to pass in the update pagination flag when subtree layout
is done on textfields. It had code for the old multicolumn system but did not have a check
for the new multicolumn system.

Added fast/multicol/newmulticol/compare-with-old-impl/multicol-with-child-renderLayer-for-input.html

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

LayoutTests:

* fast/multicol/newmulticol/compare-with-old-impl/multicol-with-child-renderLayer-for-input-expected.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/multicol-with-child-renderLayer-for-input.html: Added.

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

6 years agoWKThumbnailView doesn't quite work with topContentInset
timothy_horton@apple.com [Tue, 22 Apr 2014 15:51:33 +0000 (15:51 +0000)]
WKThumbnailView doesn't quite work with topContentInset
https://bugs.webkit.org/show_bug.cgi?id=131976
<rdar://problem/16642127>

Reviewed by Darin Adler.

* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView initWithFrame:fromWKView:]):
_WKThumbnailView always needs a layer.
We don't want to use snapshots by default, this was debugging accidentally landed in the last change.

(-[_WKThumbnailView _requestSnapshotIfNeeded]):
Don't request a new snapshot if the scale is the same as the existing one.
Reduce the height of the snapshot by the topContentInset.
Having the origin at (0, 0) is still correct, as the inset content is in negative Y space,
and (0, 0) is the true origin of the content.

(-[_WKThumbnailView setScale:]):
When not snapshotting, we've decided that WKThumbnailView should apply the scale to the WKView layer tree,
instead of depending on clients to do so.

(-[_WKThumbnailView setUsesSnapshot:]):
We *do* need to apply thumbnail scale in the web process even when snapshotting,
because we use the live layer tree temporarily while waiting for the asynchronous
snapshot to return. This was a misstep in the last thumbnail view patch.

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

6 years ago[EFL][WK1] There are many warnings in layout test since r167428
ryuan.choi@samsung.com [Tue, 22 Apr 2014 15:39:26 +0000 (15:39 +0000)]
[EFL][WK1] There are many warnings in layout test since r167428
https://bugs.webkit.org/show_bug.cgi?id=131985

Reviewed by Gyuyoung Kim.

Since r167428, implementation of flush method was removed, but ewk_view_frame_main_cleared
still checked and generated many warnings.

Now, ewk_view_frame_main_cleared is not required because flush is already
meaningless and others are covered by ewk_frame_view_create_for_view.
So, this patch removed ewk_view_frame_main_cleared and related code which is already dead.

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::transitionToCommittedForNewPage):
* ewk/ewk_view.cpp:
(ewk_view_frame_main_cleared): Deleted.
(ewk_view_did_first_visually_nonempty_layout): Deleted.
(ewk_view_dispatch_did_finish_loading): Deleted.
* ewk/ewk_view.h: Removed flush smart method.

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

6 years ago[WebKit2] Cleanup the build from unused parameter in WebProcess Module
commit-queue@webkit.org [Tue, 22 Apr 2014 15:19:02 +0000 (15:19 +0000)]
[WebKit2] Cleanup the build from unused parameter in WebProcess Module
https://bugs.webkit.org/show_bug.cgi?id=131970

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-04-22
Reviewed by Darin Adler.

Fix a build warning by removing the parameters in function paintLayerContents() to fix build warning.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::paintLayerContents):

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

6 years agoborder-style: double rendered as solid when combined with border-radius
zalan@apple.com [Tue, 22 Apr 2014 14:17:43 +0000 (14:17 +0000)]
border-style: double rendered as solid when combined with border-radius
https://bugs.webkit.org/show_bug.cgi?id=131927

Reviewed by Simon Fraser.

BorderEdge::getDoubleBorderStripeWidths() should return the calculated inner, outer border widths.

Source/WebCore:
Test: fast/borders/hidpi-double-border-with-border-radius-always-produce-solid-line.html

* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::getDoubleBorderStripeWidths):
* rendering/BorderEdge.h:

LayoutTests:
* fast/borders/hidpi-double-border-with-border-radius-always-produce-solid-line-expected.html: Added.
* fast/borders/hidpi-double-border-with-border-radius-always-produce-solid-line.html: Added.

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

6 years ago[Mac] don't ask for AVAssetTrack properties before they are available
eric.carlson@apple.com [Tue, 22 Apr 2014 14:06:36 +0000 (14:06 +0000)]
[Mac] don't ask for AVAssetTrack properties before they are available
https://bugs.webkit.org/show_bug.cgi?id=131902
<rdar://problem/16505076>

Reviewed by Jer Noble.

No new tests, the behavior this changes can not be tested with a layout test.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize
    m_cachedTotalBytes.
(WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata): Don't report that
    metadata has been loaded until the track properties we need have been loaded too.
(WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Cache totalBytes instead
    of recalculating it every time.
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Invalidate cached
    total bytes.
(WebCore::assetTrackMetadataKeyNames): Array of AVAssetTrack properties we use.

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

6 years ago[GTK] Crash after getting web view context property with g_object_get
carlosgc@webkit.org [Tue, 22 Apr 2014 13:36:21 +0000 (13:36 +0000)]
[GTK] Crash after getting web view context property with g_object_get
https://bugs.webkit.org/show_bug.cgi?id=131983

Reviewed by Philippe Normand.

The problem is that the getter is using g_value_take_object() and
the default context is destroyed when the caller releases its ref.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewGetProperty): Use g_value_set_object() instead of
g_value_take_object().

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

6 years agoUnreviewed gardening.
rego@igalia.com [Tue, 22 Apr 2014 12:00:04 +0000 (12:00 +0000)]
Unreviewed gardening.

* TestExpectations: fast/regions/cssom/region-range-for-box-crash.html is crashing on debug mode after r167652.

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

6 years agoBuildfix after r167650 broke non-Cocoa builds
pmolnar.u-szeged@partner.samsung.com [Tue, 22 Apr 2014 11:03:04 +0000 (11:03 +0000)]
Buildfix after r167650 broke non-Cocoa builds
https://bugs.webkit.org/show_bug.cgi?id=131980

Reviewed by Mario Sanchez Prada.

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

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

6 years ago[EFL][WK2] Remove unnecessary includes in files of Source/WebKit2/UIProcess/API/efl
ryuan.choi@samsung.com [Tue, 22 Apr 2014 10:51:38 +0000 (10:51 +0000)]
[EFL][WK2] Remove unnecessary includes in files of Source/WebKit2/UIProcess/API/efl
https://bugs.webkit.org/show_bug.cgi?id=131979

Reviewed by Gyuyoung Kim.

Removed unnecessary includes of header files.
In addition, tried to use forward declarations.

* UIProcess/API/efl/EwkView.cpp:
* UIProcess/API/efl/EwkView.h:
* UIProcess/API/efl/EwkViewCallbacks.h:
* UIProcess/API/efl/GestureRecognizer.h:
* UIProcess/API/efl/ewk_context_menu_item_private.h:
* UIProcess/API/efl/ewk_context_menu_private.h:
* UIProcess/API/efl/ewk_download_job.cpp:
* UIProcess/API/efl/ewk_download_job_private.h:
* UIProcess/API/efl/ewk_form_submission_request.cpp:
* UIProcess/API/efl/ewk_form_submission_request_private.h:
* UIProcess/API/efl/ewk_navigation_data.cpp:
* UIProcess/API/efl/ewk_navigation_data_private.h:
* UIProcess/API/efl/ewk_page_group_private.h:
* UIProcess/API/efl/ewk_popup_menu_private.h:
* UIProcess/API/efl/ewk_view.cpp:
* UIProcess/API/efl/ewk_window_features_private.h:
* UIProcess/efl/PageUIClientEfl.cpp:
* UIProcess/efl/ViewClientEfl.cpp:

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

6 years ago[CSS Regions] Selection highlight doesn't match DOM selection
rego@igalia.com [Tue, 22 Apr 2014 10:22:47 +0000 (10:22 +0000)]
[CSS Regions] Selection highlight doesn't match DOM selection
https://bugs.webkit.org/show_bug.cgi?id=131511

Reviewed by David Hyatt.

Source/WebCore:
This patch implements a subtrees approach to fix selection interaction in CSS Regions.

The idea is to divide the Render tree in subtrees. One subtree will be the RenderView (which is always present),
then for each RenderNamedFlowThread (which are children of RenderView) we will have an extra subtree.

For each subtree it determines the start and end positions according to the DOM tree. So, every subtree will
always have a start and end position, and the selection algorithm will be able to reach the end from the start
without problems (this allows us to remove the changes introduced in r155058).

Then selection related methods in RenderView are adapted to ensure that they are called for each subtree. Making
the selection highlight to match DOM selection as expected.

Test: fast/regions/selection/selecting-text-including-region.html

* CMakeLists.txt: Add new class SelectionSubtreeRoot to build file.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* rendering/RenderNamedFlowThread.h: Inherit from SelectionSubtreeRoot.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::selectionRoot): New method to return the RenderNamedFlowThread if any or the RenderView
otherwise.
(WebCore::RenderObject::selectionStartEnd): If it's inside a RenderNamedFlowThread use specific method instead
of the RenderView's one.
* rendering/RenderObject.h: Add new method signature.
* rendering/RenderView.cpp:
(WebCore::RenderView::selectionBounds): Adapt method to subtrees approach.
(WebCore::RenderView::subtreeSelectionBounds): Modify previous method in order to use SelectionSubtreeRoot
objects.
(WebCore::RenderView::repaintSelection): Adapt method to subtrees approach.
(WebCore::RenderView::repaintSubtreeSelection): Modify previous method in order to use SelectionSubtreeRoot
objects.
(getNextOrPrevRenderObjectBasedOnDirection): Deleted method from r155058 as it is not needed anymore. Each
subtree will have start and end positions, so the selection algorithm will always find the end.
(WebCore::RenderView::setSelection): Adapt method to subtrees approach.
(WebCore::RenderView::splitSelectionBetweenSubtrees): Determine start and end positions for each subtree and
call setSubtreeSelection().
(WebCore::RenderView::setSubtreeSelection): Modify previous method in order to use SelectionSubtreeRoot objects.
* rendering/RenderView.h: Inherit from SelectionSubtreeRoot. Add signature for new helper methods receiving
SelectionSubtreeRoot objects.
* rendering/SelectionSubtreeRoot.cpp: Added.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
(WebCore::SelectionSubtreeRoot::selectionStartEndPositions):
* rendering/SelectionSubtreeRoot.h: Added. New class to identify root elements for the subtrees. With some basic
attributes and methods to store the start and end positions and offsets.
(WebCore::SelectionSubtreeRoot::selectionStart):
(WebCore::SelectionSubtreeRoot::selectionStartPos):
(WebCore::SelectionSubtreeRoot::selectionEnd):
(WebCore::SelectionSubtreeRoot::selectionEndPos):
(WebCore::SelectionSubtreeRoot::setSelectionStart):
(WebCore::SelectionSubtreeRoot::setSelectionStartPos):
(WebCore::SelectionSubtreeRoot::setSelectionEnd):
(WebCore::SelectionSubtreeRoot::setSelectionEndPos):

LayoutTests:
Add new test to check highlight of render objects moved under RenderNamedFlowThread in the render tree.

Updated some tests to avoid issues with selection gap filling in the new implementation.

* fast/regions/selection/selecting-text-including-region-expected.html: Added.
* fast/regions/selection/selecting-text-including-region.html: Added.
* fast/regions/selection/selecting-text-through-different-region-flows-2-expected.html: Updated.
* fast/regions/selection/selecting-text-through-different-region-flows-2.html: Updated.
* fast/regions/selection/selection-direction-expected.html: Updated.
* fast/regions/selection/selection-direction.html: Updated.

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

6 years agoFix a typo in WebKitFeatures.cmake -- INITALVALUE -> INITIALVALUE.
zandobersek@gmail.com [Tue, 22 Apr 2014 08:29:23 +0000 (08:29 +0000)]
Fix a typo in WebKitFeatures.cmake -- INITALVALUE -> INITIALVALUE.

Rubber-stamped by Carlos Garcia Campos.

* Source/cmake/WebKitFeatures.cmake:

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

6 years agoSource/WebCore: [Mac] Follow-up: After a horizontal overflow scroll with a mechanical...
bfulgham@apple.com [Tue, 22 Apr 2014 05:44:49 +0000 (05:44 +0000)]
Source/WebCore: [Mac] Follow-up: After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
https://bugs.webkit.org/show_bug.cgi?id=131960
<rdar://problem/16142100>

Unreviewed build fix.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent): The test to clear the
last scrolled node was too broad. It should only follow this path
if both the phase and momentum phase are 'None'.

Tools: Unreviewed build fix.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
Correct a typo that prevented tests from working properly.

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

6 years agoDFG::clobberize() should honestly admit that profiler and debugger nodes are effectful
fpizlo@apple.com [Tue, 22 Apr 2014 04:26:25 +0000 (04:26 +0000)]
DFG::clobberize() should honestly admit that profiler and debugger nodes are effectful
https://bugs.webkit.org/show_bug.cgi?id=131971
<rdar://problem/16676511>

Reviewed by Mark Lam.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

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

6 years ago[Mac] After a horizontal overflow scroll with a mechanical wheel mouse, vertical...
bfulgham@apple.com [Tue, 22 Apr 2014 03:59:06 +0000 (03:59 +0000)]
[Mac] After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
https://bugs.webkit.org/show_bug.cgi?id=131960
<rdar://problem/16142100>

Reviewed by Darin Adler.

Source/WebCore:
Test: platform/mac/fast/scrolling/scroll-div-no-latching.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent): When not latching, always clear m_latchedWheelEventElement and m_previousWheelScrolledElement.

LayoutTests:
* platform/mac/fast/scrolling/scroll-div-no-latching-expected.txt: Added.
* platform/mac/fast/scrolling/scroll-div-no-latching.html: Added.

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

6 years agoWebProfilerAgent::disable is calling the wrong superclass method
commit-queue@webkit.org [Tue, 22 Apr 2014 03:26:22 +0000 (03:26 +0000)]
WebProfilerAgent::disable is calling the wrong superclass method
https://bugs.webkit.org/show_bug.cgi?id=131968

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

* inspector/WebProfilerAgent.cpp:
(WebCore::WebProfilerAgent::disable):

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

6 years agoSwitch statements that skip the baseline JIT should work
fpizlo@apple.com [Tue, 22 Apr 2014 02:58:00 +0000 (02:58 +0000)]
Switch statements that skip the baseline JIT should work
https://bugs.webkit.org/show_bug.cgi?id=131965

Reviewed by Mark Hahnenberg.

* bytecode/JumpTable.h:
(JSC::SimpleJumpTable::ensureCTITable):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitSwitchIntJump):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
* tests/stress/inline-llint-with-switch.js: Added.
(foo):
(bar):
(test):

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

6 years ago[wk2] Don't send intrinsic content size updates with dirty layout
timothy_horton@apple.com [Tue, 22 Apr 2014 02:16:53 +0000 (02:16 +0000)]
[wk2] Don't send intrinsic content size updates with dirty layout
https://bugs.webkit.org/show_bug.cgi?id=131964
<rdar://problem/14292718>

Reviewed by Simon Fraser.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired): Deleted.
Instead of using a timer (which can fire while layout is dirty) to coalesce
intrinsic content size changes, send them only from flushLayers, just after updating layout.
This ensures that we never get intermediate intrinsic content sizes that won't be painted.

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

6 years agoRemove a unnecessary forward-declared class from TiledCoreAnimationDrawingArea.
timothy_horton@apple.com [Tue, 22 Apr 2014 02:15:12 +0000 (02:15 +0000)]
Remove a unnecessary forward-declared class from TiledCoreAnimationDrawingArea.

Rubber-stamped by Simon Fraser.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:

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

6 years ago[GTK] Should have the ability to output composited contents during layout testing
mrobinson@webkit.org [Tue, 22 Apr 2014 01:56:04 +0000 (01:56 +0000)]
[GTK] Should have the ability to output composited contents during layout testing
https://bugs.webkit.org/show_bug.cgi?id=131864

Reviewed by Philippe Normand.

* WebKitTestRunner/cairo/TestInvocationCairo.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Add a path that paints the widget contents
to an image surface. We run the main loop a bit to match the implementation from WebKit1 and EFL.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::windowSnapshotImage): Use the new UI-process path on GTK+.

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

6 years agoFollowup from http://trac.webkit.org/changeset/167624
enrica@apple.com [Tue, 22 Apr 2014 01:48:21 +0000 (01:48 +0000)]
Followup from trac.webkit.org/changeset/167624

Reviewed by Darin Adler.

Fixing incorrect use of ? : syntax.

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

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

6 years agoArguments objects shouldn't need a destructor
mhahnenberg@apple.com [Tue, 22 Apr 2014 01:37:34 +0000 (01:37 +0000)]
Arguments objects shouldn't need a destructor
https://bugs.webkit.org/show_bug.cgi?id=131899

Reviewed by Oliver Hunt.

This patch rids Arguments objects of their destructors. It does this by
switching their backing stores to use CopiedSpace rather than malloc memory.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateArguments): Fix the code emitted for inline
Arguments allocation so that it only emits an extra write for strict mode code rather
than unconditionally.
* heap/CopyToken.h: New CopyTokens for the two different types of Arguments backing stores.
* runtime/Arguments.cpp:
(JSC::Arguments::visitChildren): We need to tell the collector to copy the back stores now.
(JSC::Arguments::copyBackingStore): Do the actual copying of the backing stores.
(JSC::Arguments::deletePropertyByIndex): Update all the accesses to SlowArgumentData and m_registerArray.
(JSC::Arguments::deleteProperty):
(JSC::Arguments::defineOwnProperty):
(JSC::Arguments::allocateRegisterArray):
(JSC::Arguments::tearOff):
(JSC::Arguments::destroy): Deleted. We don't need the destructor any more.
* runtime/Arguments.h:
(JSC::Arguments::registerArraySizeInBytes):
(JSC::Arguments::SlowArgumentData::SlowArgumentData): Switch SlowArgumentData to being allocated
in CopiedSpace. Now the SlowArgumentData and its backing store are a single contiguous CopiedSpace
allocation.
(JSC::Arguments::SlowArgumentData::slowArguments):
(JSC::Arguments::SlowArgumentData::bytecodeToMachineCaptureOffset):
(JSC::Arguments::SlowArgumentData::setBytecodeToMachineCaptureOffset):
(JSC::Arguments::SlowArgumentData::sizeForNumArguments):
(JSC::Arguments::Arguments):
(JSC::Arguments::allocateSlowArguments):
(JSC::Arguments::tryDeleteArgument):
(JSC::Arguments::isDeletedArgument):
(JSC::Arguments::isArgument):
(JSC::Arguments::argument):
(JSC::Arguments::finishCreation):
* runtime/SymbolTable.h:

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

6 years agoMove CoordinatedGraphics related codes out of CMakeLists.txt
ryuan.choi@samsung.com [Tue, 22 Apr 2014 01:34:46 +0000 (01:34 +0000)]
Move CoordinatedGraphics related codes out of CMakeLists.txt
https://bugs.webkit.org/show_bug.cgi?id=131931

Reviewed by Gyuyoung Kim.

Move CoordinatedGraphics related files to PlatformEfl.cmake because they are not common files.

* CMakeLists.txt:
* PlatformEfl.cmake:

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

6 years ago[MSE][Mac] AVSampleBufferDisplayLayer and AudioRenderer is overretained.
jer.noble@apple.com [Tue, 22 Apr 2014 00:57:39 +0000 (00:57 +0000)]
[MSE][Mac] AVSampleBufferDisplayLayer and AudioRenderer is overretained.
https://bugs.webkit.org/show_bug.cgi?id=131963

Reviewed by Jon Honeycutt.

Adopt the results of -[[class alloc] init] rather than retaining them.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::hasVideo):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):

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

6 years agoDon't try to use a null connection()->xpcConnection()
simon.fraser@apple.com [Tue, 22 Apr 2014 00:23:04 +0000 (00:23 +0000)]
Don't try to use a null connection()->xpcConnection()
https://bugs.webkit.org/show_bug.cgi?id=131961

Reviewed by Dan Bernstein.

If running with -WebKit2UseXPCServiceForWebProcess NO, connection()->xpcConnection()
is null and xpc_connection_get_pid() would crash, so null-check the xpcConnection.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didFinishLaunching):

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

6 years agoREGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all...
zalan@apple.com [Tue, 22 Apr 2014 00:15:35 +0000 (00:15 +0000)]
REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom
https://bugs.webkit.org/show_bug.cgi?id=131924

Computing tile dimension for contain/cover requires higher precision than what LayoutUnit has. Switching to floats.

Reviewed by Simon Fraser.

Source/WebCore:
Test: fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateFillTileSize):

LayoutTests:
* fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision-expected.html: Added.
* fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html: Added.

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

6 years agoBuild fix for Mountain Lion.
dino@apple.com [Tue, 22 Apr 2014 00:14:34 +0000 (00:14 +0000)]
Build fix for Mountain Lion.

* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::SerializedPlatformRepresentationMac::deserialize):

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

6 years agoSource/WebCore: WebCore part of <rdar://problem/16631323> Page::setDefersLoading...
mitz@apple.com [Tue, 22 Apr 2014 00:10:38 +0000 (00:10 +0000)]
Source/WebCore: WebCore part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
https://bugs.webkit.org/show_bug.cgi?id=131939

Reviewed by David Kilzer.

* WebCore.exp.in: Exported WebCore::ResourceHandle::setDefersLoading.

* loader/ResourceLoadScheduler.cpp:
(WebCore::ResourceLoadScheduler::setDefersLoading): Added a no-op implementation.
* loader/ResourceLoadScheduler.h: Declared new virtual member function setDefersLoading.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::setDefersLoading): Added a call to the above function.

Source/WebKit2: WebKit part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
https://bugs.webkit.org/show_bug.cgi?id=131939

Reviewed by David Kilzer.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setDefersLoading): Added. Forwards the message to
the NetworkResourceLoader.
* NetworkProcess/NetworkConnectionToWebProcess.h:

* NetworkProcess/NetworkConnectionToWebProcess.messages.in: Added SetDefersLoading message.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize new member variable
m_defersLoading from the new field in the loader parameters.
(WebKit::NetworkResourceLoader::start): Added. Like WebCore::ResourceLoader, if loading is
deferred, keep the request in m_deferredRequest and bail out.
(WebKit::NetworkResourceLoader::setDefersLoading): Added. Similar to
WebCore::ResourceLoader::setDefersLoading.
* NetworkProcess/NetworkResourceLoader.h:
(WebKit::NetworkResourceLoader::defersLoading):

* Shared/Network/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Initialize new field
defersLoading to false.
(WebKit::NetworkResourceLoadParameters::encode): Encode new field.
(WebKit::NetworkResourceLoadParameters::decode): Decode new field.
* Shared/Network/NetworkResourceLoadParameters.h: Added defersLoading field.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad): Populate defersLoading field in the load
parameters.
(WebKit::WebResourceLoadScheduler::setDefersLoading): Send a message to the Network process.
* WebProcess/Network/WebResourceLoadScheduler.h:

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

6 years ago[Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally
bfulgham@apple.com [Tue, 22 Apr 2014 00:05:02 +0000 (00:05 +0000)]
[Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally
https://bugs.webkit.org/show_bug.cgi?id=131959
<rdar://problem/16654523>

Reviewed by Simon Fraser.

* page/mac/EventHandlerMac.mm:
(WebCore::deltaIsPredominantlyVertical): Added.
(WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
the element style indicates that overflow is hidden, since this means there is no scroll possible in that
direction.
(WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.

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

6 years agoErrors passed to delegate methods should have recovery attempters
andersca@apple.com [Mon, 21 Apr 2014 23:51:15 +0000 (23:51 +0000)]
Errors passed to delegate methods should have recovery attempters
https://bugs.webkit.org/show_bug.cgi?id=131957
<rdar://problem/16642539>

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h: Added.
* UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm: Added.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::createErrorWithRecoveryAttempter):
(WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
(WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame):
* UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h: Added.
* UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: Added.
(-[WKReloadFrameErrorRecoveryAttempter initWithWebView:frameHandle:urlString:]):
(-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
* WebKit2.xcodeproj/project.pbxproj:

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

6 years ago[Mac] implement WebKitDataCue
eric.carlson@apple.com [Mon, 21 Apr 2014 23:18:23 +0000 (23:18 +0000)]
[Mac] implement WebKitDataCue
https://bugs.webkit.org/show_bug.cgi?id=131799

Reviewed by Dean Jackson.

Source/JavaScriptCore:
* Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.

Source/WebCore:
Tests: http/tests/media/track-in-band-hls-metadata.html
       media/track/track-datacue-value.html

* Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
* DerivedSources.make: Add ENABLE_DATACUE_VALUE to HTML_FLAGS when appropriate.

* CMakeLists.txt: Add JSDataCueCustom.cpp.
* bindings/js/JSBindingsAllInOne.cpp:
* WebCore.xcodeproj/project.pbxproj: Add new files.

* bindings/js/JSDataCueCustom.cpp: Added.
(WebCore::JSDataCue::value):
(WebCore::JSDataCue::setValue):
(WebCore::JSDataCueConstructor::constructJSDataCue): Custom constructor.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by fixes: don't schedule timeupdate
    events when paused, don't call sort on an Vector that can't be sorted.

* html/track/DataCue.cpp:
(WebCore::DataCue::DataCue): Initialize m_type.
(WebCore::DataCue::~DataCue): Unprotect the JSValue if necessary.
(WebCore::DataCue::data): Ask the platform value for data if non-null.
(WebCore::DataCue::setData): Clear m_platformValue and m_value.
(WebCore::DataCue::isEqual): New.
(WebCore::DataCue::value): Return a JSValue from the platform value, or the value passed
    to the constructor/set by script.
(WebCore::DataCue::setValue): Set m_value.
* html/track/DataCue.h:
* html/track/DataCue.idl:

* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::addDataCue): Don't add the same cue more than once.
(WebCore::InbandDataTextTrack::updateDataCue): Update a cue's duration.
(WebCore::InbandDataTextTrack::removeDataCue): Remove an incomplete cue.
(WebCore::InbandDataTextTrack::removeCue): Remove a cue from the incomplete cue map if necessary.
* html/track/InbandDataTextTrack.h:

* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::addGenericCue): CueMatchRules is now in TextTrackCue instead
    of VTTCue.
* html/track/InbandTextTrack.h:

* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::hasCue): Ditto.
* html/track/TextTrack.h:

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::isEqual): New, test base class equality.
* html/track/TextTrackCue.h:

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGeneric::isEqual): Call TextTrackCue::isEqual first.
* html/track/TextTrackCueGeneric.h:

* html/track/VTTCue.cpp:
(WebCore::VTTCue::isEqual): Call TextTrackCue::isEqual first.
* html/track/VTTCue.h:

* platform/SerializedPlatformRepresentation.h: Added.
(WebCore::SerializedPlatformRepresentation::~SerializedPlatformRepresentation):
(WebCore::SerializedPlatformRepresentation::SerializedPlatformRepresentation):

* platform/graphics/InbandTextTrackPrivateClient.h: Add methods for DataCue with SerializedPlatformRepresentation.

* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Added.
(WebCore::InbandMetadataTextTrackPrivateAVF::create):
(WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF):
(WebCore::InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF):
(WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
(WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: Added.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): currentTrack -> currentTextTrack.
(WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Ditto.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundation::setCurrentTrack): Deleted.

Renamed currentTrack and setCurrentTrack to currentTextTrack and setCurrentTextTrack.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::currentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationCF::currentTextTrack):
(WebCore::AVFWrapper::setCurrentTextTrack):
(WebCore::AVFWrapper::AVFWrapper):
(WebCore::AVFWrapper::processCue):
(WebCore::AVFWrapper::currentTrack): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Deleted.
(WebCore::AVFWrapper::setCurrentTrack): Deleted.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): currentTrack -> currentTextTrack
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): currentTrack -> currentTextTrack.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): New.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): m_currentTrack -> m_currentTextTrack.
(WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): Renamed from setCurrentTextTrack.
(WebCore::metadataType): Map an AVFoundation metadata key space to a metadata cue type.
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Process new metadata.
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Deleted.

Create a JSValue representation from an AVMetadataItem.
* platform/mac/SerializedPlatformRepresentationMac.h: Added.
(WebCore::SerializedPlatformRepresentationMac::platformType):
(WebCore::SerializedPlatformRepresentationMac::nativeValue):
* platform/mac/SerializedPlatformRepresentationMac.mm: Added.
(WebCore::SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac):
(WebCore::SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac):
(WebCore::SerializedPlatformRepresentationMac::create):
(WebCore::SerializedPlatformRepresentationMac::data):
(WebCore::SerializedPlatformRepresentationMac::deserialize):
(WebCore::SerializedPlatformRepresentationMac::isEqual):
(WebCore::toSerializedPlatformRepresentationMac):
(WebCore::jsValueWithValueInContext):
(WebCore::jsValueWithDataInContext):
(WebCore::jsValueWithArrayInContext):
(WebCore::jsValueWithDictionaryInContext):
(WebCore::jsValueWithAVMetadataItemInContext):

Source/WebKit/mac:
* Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.

Source/WebKit2:
* Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.

Source/WTF:
* wtf/FeatureDefines.h: Define ENABLE_DATACUE_VALUE.

LayoutTests:
* http/tests/media/resources/hls: Added.
* http/tests/media/resources/hls/metadata: Added.
* http/tests/media/resources/hls/metadata/fileSequence0.ts: Added.
* http/tests/media/resources/hls/metadata/fileSequence1.ts: Added.
* http/tests/media/resources/hls/metadata/fileSequence2.ts: Added.
* http/tests/media/resources/hls/metadata/fileSequence3.ts: Added.
* http/tests/media/resources/hls/metadata/prog_index.m3u8: Added.
* http/tests/media/track-in-band-hls-metadata-expected.txt: Added.
* http/tests/media/track-in-band-hls-metadata.html: Added.
* media/track/track-datacue-value-expected.txt: Added.
* media/track/track-datacue-value.html: Added.
* platform/efl/TestExpectations: Skip the new tests.
* platform/gtk/TestExpectations: Ditto.
* platform/mac/js/dom/global-constructors-attributes-expected.txt: Update.
* platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt: Update.
* platform/mac/TestExpectations: Skip DataCue test on all Mac versions. Skip HLS test on
    Mountain Lion.
* platform/win/TestExpectations: Skip the new tests.

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

6 years agoAdd Element.matches, the standard name for webkitMatchesSelector
benjamin@webkit.org [Mon, 21 Apr 2014 22:25:42 +0000 (22:25 +0000)]
Add Element.matches, the standard name for webkitMatchesSelector
https://bugs.webkit.org/show_bug.cgi?id=131922

Reviewed by Andreas Kling.

Source/WebCore:
This patch just renames webkitMatchesSelector() to matches().

* bindings/scripts/CodeGeneratorObjC.pm:
(GenerateImplementation):
The Objective-C binding generator only supported ImplementedAs for getters and setters.
This adds support for the option so that Element.matches can be generated for Obj-C.

* dom/Element.cpp:
(WebCore::Element::matches):
(WebCore::Element::webkitMatchesSelector): Deleted.
* dom/Element.h:
* dom/Element.idl:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):

LayoutTests:
Update the tests to verify both Element.matches and Element.webkitMatchesSelector

* fast/dom/SelectorAPI/attrname-case-insensitive-expected.txt:
* fast/dom/SelectorAPI/attrname-case-insensitive.html:
* fast/dom/SelectorAPI/attrname-case-sensitive-expected.txt:
* fast/dom/SelectorAPI/attrname-case-sensitive.xhtml:
* fast/dom/SelectorAPI/caseID-almost-strict-expected.txt:
* fast/dom/SelectorAPI/caseID-almost-strict.html:
* fast/dom/SelectorAPI/caseID-expected.txt:
* fast/dom/SelectorAPI/caseID-strict-expected.txt:
* fast/dom/SelectorAPI/caseID-strict.html:
* fast/dom/SelectorAPI/caseID.html:
* fast/dom/SelectorAPI/caseTag-expected.txt:
* fast/dom/SelectorAPI/caseTag.html:
* fast/dom/SelectorAPI/caseTagX-expected.txt:
* fast/dom/SelectorAPI/caseTagX.xhtml:
* fast/dom/SelectorAPI/detached-element-expected.txt:
* fast/dom/SelectorAPI/not-supported-namespace-in-selector-expected.txt:
* fast/dom/SelectorAPI/not-supported-namespace-in-selector.html:
* fast/dom/SelectorAPI/script-tests/detached-element.js:
* fast/dom/SelectorAPI/script-tests/undefined-null-stringify.js:
* fast/dom/SelectorAPI/script-tests/viewless-document.js:
* fast/dom/SelectorAPI/undefined-null-stringify-expected.txt:
* fast/dom/SelectorAPI/viewless-document-expected.txt:
* fast/forms/radio/radio-live-validation-style-expected.txt:
* fast/forms/radio/radio-live-validation-style.html:
* fast/harness/results.html:

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

6 years agotopContentInset does not play well with fullscreen elements
bdakin@apple.com [Mon, 21 Apr 2014 22:22:35 +0000 (22:22 +0000)]
topContentInset does not play well with fullscreen elements
https://bugs.webkit.org/show_bug.cgi?id=131955
-and corresponding-
<rdar://problem/16651925>

Reviewed by Sam Weinig.

Source/WebCore:
Calling setNeedsLayout() is not sufficient when the topContentInset has changed
dynamically. We need to perform the layout right away and update the scrollbars.
This works completely when the inset changes due to entering/exiting fullscreen,
but I left a FIXME behind because it is possible to change the inset dynamically
just through the WK2 API and end up in a situation where everything looks right
except for the scrollbars.
* page/FrameView.cpp:
(WebCore::FrameView::topContentInsetDidChange):
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::setTopContentInset):

Source/WebKit2:
If you take an element (such as a <video>) fullscreen when you have a
topContentInset set, there will be an inset-sized gap at the top of the fullscreen
video.

Save and restore the topContentInset whenever the scroll position is saved and
restored.
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::WebFullScreenManager):
(WebKit::WebFullScreenManager::saveScrollPosition):
(WebKit::WebFullScreenManager::restoreScrollPosition):
* WebProcess/FullScreen/WebFullScreenManager.h:

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

6 years agoEmpty RenderInline objects should not be line break objects.
jhoneycutt@apple.com [Mon, 21 Apr 2014 21:45:35 +0000 (21:45 +0000)]
Empty RenderInline objects should not be line break objects.

https://bugs.webkit.org/show_bug.cgi?id=131861
<rdar://problem/15663617>

Reviewed by David Hyatt.

.:
* ManualTests/empty-inline-as-line-break-position.html: Added.
This issue wouldn't reproduce in WebKitTestRunner.

Source/WebCore:
* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::canBreakAtThisPosition):
Don't break at this position if this is an empty RenderInline.

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

6 years agoAttempt to fix the tests.
weinig@apple.com [Mon, 21 Apr 2014 21:44:34 +0000 (21:44 +0000)]
Attempt to fix the tests.

* TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm:
(-[DidFailProvisionalNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
Add policy handler to override the new default of denying loads that NSURLConnection cannot handle.

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

6 years agoDon't use ProcessAssertion on simulator
barraclough@apple.com [Mon, 21 Apr 2014 21:33:50 +0000 (21:33 +0000)]
Don't use ProcessAssertion on simulator
https://bugs.webkit.org/show_bug.cgi?id=131950

Rubber stamped by Enrica Casucci

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService):
* UIProcess/ios/ProcessAssertion.h:

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

6 years ago[iOS WebKit2] support replacements for misspelled words.
enrica@apple.com [Mon, 21 Apr 2014 21:14:30 +0000 (21:14 +0000)]
[iOS WebKit2] support replacements for misspelled words.
https://bugs.webkit.org/show_bug.cgi?id=131827
<rdar://problem/16319657>

Reviewed by Darin Adler.

Source/WebCore:
Adds utility function to return the character before the current selection
and converts the nbsp to the space character.

* WebCore.exp.in:
* editing/VisibleUnits.cpp:
(WebCore::characterBeforePosition):
* editing/VisibleUnits.h:

Source/WebKit2:
This is the second a final piece to support replacements.
It adds some entrypoints used by the keyboard code to perform
replacement when reaching the edge of a word using backspace.
I've modified the behavior of replaceSelectedText to work both
with caret or range selections.

* Shared/EditorState.cpp:
(WebKit::EditorState::encode):
(WebKit::EditorState::decode):
* Shared/EditorState.h:
(WebKit::EditorState::EditorState):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView isReplaceAllowed]):
(-[WKContentView _characterBeforeCaretSelection]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::replaceSelectedText):

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

6 years ago[iOS] enable plug-in replacement
eric.carlson@apple.com [Mon, 21 Apr 2014 21:06:57 +0000 (21:06 +0000)]
[iOS] enable plug-in replacement
https://bugs.webkit.org/show_bug.cgi?id=131947

Reviewed by Jer Noble.

* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): initialize m_isPluginReplacementEnabled
    to true on iOS.

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

6 years agoDon't use ProcessAssertion on simulator
barraclough@apple.com [Mon, 21 Apr 2014 21:00:49 +0000 (21:00 +0000)]
Don't use ProcessAssertion on simulator
https://bugs.webkit.org/show_bug.cgi?id=131950

Rubber stamped by Benjamin Poulain

* UIProcess/ios/ProcessAssertion.mm:
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAssertion::setState):

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

6 years agoAnother build fix.
andersca@apple.com [Mon, 21 Apr 2014 20:44:59 +0000 (20:44 +0000)]
Another build fix.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::checkEntitlements):

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

6 years ago[CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
cabanier@adobe.com [Mon, 21 Apr 2014 20:44:01 +0000 (20:44 +0000)]
[CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
https://bugs.webkit.org/show_bug.cgi?id=131824

Reviewed by Dean Jackson.

Source/WebCore:
Removed support for non-separable blend modes from the CSS parser.

Covered by existing tests

* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
(PlatformCAFilters::setBlendingFiltersOnLayer):

LayoutTests:
Removed or updated tests that used non-separable blend modes in combination
with mix-blend-mode.

* css3/compositing/blend-mode-property-expected.txt:
* css3/compositing/blend-mode-property-parsing-expected.txt:
* css3/compositing/blend-mode-simple-composited.html:
* css3/compositing/blend-mode-simple.html:
* css3/compositing/script-tests/blend-mode-property-parsing.js:
* css3/compositing/script-tests/blend-mode-property.js:
* css3/compositing/svg-blend-color.html: Removed.
* css3/compositing/svg-blend-hue.html: Removed.
* css3/compositing/svg-blend-luminosity.html: Removed.
* css3/compositing/svg-blend-saturation.html: Removed.
* platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt:
* platform/mac/css3/compositing/blend-mode-simple-expected.txt:

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

6 years ago[New Multicolumn] vertical-rl/unsplittable-inline-block misrenders the column rule.
hyatt@apple.com [Mon, 21 Apr 2014 20:39:33 +0000 (20:39 +0000)]
[New Multicolumn] vertical-rl/unsplittable-inline-block misrenders the column rule.
https://bugs.webkit.org/show_bug.cgi?id=131818

Reviewed by Anders Carlsson.

Patch the test to be column-fill:auto, since the other versions
of the test all had that specified already.

* fast/multicol/vertical-rl/unsplittable-inline-block.html:

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

6 years agoBuild fix.
andersca@apple.com [Mon, 21 Apr 2014 20:35:25 +0000 (20:35 +0000)]
Build fix.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):

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

6 years ago[New Multicolumn] Column set drawing under horizontal scrollbar.
hyatt@apple.com [Mon, 21 Apr 2014 20:20:27 +0000 (20:20 +0000)]
[New Multicolumn] Column set drawing under horizontal scrollbar.
https://bugs.webkit.org/show_bug.cgi?id=131812.

Reviewed by Sam Weinig.

Source/WebCore:
Added fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb.html.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
* rendering/RenderBlockFlow.h:
Pass in relayoutChildren as a reference boolean to checkForPaginationLogicalHeightChange.
The new columns need to be able to set it to true if the amount of available column
height ever changes, so that the RenderFlowThread and the sets get a layout call.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setColumnStylesFromPaginationMode):
Make sure that the pagination mode is set up with an auto column-fill specified. You
don't ever want to balance when you set a pagination mode on the RenderView.

LayoutTests:
* fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb-expected.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb.html: Added.

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

6 years ago[iOS WebKit2] Implement CSS viewport units
timothy_horton@apple.com [Mon, 21 Apr 2014 20:16:50 +0000 (20:16 +0000)]
[iOS WebKit2] Implement CSS viewport units
https://bugs.webkit.org/show_bug.cgi?id=131863
<rdar://problem/16279088>

Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKWebView.mm:
(setMinimumLayoutSizeForMinimalUI):
(-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
(-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
Add _setMinimumLayoutSizeOverrideForMinimalUI:, which pushes said size
down from the client to WebPageIOS, below.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
(WebKit::WebPage::viewportConfigurationChanged):
Update FrameView's viewport size based on the minimum layout size for minimal UI (if we have it)
or the normal minimum layout size, scaled to the page's initial scale.

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::setViewportSize):
* page/FrameView.h:
(WebCore::FrameView::viewportSize):
Add setViewportSize() and viewportSize().
If the viewport size changes, we have to do style recalc.
If we have an overridden viewport size, use it.

* rendering/RenderView.cpp:
(WebCore::RenderView::viewportSize):
* rendering/RenderView.h:
Get the size from FrameView.

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

6 years ago[iOS][WK2] Fix the dynamic viewport update when the viewport's max-scale conflict...
benjamin@webkit.org [Mon, 21 Apr 2014 20:14:05 +0000 (20:14 +0000)]
[iOS][WK2] Fix the dynamic viewport update when the viewport's max-scale conflict with the transition
https://bugs.webkit.org/show_bug.cgi?id=131884

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

<rdar://problem/16667291>

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
It is fairly common to have a viewport configuration with min-scale=1 and max-scale=1.
Since we were only changing the minimumScale for the transition, the target scale was affected
by max-scale. This was breaking the transition from portrait to landscale.

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

6 years ago[iOS][WK2] Make dynamic viewport size update content aware
benjamin@webkit.org [Mon, 21 Apr 2014 20:10:12 +0000 (20:10 +0000)]
[iOS][WK2] Make dynamic viewport size update content aware
https://bugs.webkit.org/show_bug.cgi?id=131874

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-04-21
Reviewed by Tim Horton.

When possible, adjust the scroll position based on the content on dynamic viewport resize.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::scalePage):
(WebKit::WebPage::pageDidScroll):
* WebProcess/WebPage/WebPage.h:
The scrolling heuristic are not invertible, especially the content heuristic. To have the right
behavior when doing resize without changing the page, we save the old scroll position and restore
it when the content size and scale is restored.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
On dynamic update, start by finding what node is at the center of the screen. After the layout, put that
node back in the center.

(WebKit::WebPage::updateVisibleContentRects):

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

6 years agoSource/JavaScriptCore: Unreviewed test gardening, run the repeat-out-of-bounds tests...
fpizlo@apple.com [Mon, 21 Apr 2014 19:53:55 +0000 (19:53 +0000)]
Source/JavaScriptCore: Unreviewed test gardening, run the repeat-out-of-bounds tests again.

* tests/stress/float32-repeat-out-of-bounds.js:
* tests/stress/int8-repeat-out-of-bounds.js:

Tools: Unreviewed test gardening, make no-eager runs run everything except eager (as opposed to
being the same as a "quick run", which is meant for genuinely slow tests).

* Scripts/run-jsc-stress-tests:

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

6 years agoOSR exit should know about Int52 and Double constants
fpizlo@apple.com [Mon, 21 Apr 2014 19:51:54 +0000 (19:51 +0000)]
OSR exit should know about Int52 and Double constants
https://bugs.webkit.org/show_bug.cgi?id=131945

Reviewed by Oliver Hunt.

The DFG OSR exit machinery's ignorance would lead to some constants becoming
jsUndefined() after OSR exit.

The FTL OSR exit machinery's ignorance just meant that we would sometimes use a
stackmap constant rather than baking the constant into the OSRExit data structure.
So, not a big deal, but worth fixing.

Also added some helpful hacks to jsc.cpp for testing such OSR exit pathologies.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsic):
* dfg/DFGMinifiedNode.h:
(JSC::DFG::belongsInMinifiedGraph):
(JSC::DFG::MinifiedNode::hasConstantNumber):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::tryToSetConstantExitArgument):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionOtherFalse):
(functionUndefined):
* runtime/Intrinsic.h:
* tests/stress/fold-to-double-constant-then-exit.js: Added.
(foo):
* tests/stress/fold-to-int52-constant-then-exit.js: Added.
(foo):

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

6 years agoNeed default WKNavigationDelegate behavior
andersca@apple.com [Mon, 21 Apr 2014 19:51:01 +0000 (19:51 +0000)]
Need default WKNavigationDelegate behavior
https://bugs.webkit.org/show_bug.cgi?id=131944
<rdar://problem/15949822>

Reviewed by Dan Bernstein.

Port the WebKit1 default delegate behavior over.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::PolicyClient::decidePolicyForResponse):

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

6 years ago[Cocoa] Expose WebPage::setDefersLoading
mitz@apple.com [Mon, 21 Apr 2014 19:49:00 +0000 (19:49 +0000)]
[Cocoa] Expose WebPage::setDefersLoading
https://bugs.webkit.org/show_bug.cgi?id=131943

Reviewed by Anders Carlsson, but he doesn’t like this.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _defersLoading]): Added this accessor.
(-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
Declared new property _defersLoading.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::defersLoading): Added this getter.
* WebProcess/WebPage/WebPage.h:

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

6 years agoRemove unused WebKitSystemInterface functions
commit-queue@webkit.org [Mon, 21 Apr 2014 19:48:12 +0000 (19:48 +0000)]
Remove unused WebKitSystemInterface functions
https://bugs.webkit.org/show_bug.cgi?id=131938

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

Source/WebCore:
* WebCore.exp.in:
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac:
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

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

6 years agoProvide feedback when we encounter an unrecognied node in the FTL backend.
fpizlo@apple.com [Mon, 21 Apr 2014 19:41:34 +0000 (19:41 +0000)]
Provide feedback when we encounter an unrecognied node in the FTL backend.

Rubber stamped by Alexey Proskuryakov.

* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):

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

6 years agoUpdate results of fast/images/image-controls-basic.html
ap@apple.com [Mon, 21 Apr 2014 19:37:43 +0000 (19:37 +0000)]
Update results of fast/images/image-controls-basic.html

* platform/mac/TestExpectations:
* platform/mac/fast/images/image-controls-basic-expected.png:
* platform/mac/fast/images/image-controls-basic-expected.txt:

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

6 years ago[New Multicolumn] Add test case for shrink-to-column-height now that
hyatt@apple.com [Mon, 21 Apr 2014 19:17:43 +0000 (19:17 +0000)]
[New Multicolumn] Add test case for shrink-to-column-height now that
it passes in the new impl.
https://bugs.webkit.org/show_bug.cgi?id=131814

Reviewed by Dean Jackson.

* fast/multicol/newmulticol/compare-with-old-impl/shrink-to-column-height-for-pagination-expected.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/shrink-to-column-height-for-pagination.html: Added.

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

6 years agoMove the JSString cache from DOMWrapperWorld to VM.
akling@apple.com [Mon, 21 Apr 2014 19:17:14 +0000 (19:17 +0000)]
Move the JSString cache from DOMWrapperWorld to VM.
<https://webkit.org/b/131940>

Source/JavaScriptCore:
Reviewed by Geoff Garen.

* runtime/VM.h:

Source/WebCore:
Since there's no need for JSStrings to be world-specific, this patch
moves the string cache to JSC::VM. This makes jsStringWithCache()
a lot faster since it no longer has to jump through twenty-eleven
hoops to find the DOMWrapperWorld.

Reviewed by Geoff Garen.

* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::clearWrappers):
* bindings/js/DOMWrapperWorld.h:
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringWithCache):

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

6 years ago[GTK] Unreviewed GTK gardening
commit-queue@webkit.org [Mon, 21 Apr 2014 19:15:17 +0000 (19:15 +0000)]
[GTK] Unreviewed GTK gardening

Update gtk/TestExpectations and rebaseline some gtk test results.

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-04-21

* platform/gtk/TestExpectations: Mark fast/repaint/hidpi-wrong-repaint-rect-when-parent-has-noncompositing-transform.html
as failure and fast/dom/Window/mozilla-focus-blur.html as flaky.
* platform/gtk/fast/multicol/newmulticol/client-rects-expected.txt: Rebaseline after r167335.
* platform/gtk/fast/repaint/reflection-redraw-expected.txt: Rebaseline after r167568.
* platform/gtk/fast/table/dynamic-caption-add-remove-before-child-expected.txt: Rebaseline after r167568.
* platform/gtk/fast/table/multiple-captions-display-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla/marvin/body_col-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla/marvin/x_th_valign_baseline-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla/other/body_col-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla_expected_failures/bugs/bug10140-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla_expected_failures/bugs/bug10216-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla_expected_failures/core/captions3-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla_expected_failures/other/test4-expected.txt: Rebaseline after r167568.
* platform/gtk/fast/repaint/spanner-with-margin-expected.txt: Added. Rebaseline after r167439.

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

6 years agoCheck the com.apple.security.network.client entitlement for all processes
andersca@apple.com [Mon, 21 Apr 2014 19:10:33 +0000 (19:10 +0000)]
Check the com.apple.security.network.client entitlement for all processes
https://bugs.webkit.org/show_bug.cgi?id=131942
<rdar://problem/12354188>

Reviewed by Dan Bernstein.

* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
(WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::checkEntitlements):

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

6 years agoSource/WebCore: [New Multicolumn] Column balancing is slow on float-multicol.html
hyatt@apple.com [Mon, 21 Apr 2014 19:05:23 +0000 (19:05 +0000)]
Source/WebCore: [New Multicolumn] Column balancing is slow on float-multicol.html
https://bugs.webkit.org/show_bug.cgi?id=131801

Reviewed by Enrica Casucci.

Added fast/multicol/tall-float.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
Make RenderFlowThreads expand to encompass floats. Also from Morten's patch for
Blink (#361551).

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeOverflow):
Fix a bug where the new multi-column code was adding in overflow for floats
when it should not. This was resulting in the creation of scrollbars when none
should exist. This is my own addition.

(WebCore::RenderBlockFlow::addOverhangingFloats):
Make RenderFlowThreads and RenderRegions ignore overhanging float additions. This
comes from Morten's patch for Blink (#361551).

LayoutTests: http/tests/cache/subresource-failover-to-network.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=131936

Patch by Alexey Proskuryakov <ap@apple.com> on 2014-04-21
Reviewed by Brady Eidson.

The test was racy, because it was unintentionally queuing TestRunner operations
twice. Also, it failed to clean up its cookie.

Rewrote to not use TestRunner queuing, making the test work in browser.

* http/tests/cache/resources/subresource-failover-to-network.cgi:
* http/tests/cache/subresource-failover-to-network.html:

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

6 years agohttp/tests/cache/subresource-failover-to-network.html is flaky
ap@apple.com [Mon, 21 Apr 2014 18:55:14 +0000 (18:55 +0000)]
http/tests/cache/subresource-failover-to-network.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=131936

Reviewed by Brady Eidson.

The test was racy, because it was unintentionally queuing TestRunner operations
twice. Also, it failed to clean up its cookie.

Rewrote to not use TestRunner queuing, making the test work in browser.

* http/tests/cache/resources/subresource-failover-to-network.cgi:
* http/tests/cache/subresource-failover-to-network.html:

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

6 years agoTake block execution count estimates into account when voting double
fpizlo@apple.com [Mon, 21 Apr 2014 18:43:01 +0000 (18:43 +0000)]
Take block execution count estimates into account when voting double
https://bugs.webkit.org/show_bug.cgi?id=131906

Reviewed by Geoffrey Garen.

This was a drama in three acts.

Act I: Slurp in BasicBlock::executionCount and use it as a weight when counting the
    number of uses of a variable that want double or non-double. Easy as pie. This
    gave me a huge speed-up on FloatMM and a huge slow-down on basically everything
    else.

Act II: Realize that there were some programs where our previous double voting was
    just on the edge of disaster and making it more precise tipped it over. In
    particular, if you had an integer variable that would infrequently be used in a
    computation that resulted in a variable that was frequently used as an array index,
    the outer infrequentness would be the thing we'd use in the vote. So, an array
    index would become double. We fix this by reviving global backwards propagation
    and introducing the concept of ReallyWantsInt, which is used just for array
    indices. Any variable transitively flagged as ReallyWantsInt will never be forced
    double. We need that flag to be separate from UsedAsInt, since UsedAsInt needs to
    be set in bitops for RageConversion but using it for double forcing is too much.
    Basically, it's cheaper to have to convert a double to an int for a bitop than it
    is to convert a double to an int for an array index; also a variable being used as
    an array index is a much stronger hint that it ought to be an int. This recovered
    performance on everything except programs that used FTL OSR entry.

Act III: Realize that OSR entrypoint creation creates blocks that have NaN execution
    count, which then completely pollutes the weighting - essentially all votes go
    NaN. Fix this with some surgical defenses. Basically, any client of execution
    counts should allow for them to be NaN and shouldn't completely fall off a cliff
    when it happens.

This is awesome. 75% speed-up on FloatMM. 11% speed-up on audio-dft. This leads to
7% speed-up on AsmBench and 2% speed-up on Kraken.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::run):
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::voteNode):
(JSC::DFG::Graph::voteChildren):
* dfg/DFGNodeFlags.cpp:
(JSC::DFG::dumpNodeFlags):
* dfg/DFGNodeFlags.h:
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::doDoubleVoting):
(JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
* dfg/DFGVariableAccessData.cpp: Added.
(JSC::DFG::VariableAccessData::VariableAccessData):
(JSC::DFG::VariableAccessData::mergeIsCaptured):
(JSC::DFG::VariableAccessData::mergeShouldNeverUnbox):
(JSC::DFG::VariableAccessData::predict):
(JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction):
(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
(JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat):
(JSC::DFG::VariableAccessData::mergeDoubleFormatState):
(JSC::DFG::VariableAccessData::makePredictionForDoubleFormat):
(JSC::DFG::VariableAccessData::flushFormat):
* dfg/DFGVariableAccessData.h:
(JSC::DFG::VariableAccessData::vote):
(JSC::DFG::VariableAccessData::VariableAccessData): Deleted.
(JSC::DFG::VariableAccessData::mergeIsCaptured): Deleted.
(JSC::DFG::VariableAccessData::mergeShouldNeverUnbox): Deleted.
(JSC::DFG::VariableAccessData::predict): Deleted.
(JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction): Deleted.
(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote): Deleted.
(JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat): Deleted.
(JSC::DFG::VariableAccessData::mergeDoubleFormatState): Deleted.
(JSC::DFG::VariableAccessData::makePredictionForDoubleFormat): Deleted.
(JSC::DFG::VariableAccessData::flushFormat): Deleted.

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

6 years agoREGRESSION(r167591): ARM64 and ARM traditional builds broken
msaboff@apple.com [Mon, 21 Apr 2014 18:10:41 +0000 (18:10 +0000)]
REGRESSION(r167591): ARM64 and ARM traditional builds broken
https://bugs.webkit.org/show_bug.cgi?id=131935

Reviewed by Mark Hahnenberg.

Added store8(TrustedImm32, MacroAssembler::Address) to the ARM traditional and ARM64
macro assemblers.  Added a new test for the original patch.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::store8):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::store8):
* tests/stress/dfg-create-arguments-inline-alloc.js: New test.

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