WebKit.git
2 years agoSimple line layout: Small tweaks to improve performance.
zalan@apple.com [Tue, 31 Jan 2017 00:17:04 +0000 (00:17 +0000)]
Simple line layout: Small tweaks to improve performance.
https://bugs.webkit.org/show_bug.cgi?id=167611
<rdar://problem/30274294>

Reviewed by Simon Fraser.

PerformanceTests:

* Layout/simple-line-layout-non-repeating-text.html: Added.

Source/WebCore:

This is ~10% progression on the attached test case (paragraphs with non-redundant content).
median: 102.08 runs/s -> median: 114.25 runs/s

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::initializeSegments):
(WebCore::SimpleLineLayout::FlowContents::FlowContents):
* rendering/SimpleLineLayoutFlowContents.h:
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
* rendering/SimpleLineLayoutTextFragmentIterator.h:

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

2 years agoDrop legacy constants on Event interface
cdumez@apple.com [Tue, 31 Jan 2017 00:11:49 +0000 (00:11 +0000)]
Drop legacy constants on Event interface
https://bugs.webkit.org/show_bug.cgi?id=167602

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/dom/historical-expected.txt:

Source/WebCore:

Drop legacy constants on Event interface:
MOUSEDOWN, MOUSEUP, MOUSEOVER, MOUSEOUT, MOUSEMOVE, MOUSEDRAG,
CLICK, DBLCLICK, KEYDOWN, KEYUP, KEYPRESS, DRAGDROP, FOCUS,
BLUR, SELECT, and CHANGE.

Those constants are not used for anything, they are not in the
specification and Chrome / Firefox do not have them.

No new tests, rebaselined existing test.

* dom/Event.idl:

LayoutTests:

Update / Rebaseline existing tests to stop covering those constants.

* fast/dom/constants-expected.txt:
* fast/dom/constants.html:
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/workers/worker-importScriptsOnError-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:

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

2 years ago[WebRTC] Upload a diff of WebKit libwebrtc code and original libwebrtc code
commit-queue@webkit.org [Tue, 31 Jan 2017 00:06:48 +0000 (00:06 +0000)]
[WebRTC] Upload a diff of WebKit libwebrtc code and original libwebrtc code
https://bugs.webkit.org/show_bug.cgi?id=167573

Patch by Youenn Fablet <youennf@gmail.com> on 2017-01-30
Reviewed by Alex Christensen.

* WebKit/patch-libwebrtc: Added.

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

2 years agoAdd some more crash reporter information to diagnose a failed mach_msg
andersca@apple.com [Mon, 30 Jan 2017 23:37:57 +0000 (23:37 +0000)]
Add some more crash reporter information to diagnose a failed mach_msg
https://bugs.webkit.org/show_bug.cgi?id=167610

Reviewed by Dean Jackson.

Include the receive port name as well.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::readFromMachPort):

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

2 years agoQueueStatusServer should have an explicit timeout for _fetch_url
aakash_jain@apple.com [Mon, 30 Jan 2017 23:21:57 +0000 (23:21 +0000)]
QueueStatusServer should have an explicit timeout for _fetch_url
https://bugs.webkit.org/show_bug.cgi?id=167467

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/statusserver.py:
(StatusServer._fetch_url): Add an explicit timeout of 300s.

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

2 years agoAdd support for Trac instances that host multiple projects.
commit-queue@webkit.org [Mon, 30 Jan 2017 23:03:27 +0000 (23:03 +0000)]
Add support for Trac instances that host multiple projects.
https://bugs.webkit.org/show_bug.cgi?id=167524

Patch by Kocsen Chung <kocsen_chung@apple.com> on 2017-01-30
Reviewed by Alexey Proskuryakov.

When multiple projects are hosted on a single Trac instance, the current
behavior will retrieve changesets from all tracked projects.
This patch teaches Trac.js to get project-specific changesets from Trac.
We do this by replacing the parameter `changeset=on` to `repo-projectname=on`
when querying the Trac timeline.

To tell Trac to be aware of multi-project instances we leverage the
`options` parameter when creating a new instance:

    new Trac("https://mytrac.com/", { projectIdentifier: "tracProjectName" });

If this option is not provided, the original behaviour will prevail.
Additionally, add corresponding tests.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
(Trac): Reason about new optional parameter 'projectIdentifier'.
(Trac.prototype.revisionURL): Given a projectIdentifier, append it to the end of the URL.
(Trac.prototype._xmlTimelineURL): Given a projectIdentifier,
replace default parameter `changeset=on` with `repo-projectname=on`.
(Trac.prototype._convertCommitInfoElementToObject): Fix missing ';'.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js:
(MockTrac): Add support for instantiating Trac with a projectIdentifier.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js:
(setup): Provide a multiple-project MockTrac instance to all test cases for testing.
Add the following tests:
    test("revisionURL")
    test("revisionURL with Trac Identifier")
    test("_xmlTimelineURL")
    test("_xmlTimelineURL with Trac Identifier")
(this.view._latestProductiveIteration): Fix missing ';'.

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

2 years ago[iOS] position:fixed inside touch-scrollable overflow is mispositioned
simon.fraser@apple.com [Mon, 30 Jan 2017 22:51:52 +0000 (22:51 +0000)]
[iOS] position:fixed inside touch-scrollable overflow is mispositioned
https://bugs.webkit.org/show_bug.cgi?id=167604
Source/WebCore:

rdar://problem/29500273

Reviewed by Zalan Bujtas.

For layers inside touch-scrollable overflow, RenderLayerBacking::computeParentGraphicsLayerRect() needs
to account for the offset from the ancestor compositing layer's origin, to handle scrollable elements with
box-shadow, for example.

Also make the compositing log output a little easier to read.

Test: compositing/scrolling/fixed-inside-scroll.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):

Source/WebKit2:

rdar://problem/29500273

Reviewed by Zalan Bujtas.

Make sure we tell m_webPageProxy.computeCustomFixedPositionRect() when visual viewports are enabled.

* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):

LayoutTests:

Reviewed by Zalan Bujtas.

* compositing/scrolling/fixed-inside-scroll-expected.html: Added.
* compositing/scrolling/fixed-inside-scroll.html: Added.

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

2 years agoNULL-deref crash at PlatformMediaSession::endInterruption
jer.noble@apple.com [Mon, 30 Jan 2017 22:09:01 +0000 (22:09 +0000)]
NULL-deref crash at PlatformMediaSession::endInterruption
https://bugs.webkit.org/show_bug.cgi?id=167595

Reviewed by Eric Carlson.

Use the same, NULL-aware forEachSession() iterator rather than iterating over m_sessions directly.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::beginInterruption):
(WebCore::PlatformMediaSessionManager::endInterruption):

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

2 years agoWeb Inspector: Need some limit on Async Call Stacks for async loops (rAF loops)
mattbaker@apple.com [Mon, 30 Jan 2017 22:01:07 +0000 (22:01 +0000)]
Web Inspector: Need some limit on Async Call Stacks for async loops (rAF loops)
https://bugs.webkit.org/show_bug.cgi?id=165633
<rdar://problem/29738502>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

This patch limits the memory used by the Inspector backend to store async
stack trace data.

Asynchronous stack traces are stored as a disjoint set of parent pointer
trees. Tree nodes represent asynchronous operations, and hold a copy of
the stack trace at the time the operation was scheduled. Each tree can
be regarded as a set of stack traces, stored as singly linked lists that
share part of their structure (specifically their tails). Traces belonging
to the same tree will at least share a common root. A stack trace begins
at a leaf node and follows the chain of parent pointers to the root of
of the tree. Leaf nodes always contain pending asynchronous calls.

When an asynchronous operation is scheduled with requestAnimationFrame,
setInterval, etc, a node is created containing the current call stack and
some bookkeeping data for the operation. An unique identifier comprised
of an operation type and callback identifier is mapped to the node. If
scheduling the callback was itself the result of an asynchronous call,
the node becomes a child of the node associated with that call, otherwise
it becomes the root of a new tree.

A node is either `pending`, `active`, `dispatched`, or `canceled`. Nodes
start out as pending. After a callback for a pending node is dispatched
the node is marked as such, unless it is a repeating callback such as
setInterval, in which case it remains pending. Once a node is no longer
pending it is removed, as long as it has no children. Since nodes are
reference counted, it is a property of the stack trace tree that nodes
that are no longer pending and have no children pointing to them will be
automatically pruned from the tree.

If an async operation is canceled (e.g. cancelTimeout), the associated
node is marked as such. If the callback is not being dispatched at the
time, and has no children, it is removed.

Because async operations can be chained indefinitely, stack traces are
limited to a maximum depth. The depth of a stack trace is equal to the
sum of the depths of its nodes, with a node's depth equal to the number
of frames in its associated call stack. For any stack trace,

    S = { s𝟶, s𝟷, …, s𝑘 }, with endpoints s𝟶, s𝑘
    depth(S) = depth(s𝟶) + depth(s𝟷) + … + depth(s𝑘)

A stack trace is truncated when it exceeds the maximum depth. Truncation
occurs on node boundaries, not call frames, consequently the maximum depth
is more of a target than a guarantee:

    d = maximum stack trace depth
    for all S, depth(S) ≤ d + depth(s𝑘)

Because nodes can belong to multiple stack traces, it may be necessary
to clone the tail of a stack trace being truncated to prevent other traces
from being effected.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/AsyncStackTrace.cpp: Added.
(Inspector::AsyncStackTrace::create):
(Inspector::AsyncStackTrace::AsyncStackTrace):
(Inspector::AsyncStackTrace::~AsyncStackTrace):
(Inspector::AsyncStackTrace::isPending):
(Inspector::AsyncStackTrace::isLocked):
(Inspector::AsyncStackTrace::willDispatchAsyncCall):
(Inspector::AsyncStackTrace::didDispatchAsyncCall):
(Inspector::AsyncStackTrace::didCancelAsyncCall):
(Inspector::AsyncStackTrace::buildInspectorObject):
(Inspector::AsyncStackTrace::truncate):
(Inspector::AsyncStackTrace::remove):
* inspector/AsyncStackTrace.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::didScheduleAsyncCall):
(Inspector::InspectorDebuggerAgent::didCancelAsyncCall):
(Inspector::InspectorDebuggerAgent::willDispatchAsyncCall):
(Inspector::InspectorDebuggerAgent::didDispatchAsyncCall):
(Inspector::InspectorDebuggerAgent::didPause):
(Inspector::InspectorDebuggerAgent::clearAsyncStackTraceData):
(Inspector::InspectorDebuggerAgent::buildAsyncStackTrace): Deleted.
(Inspector::InspectorDebuggerAgent::refAsyncCallData): Deleted.
(Inspector::InspectorDebuggerAgent::derefAsyncCallData): Deleted.
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/protocol/Console.json:

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
Text for "Truncated" marker tree element.

* UserInterface/Models/StackTrace.js:
(WebInspector.StackTrace):
(WebInspector.StackTrace.fromPayload):
(WebInspector.StackTrace.prototype.get truncated):
Plumbing for new Console.StackTrace property `truncated`.

* UserInterface/Views/ThreadTreeElement.css:
(.tree-outline > .item.thread + ol > .item.truncated-call-frames):
(.tree-outline > .item.thread + ol > .item.truncated-call-frames .icon):
Styles for "Truncated" marker tree element.

* UserInterface/Views/ThreadTreeElement.js:
(WebInspector.ThreadTreeElement.prototype.refresh):
Append "Truncated" marker tree element if necessary.

* Versions/Inspector-iOS-10.3.json:

LayoutTests:

Add truncation test cases and cleanup call frame logging.

* inspector/debugger/async-stack-trace-expected.txt:
* inspector/debugger/async-stack-trace.html:
* inspector/debugger/resources/log-active-stack-trace.js: Added.
(TestPage.registerInitializer.window.getActiveStackTrace):
(TestPage.registerInitializer.logStackTrace.logCallFrame):
(TestPage.registerInitializer.):
(TestPage.registerInitializer.window.logActiveStackTrace):
(TestPage.registerInitializer):

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

2 years agoCorrect spacing regression on inter-element complex path shaping on some fonts
mmaxfield@apple.com [Mon, 30 Jan 2017 20:43:14 +0000 (20:43 +0000)]
Correct spacing regression on inter-element complex path shaping on some fonts
https://bugs.webkit.org/show_bug.cgi?id=166013

Reviewed by Simon Fraser.

Source/WebCore:

This patch brings the implementation of ComplexTextController in-line with the
design at https://trac.webkit.org/wiki/ComplexTextController. Previously,
ComplexTextController had a few problems:
- The total width computed by ComplexTextController didn't match the width if
you iterated over the entire string and added up the advances
- FontCascade::getGlyphsAndAdvancesForComplexText() tried to compensate for
the above by construing the concepts of paint advances as distinct from layout
advances
- Initial advances were considered part of layout sometimes and part of painting
other times, depending on which function reports the information
- For RTL runs, the wrong origin was added to the initial advance, and the origin
should have been subtracted instead of added

This patch exhaustively updates every function in ComplexTextController to be
consistent with the design linked to above. This design solves all of these
problems.

Tests: ComplexTextControllerTest.InitialAdvanceWithLeftRunInRTL
       ComplexTextControllerTest.InitialAdvanceInRTL
       ComplexTextControllerTest.InitialAdvanceWithLeftRunInLTR
       ComplexTextControllerTest.InitialAdvanceInLTR
       ComplexTextControllerTest.InitialAdvanceInRTLNoOrigins
       ComplexTextControllerTest.LeadingExpansion
       ComplexTextControllerTest.VerticalAdvances

* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::setLeadingExpansion): Deleted. No longer necessary.
(WebCore::GlyphBuffer::leadingExpansion): Deleted. Ditto.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::adjustSelectionRectForComplexText): Removed use of
unnecessary leadingExpansion().
(WebCore::FontCascade::getGlyphsAndAdvancesForComplexText): This function needs
to compute paint advances, which means that it can't base this information off
of layout advances. This function uses the trick mentioned at the end of the
above link to compute the paint offset of an arbitrary glyph in the middle of
an RTL run.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::computeExpansionOpportunity): Refactored for
testing.
(WebCore::ComplexTextController::ComplexTextController): Ditto.
(WebCore::ComplexTextController::finishConstruction): Ditto.
(WebCore::ComplexTextController::offsetForPosition): This function operates on
layout advances, and the initial layout advance is already added into the
m_adjustedBaseAdvances vector by adjustGlyphsAndAdvances(). Therefore, there is
no need to add it again here.
(WebCore::ComplexTextController::advance): This function had completely busted
logic about the relationship between initial advances and the first origin in
each run. Because of the fortunate choice of only representing layout advances
in m_adjustedBaseAdvances, this entire block can be removed and the raw paint
initial advance can be reported to the GlyphBuffer. Later in the function, we
have to update the logic about how to compute a paint advance given a layout
advance and some origins. In particular, there are two tricky pieces here: 1.
The layout advance for the first glyph is equal to (initial advance - first
origin + first Core Text advance, so computing the paint offset must cancel out
the initial layout offset, and 2. the last paint advance in a run must actually
end up at the position of the first glyph in the next run, so the next run's
initial advance must be queried.
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Previously, we
represented an initial advance of a successive run by just adding it to the
previous run's last advance. However, this is incompatible with the new model
presented in the link above, so we remove this section. We also have to add in
the logic that the layout advance for the first glyph is equal to the formula
presented above.
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::initialAdvance): Adjust comment
to reflect reality.
(WebCore::ComplexTextController::leadingExpansion): Deleted.

Tools:

Unskip existing tests and make some new tests:
- Testing complex text with no origins
- Testing initial expansions
- Testing the sign of vertical advances

* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::TEST_F):

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

2 years agoUnreviewed, rolling out r211345.
ryanhaddad@apple.com [Mon, 30 Jan 2017 20:08:29 +0000 (20:08 +0000)]
Unreviewed, rolling out r211345.

The LayoutTest for this change is failing an assertion.

Reverted changeset:

"Web Inspector: Need some limit on Async Call Stacks for async
loops (rAF loops)"
https://bugs.webkit.org/show_bug.cgi?id=165633
http://trac.webkit.org/changeset/211345

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

2 years ago[GTK][EFL] Avoid using a thin directory to create the built product on the archive...
clopez@igalia.com [Mon, 30 Jan 2017 20:05:34 +0000 (20:05 +0000)]
[GTK][EFL] Avoid using a thin directory to create the built product on the archive-built-product step.
https://bugs.webkit.org/show_bug.cgi?id=167596

Reviewed by Daniel Bates.

We avoid needing a thin directory by invoking the zip program with
the list of directories from the build directory to be zipped,
and by using the zip feature to exclude files matching a pattern.

* BuildSlaveSupport/built-product-archive:
(copyBuildFiles):
(createZipFromList):
(archiveBuiltProduct):

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

2 years agoFixed elements should not rubber-band in WK2, nor remain at negative offsets
simon.fraser@apple.com [Mon, 30 Jan 2017 19:46:40 +0000 (19:46 +0000)]
Fixed elements should not rubber-band in WK2, nor remain at negative offsets
https://bugs.webkit.org/show_bug.cgi?id=167484
rdar://problem/29453068

Reviewed by Dean Jackson.
Source/WebCore:

There were various problems with the layout rect computation:
1. It ignored the scrollBehaviorForFixedElements() which we use to avoid rubber-banding fixed
   elements in WK2, but allow in WK1, so make use of that.
2. Sometimes layouts/paints of fixed elements would be triggered when coalesced calls to
   AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() failed to
   copy the layoutViewportOrigin to the scheduled update.
3. The layout viewport could be left with a negative top/left after rubber-banding.

Also add a way to do unconstrained scrollTo(), so that a test can call window.scrollTo(-10, -10) to
simulate rubberbanding.

Tests: fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html
       fast/visual-viewport/rubberbanding-viewport-rects.html

* page/FrameView.cpp:
(WebCore::FrameView::computeLayoutViewportOrigin): Handle ScrollBehaviorForFixedElements, incorporating it
into logic that clamps layoutViewportOrigin between min/max when rubberbanding is not allowed, or not in progress.
(WebCore::FrameView::updateLayoutViewport): Pass in scrollBehaviorForFixedElements().
(WebCore::FrameView::visibleDocumentRect): The clamping here was preventing the visible rect from
escaping the document bounds, which caused fixed elements to bounce with rubber-banding, so remove the clamping,
and fix the logic to allow rubber-banding while taking headers and footers into account.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): layoutViewportOrigin has to
be pushed onto the scheduled update, just like scroll position.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition): Pass in m_behaviorForFixed.
* platform/ScrollView.cpp:
(WebCore::ScrollView::ScrollView):
(WebCore::ScrollView::adjustScrollPositionWithinRange):
(WebCore::ScrollView::setScrollOffset):
* platform/ScrollView.h:
(WebCore::ScrollView::setAllowsUnclampedScrollPositionForTesting):
(WebCore::ScrollView::allowsUnclampedScrollPosition):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setAllowUnclampedScrollPosition):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit2:

Pass in StickToViewportBounds as we did before visual viewports.

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

LayoutTests:

Add two tests that use internals.settings.setAllowUnclampedScrollPosition(true) and then
over-scroll to simulator rubber-banding, dumping viewport rects.

setAllowUnclampedScrollPosition() only works in WebKit2, so skip the tests elsewhere.

* TestExpectations:
* fast/visual-viewport/rubberbanding-viewport-rects-expected.txt: Added.
* fast/visual-viewport/rubberbanding-viewport-rects-header-footer-expected.txt: Added.
* fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html: Added.
* fast/visual-viewport/rubberbanding-viewport-rects.html: Added.
* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt: Added.
* platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-header-footer-expected.txt: Added.
* platform/mac-wk2/TestExpectations:

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

2 years agoWeb content process crashes when initiating a drag on a very large image
wenson_hsieh@apple.com [Mon, 30 Jan 2017 18:59:36 +0000 (18:59 +0000)]
Web content process crashes when initiating a drag on a very large image
https://bugs.webkit.org/show_bug.cgi?id=167564

Reviewed by Beth Dakin.

If we begin dragging an image element that is too large to show the cached image for, we will show an image file
icon instead of the cached image. This may return null if createDragImageIconForCachedImageFilename is
unimplemented, so in the meantime, we should not assume that dragImage will always exist before calling into
doSystemDrag in doImageDrag and bail from the drag operation if that is the case.

* page/DragController.cpp:
(WebCore::DragController::doImageDrag):

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

2 years agoUpdate DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value...
cdumez@apple.com [Mon, 30 Jan 2017 18:45:21 +0000 (18:45 +0000)]
Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
https://bugs.webkit.org/show_bug.cgi?id=167536

Reviewed by Darin Adler.

Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
instead of a string. The value needs to be numeric and the current API is error-prone.

Source/WebCore:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
* loader/EmptyClients.cpp:
* page/DiagnosticLoggingClient.h:

Source/WebKit2:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::logDiagnosticMessage):
(WebKit::NetworkProcess::logDiagnosticMessageWithResult):
(WebKit::NetworkProcess::logDiagnosticMessageWithValue):
* NetworkProcess/NetworkProcess.h:
* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
(WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::logDiagnosticMessage):
(WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
(WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/PerActivityStateCPUUsageSampler.cpp:
(WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::goToItem):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logDiagnosticMessage):
(WebKit::WebPageProxy::logDiagnosticMessageWithResult):
(WebKit::WebPageProxy::logDiagnosticMessageWithValue):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:

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

2 years agoUnreviewed, rollout r211235 Pointer lock events should be delivered directly to the...
ryanhaddad@apple.com [Mon, 30 Jan 2017 18:18:46 +0000 (18:18 +0000)]
Unreviewed, rollout r211235 Pointer lock events should be delivered directly to the target element.

The LayoutTest for this change is frequently failing.

Source/WebCore:

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleMouseForceEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::isLocked): Deleted.
(WebCore::PointerLockController::dispatchLockedWheelEvent): Deleted.
* page/PointerLockController.h:

LayoutTests:

* platform/mac/TestExpectations:
* pointer-lock/mouse-event-delivery-expected.txt:
* pointer-lock/mouse-event-delivery.html:

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

2 years agoLayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide...
graouts@webkit.org [Mon, 30 Jan 2017 18:16:57 +0000 (18:16 +0000)]
LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167254
<rdar://problem/30259293>

Reviewed by Dean Jackson.

Source/WebCore:

When we would identify that we need to prolong an existing auto-hide timer, when the previous
auto-hide timer was marked as non-cancelable, calling _cancelAutoHideTimer() would not actually
cancel the previous timer, which would let it fire and hide the controls bar. We now have two
methods, _cancelAutoHideTimer() which always cancels the current auto-hide timer, and
_cancelNonEnforcedAutoHideTimer() which is used from all other existing call sites, which only
cancels the current auto-hide timer if it was marked as cancelable. This, and revised timing in
the test itself, make media/modern-media-controls/media-controller/media-controller-auto-hide-
mouse-leave-after-play.html a lot more reliable.

We also make a small drive-by fix where we ensure the "autoHideDelay" property is set first so
that setting other members which may set a timer do not used an undefined value for the auto-hide
timer delay.

* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set visible):
(ControlsBar.prototype.handleEvent):
(ControlsBar.prototype._cancelNonEnforcedAutoHideTimer):
(ControlsBar.prototype._cancelAutoHideTimer):

LayoutTests:

We improve the test by setting off timers when the actual "play" and "pause" events are
triggered rather than when we call .play() or .pause() on the media element. This matches
when the auto-hide timer are set in ControlsBar and makes the test more robust. Combined
with the modern-media-controls WebCore module source changes, we can now stop marking this
test as flaky.

We apply the same change to media/modern-media-controls/media-controller/media-controller-auto-hide-pause.html
since it also sets off a timer based on the media being paused.

* media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play-expected.txt:
* media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html:
* media/modern-media-controls/media-controller/media-controller-auto-hide-pause.html:
* platform/mac/TestExpectations:

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

2 years ago[QuickLook] Make HTTP QuickLook tests work in Apple Internal DumpRenderTree
dbates@webkit.org [Mon, 30 Jan 2017 18:14:25 +0000 (18:14 +0000)]
[QuickLook] Make HTTP QuickLook tests work in Apple Internal DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=167483

Reviewed by Andy Estes.

Write QuickLook tests that tap a hyperlink in terms of UIHelper (in LayoutTests/resources/ui-helper.js)
so that we can run these tests in an Apple Internal build of DumpRenderTree.

* http/tests/quicklook/at-import-stylesheet-blocked.html: Write in terms of UIHelper.
* http/tests/quicklook/base-url-blocked.html: Ditto.
* http/tests/quicklook/cross-origin-iframe-blocked.html: Ditto.
* http/tests/quicklook/document-domain-is-empty-string.html: Ditto.
* http/tests/quicklook/external-stylesheet-blocked.html: Ditto.
* http/tests/quicklook/hide-referer-on-navigation.html: Ditto.
* http/tests/quicklook/resources/tap-at-point-and-notify-done.js: Removed.
* http/tests/quicklook/resources/tap-run-test-hyperlink.js: Added.
(runTest):
* http/tests/quicklook/submit-form-blocked.html: Ditto.
* http/tests/quicklook/top-navigation-blocked.html: Ditto.
* platform/ios-simulator-wk1/TestExpectations: Unskip QuickLook tests as we can now run
them in an Apple Internal build of DumpRenderTree. Note that these test are listed in
file LayoutTests/platform/ios-simulator/TestExpectations so that they are skipped in
WebKit for iOS Simulator built with the public iOS SDK as we need to fix <https://bugs.webkit.org/show_bug.cgi?id=141906>.
* platform/ios-simulator-wk1/http/tests/quicklook/top-navigation-blocked-expected.txt: Added.
For some reason the console message "Unsafe JavaScript attempt to initiate navigation" includes
a line number in DumpRenderTree (why?). This line number is not emitted when the test is run
in WebKitTestRunner. Add platform-specific result for now.

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

2 years agoREGRESSION(r202615?): [GStreamer] ASSERTION FAILED: isMainThread() in WebCore::Builti...
carlosgc@webkit.org [Mon, 30 Jan 2017 18:13:11 +0000 (18:13 +0000)]
REGRESSION(r202615?): [GStreamer] ASSERTION FAILED: isMainThread() in WebCore::BuiltinResourceHandleConstructorMap& WebCore::builtinResourceHandleConstructorMap()
https://bugs.webkit.org/show_bug.cgi?id=167003

Reviewed by Michael Catanzaro.

Add a way to create a ResourceHandle for a given SoupNetworkSession and use it in the GStreamer streaming client
to ensure both the session and the handle are created and destroyed in the secondary thread. This way we also
avoid using the default session for downloading HLS fragments.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(ResourceHandleStreamingClient::ResourceHandleStreamingClient): Create a SoupNetworkSession and pass it to ResourceHandle::create().
* platform/network/ResourceHandle.h: Add create and constructor to receive a SoupNetworkSession.
* platform/network/ResourceHandleInternal.h: Add SoupNetworkSession member.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandleInternal::soupSession): Return the SoupNetworkSession if not nullptr.
(WebCore::ResourceHandle::create): Create a ResourceHandle without trying to use any builtin constructor and
using the given SoupNetworkSession.
(WebCore::ResourceHandle::ResourceHandle): Set the SoupNetworkSession if early request validations didn't fail.

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

2 years ago[WebRTC] Add support for libwebrtc data channel
commit-queue@webkit.org [Mon, 30 Jan 2017 17:36:43 +0000 (17:36 +0000)]
[WebRTC] Add support for libwebrtc data channel
https://bugs.webkit.org/show_bug.cgi?id=167489

Patch by Youenn Fablet <youennf@gmail.com> on 2017-01-30
Reviewed by Alex Christensen.

Partially covered by webrtc/datachannel/basic.html but not yet enabled on bots.

Introducing LibWebRTCDataChannelHandler as the integration layer between WebCore (RTCDataChannel)
and libwebrtc (DataChannelObserver).

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create):
(WebCore::RTCDataChannel::RTCDataChannel):
(WebCore::RTCDataChannel::bufferedAmount):
(WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: Added.
(WebCore::LibWebRTCDataChannelHandler::~LibWebRTCDataChannelHandler):
(WebCore::LibWebRTCDataChannelHandler::setClient):
(WebCore::LibWebRTCDataChannelHandler::sendStringData):
(WebCore::LibWebRTCDataChannelHandler::sendRawData):
(WebCore::LibWebRTCDataChannelHandler::close):
(WebCore::LibWebRTCDataChannelHandler::OnStateChange):
(WebCore::LibWebRTCDataChannelHandler::OnMessage):
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnRemoveStream):
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
(): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::createDataChannelHandler):
* dom/EventNames.h:
* platform/mediastream/RTCDataChannelHandler.h:
* platform/mediastream/RTCDataChannelHandlerClient.h:
* platform/mock/RTCDataChannelHandlerMock.h:

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

2 years agoUse simctl instead of LayoutTestRelay
jbedard@apple.com [Mon, 30 Jan 2017 17:31:47 +0000 (17:31 +0000)]
Use simctl instead of LayoutTestRelay
https://bugs.webkit.org/show_bug.cgi?id=165927

Reviewed by Daniel Bates.

Part 1

LayoutTestRelay uses SPI, since recent versions of the iOS SDK allow for installing apps on
simulators through simctl (iOS 10 and later), use this functionality instead.

* Scripts/webkitpy/port/base.py:
(Port.__init__): Added _test_runner_process_constructor.
* Scripts/webkitpy/port/darwin.py:
(DarwinPort.app_identifier_from_bundle): Added function to extract bundle ID from plist.
* Scripts/webkitpy/port/driver.py:
(Driver._start): Pass worker_number to server_process so we can look up the correct simulator device to use.
(IOSSimulatorDriver): Deleted.
* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test_stop_cleans_up_properly): Set _test_runner_process_constructor for testing.
(DriverTest.test_two_starts_cleans_up_properly): Ditto.
(DriverTest.test_start_actually_starts): Ditto.
* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort): Remove relay_name.
(IOSSimulatorPort.__init__): Set _test_runner_process_constructor to SimulatorProcess for IOSSimulatorPort.
(IOSSimulatorPort._create_simulators): Formatting change.
(IOSSimulatorPort.relay_path): Deleted.
(IOSSimulatorPort._check_relay): Deleted.
(IOSSimulatorPort._check_port_build): Deleted. Use base class implementation
(IOSSimulatorPort._build_relay): Deleted.
(IOSSimulatorPort._build_driver): Deleted. Use base class implementation
(IOSSimulatorPort._driver_class): Deleted. Use base class implementation
* Scripts/webkitpy/port/ios_unittest.py:
(iosTest.test_32bit): Update test.
(iosTest.test_64bit): Update test.
* Scripts/webkitpy/port/server_process.py:
(ServerProcess.__init__): Added argument worker_number. This class does not make use of it. We will make use of this argument in SimulatorProcess to lookup the associated simulator device.
(ServerProcess._set_file_nonblocking): Added to share common code.
* Scripts/webkitpy/port/server_process_mock.py:
(MockServerProcess.__init__): Added argument worker_number.
* Scripts/webkitpy/port/simulator_process.py: Added.
(SimulatorProcess): Added.
(SimulatorProcess.Popen): Added.
(SimulatorProcess.Popen.__init__): Added. Initialize Popen structure with stdin, stdout, stderr and pid.
(SimulatorProcess.Popen.poll): Added. Check if the process is running.
(SimulatorProcess.Popen.wait): Added. Wait for process to close.
(SimulatorProcess.__init__): Added. Install app to device specified through port and worker_number.
(SimulatorProcess._reset): Added. Unlink fifos.
(SimulatorProcess._start): Added. Launch app on simulator, link fifos.
(SimulatorProcess._kill): Added. Shutdown app on simulator.
* Scripts/webkitpy/xcode/simulator.py:
(Device.__init__): Accept host to run install/launch/terminate.
(Device.install_app): Install app to target Device.
(Device.launch_app): Launch app on target Device.
(Device.terminate_app): Shutdown app on target Device.
(Simulator._parse_devices): Pass host to Device.

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

2 years ago[GTK] pixman fails to compile on Raspberry Pi (GCC crash)
clopez@igalia.com [Mon, 30 Jan 2017 17:09:06 +0000 (17:09 +0000)]
[GTK] pixman fails to compile on Raspberry Pi (GCC crash)
https://bugs.webkit.org/show_bug.cgi?id=167411

Reviewed by Michael Catanzaro.

Disable the ARM iwMMXt fast path for pixman, because it triggers
a GCC bug on the RPi with Raspbian/PIXEL causing a build failure.

* gtk/jhbuild.modules:

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

2 years ago[Mac][cmake] Fix the build after r211354.
ossy@webkit.org [Mon, 30 Jan 2017 17:04:18 +0000 (17:04 +0000)]
[Mac][cmake] Fix the build after r211354.
https://bugs.webkit.org/show_bug.cgi?id=167565

Unreviewed buildfix.

* PlatformMac.cmake:

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

2 years ago[GTK] Scrolling iframes, doesn't redraw their content
magomez@igalia.com [Mon, 30 Jan 2017 16:53:09 +0000 (16:53 +0000)]
[GTK] Scrolling iframes, doesn't redraw their content
https://bugs.webkit.org/show_bug.cgi?id=167581

Reviewed by Carlos Garcia Campos.

Take into account whether we are using AC or not in order to repaint an area after scrolling.

No behaviour change, no new tests.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::invalidateContentsForSlowScroll):

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

2 years agoUnreviewed. Fix GTK+ debug build after r211365.
carlosgc@webkit.org [Mon, 30 Jan 2017 16:47:15 +0000 (16:47 +0000)]
Unreviewed. Fix GTK+ debug build after r211365.

Remove invalid assert.

* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):

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

2 years ago[GTK] Do not release OpenGL resource immediately when leaving accelerated compositing...
carlosgc@webkit.org [Mon, 30 Jan 2017 16:42:12 +0000 (16:42 +0000)]
[GTK] Do not release OpenGL resource immediately when leaving accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=167544

Reviewed by Michael Catanzaro.

Sometimes the conditions to be in AC mode or not change quickly, and then we leave AC mode just enter it again
after a very short period of time. In those cases we are dropping all the GL resources and the compositor
thread, and creating it again. We could keep the layer tree host alive for a while when exiting AC mode, and
reuse it if we enter AC mode before the previous one has been discarded. While the previous layer tree host is
alive we still need to keep it up to date, for example if the web view is resized or contents size change, and
synchronize with the threaded compositor when it becomes the layer tree host again.

* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::~AcceleratedDrawingArea): Discard the previous layer tree host.
(WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): Initialize the timer to discard the previous layer
tree host.
(WebKit::AcceleratedDrawingArea::pageBackgroundTransparencyChanged): Notify the previous layer tree host if needed.
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Ditto.
(WebKit::AcceleratedDrawingArea::updateBackingStoreState): Ditto.
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Reuse the previous layer tree host if possible.
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): Exit AC mode and save the layer tree host
starting a timer of 5 seconds to discard it if not reused.
(WebKit::AcceleratedDrawingArea::discardPreviousLayerTreeHost): Invalidate and destroy the previous layer tree host.
(WebKit::AcceleratedDrawingArea::didChangeViewportAttributes): Notify the previous layer tree host if needed.
(WebKit::AcceleratedDrawingArea::deviceOrPageScaleFactorChanged): Ditto.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): If it's discardable add the action to
be synchronized instead.
(WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): When the layer tree host becomes discardable,
reset the sync actions and return. When it becomes the real layer tree host again, apply all pending actions to
synchronize with the threaded compositor.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::scroll): Notify the previous layer tree host if needed.
(WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Ditto.
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Use AcceleratedDrawingArea::exitAcceleratedCompositingModeNow().
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::setIsDiscardable): Added.

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

2 years ago[GTK] Remove support to enable/disable experimental features
rego@igalia.com [Mon, 30 Jan 2017 16:35:03 +0000 (16:35 +0000)]
[GTK] Remove support to enable/disable experimental features
https://bugs.webkit.org/show_bug.cgi?id=167586

Reviewed by Michael Catanzaro.

As requested in bug #167578 we should remove the support to enable/disable
experimental features in WebKitGTK+.
One reason is that CSS Grid Layout is going to be enabled by default now,
so we don't need it to be in this file.
Another is that this support needs to be rewritten to use
the enumerable experimental features API.

* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsConstructed):
* UIProcess/gtk/ExperimentalFeatures.cpp: Removed.
* UIProcess/gtk/ExperimentalFeatures.h: Removed.

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

2 years ago[GTK] Add API to handle the accelerated compositing policy
carlosgc@webkit.org [Mon, 30 Jan 2017 13:50:37 +0000 (13:50 +0000)]
[GTK] Add API to handle the accelerated compositing policy
https://bugs.webkit.org/show_bug.cgi?id=167509

Reviewed by Michael Catanzaro.

Source/WebKit2:

Now that we have brought back the on demand mode, we should allow applications to choose the policy, without
having to deal with environment variables. Settings also allows to set different policy depending on the web
view, so for example evolution could disable AC for the composer, but leave the on demand mode for the email
viewer. This patch adds a single new setting hardware-acceleration-policy to handle both
acceleratedCompositingEnabled and forceCompositingMode preferences using an enum with values
WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND, WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS and
WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER.

* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsSetProperty): Add setter for hardware-acceleration-policy property.
(webKitSettingsGetProperty): Add getter for hardware-acceleration-policy property.
(webkit_settings_class_init): Add hardware-acceleration-policy property.
(webkit_settings_get_hardware_acceleration_policy): Return policy according to the preferences.
(webkit_settings_set_hardware_acceleration_policy): set preferences according to the given policy.
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updatePreferences):

Tools:

Handle new setting in MiniBrowser. The settings dialog doesn't support enum settings so it needs to be handled
as a special case. Also add test cases to the get/set API.

* MiniBrowser/gtk/BrowserSettingsDialog.c:
(hardwareAccelerationPolicyToString):
(stringToHardwareAccelerationPolicy):
(cellRendererChanged):
(browserSettingsDialogConstructed):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp:
(testWebKitSettings):

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

2 years ago[macOS] WebHTMLView has an internal retain cycle with its flagsChangedEventMonitor.
akling@apple.com [Mon, 30 Jan 2017 12:07:15 +0000 (12:07 +0000)]
[macOS] WebHTMLView has an internal retain cycle with its flagsChangedEventMonitor.
<https://webkit.org/b/167580>

Reviewed by Antti Koivisto.

Avoid the implicit strong capture of self by keeping it in a __block variable.
Also add code to dealloc to unregister the event monitor, since it will otherwise leak.
This fixes huge WebHTMLView leaks seen on the leaks bot.

* WebView/WebHTMLView.mm:
(-[WebHTMLViewPrivate dealloc]):
(-[WebHTMLView viewDidMoveToWindow]):

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

2 years agoUnreviewed. Skip more tests timing out in GTK+ bots.
carlosgc@webkit.org [Mon, 30 Jan 2017 10:27:00 +0000 (10:27 +0000)]
Unreviewed. Skip more tests timing out in GTK+ bots.

Skip two mores tests that use UIScriptController to generate events and another one expecting native
HTML form validation popover.

* platform/gtk/TestExpectations:

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

2 years agoSeveral web timing tests crash in GTK+ and AppleWin bots
carlosgc@webkit.org [Mon, 30 Jan 2017 10:14:36 +0000 (10:14 +0000)]
Several web timing tests crash in GTK+ and AppleWin bots
https://bugs.webkit.org/show_bug.cgi?id=167577

Reviewed by Ryosuke Niwa.

The problem is that entry is used in both the key, to get name, and in the value with WTFMove. So, the name is
invalidated by the move. It could be fixed by simply copying the name, instead of using entry->name, but I think
that code could be simplified using HashMap::ensure and then we don't need any string copy, nor even the static
insertPerformanceEntry().

Fix crashes in several imported/w3c/web-platform-tests/user-timing/ tests.

* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::mark):
(WebCore::UserTiming::measure):
(WebCore::insertPerformanceEntry): Deleted.

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

2 years agoUnreviewed. Skip form validation tests timing out in GTK+ bots.
carlosgc@webkit.org [Mon, 30 Jan 2017 10:10:40 +0000 (10:10 +0000)]
Unreviewed. Skip form validation tests timing out in GTK+ bots.

* platform/gtk/TestExpectations:

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

2 years ago[Threaded Compositor] Crash in GraphicsContext3D::deleteTexture when destroying Textu...
carlosgc@webkit.org [Mon, 30 Jan 2017 08:47:30 +0000 (08:47 +0000)]
[Threaded Compositor] Crash in GraphicsContext3D::deleteTexture when destroying TextureMapperPlatformLayerProxy
https://bugs.webkit.org/show_bug.cgi?id=167575

Reviewed by Žan Doberšek.

We should clear all the buffers on invalidate to ensure we don't have textures alive after CoordinatedGraphicsScene::purgeGLResources().

Fix crash in media/video-poster-background.html.

* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear current, pending and all used buffers.

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

2 years ago[Threaded Compositor] Crash on WebCore::GLContext::version()
carlosgc@webkit.org [Mon, 30 Jan 2017 05:55:34 +0000 (05:55 +0000)]
[Threaded Compositor] Crash on WebCore::GLContext::version()
https://bugs.webkit.org/show_bug.cgi?id=167559

Reviewed by Michael Catanzaro.

Source/WebCore:

Fixes crashes in several media tests.

* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear m_compositorThreadUpdateTimer and call the update function.

Source/WebKit2:

This is happening because TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired() is fired after the
threaded compositor is deleted. CoordinatedGraphicsScene::purgeGLResources() should invalidate the proxies
before clearing the map.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::purgeGLResources):

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

2 years agoAX: WKContentView needs to implement UITextInput methods to make speak selection...
n_wang@apple.com [Mon, 30 Jan 2017 05:03:11 +0000 (05:03 +0000)]
AX: WKContentView needs to implement UITextInput methods to make speak selection highlighting work
https://bugs.webkit.org/show_bug.cgi?id=166955

Reviewed by Ryosuke Niwa.

Source/WebCore:

Created a new version of Range::collectSelectionRect() that returns rects for each
line, so that Speak Selection doesn't need to handle searching for soft line breaks.
Also added a variant of findPlainText to search for the closest matched range to the given position.

Test: editing/text-iterator/range-of-string-closest-to-position.html

* dom/Range.cpp:
(WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines):
(WebCore::Range::collectSelectionRects):
* dom/Range.h:
* editing/TextIterator.cpp:
(WebCore::findPlainTextMatches):
(WebCore::updateSearchBuffer):
(WebCore::findIteratorOptions):
(WebCore::rangeMatches):
(WebCore::findClosestPlainText):
(WebCore::findPlainText):
(WebCore::findPlainTextOffset): Deleted.
* editing/TextIterator.h:
* editing/htmlediting.h:
* testing/Internals.cpp:
(WebCore::Internals::rangeOfStringNearLocation):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Implemented methods that Speak Selection can use to retrieve the word/sentence highlighting rects.

* Scripts/webkit/messages.py:
(headers_for_type):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView webSelectionRectsForSelectionRects:]):
(-[WKContentView webSelectionRects]):
(-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
(-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::selectionRectsCallback):
(WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
(WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::visiblePositionForPositionWithOffset):
(WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
(WebKit::rangeNearPositionMatchesText):
(WebKit::WebPage::getRectsAtSelectionOffsetWithText):

LayoutTests:

* editing/text-iterator/range-of-string-closest-to-position-expected.txt: Added.
* editing/text-iterator/range-of-string-closest-to-position.html: Added.

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

2 years ago[QuickLook] Add a WebPreference to enable saving QuickLook documents in WebKitLegacy
aestes@apple.com [Mon, 30 Jan 2017 01:40:29 +0000 (01:40 +0000)]
[QuickLook] Add a WebPreference to enable saving QuickLook documents in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=167563
<rdar://problem/30253207>

Reviewed by Andreas Kling.

Source/WebCore:

* loader/ios/QuickLook.h: Removed unused declarations.
(WebCore::QuickLookHandle::firstRequestURL): Deleted.
* loader/ios/QuickLook.mm:
(WebCore::removeQLPreviewConverterForURL): Stopped deleting the temporary file here; that's
now done in QuickLookDocumentWriter.
(addQLPreviewConverterWithFileForURL): Changed from an exported function to a static
function since it's now only called inside QuickLook.mm.
(WebCore::QuickLookHandle::QuickLookHandle): Stopped initializing m_firstRequestURL.
(WebCore::addQLPreviewConverterWithFileForURL): Deleted.
(WebCore::qlPreviewConverterFileNameForURL): Deleted.
(WebCore::qlPreviewConverterUTIForURL): Deleted.
(WebCore::QuickLookHandle::previewRequestURL): Deleted.
(WebCore::QuickLookHandle::converter): Deleted.

Source/WebKit/mac:

Instead of only saving QuickLook documents to a temporary file when the client is
MobileSafari, base this decision on a WebPreference that clients can choose to enable.

This also changes the SPI for accessing the temporary file path and UTI. Instead of
-[WebView quickLookContentForURL:], which requires the client to pass the response URL of
the frame that saved the QuickLook document, the content dictionary is now stored as a
property of WebDataSource.

This also removes the manual lifetime management of the QLPreviewConverter from
QuickLookDocumentWriter. The QLPreviewConverter is kept alive by DocumentLoader these days,
which ensures it lives long enough to respond to subresource requests.

New API test: QuickLook.LegacyQuickLookContent

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::didCreateQuickLookHandle): Moved the logic of deciding whether to
write a temporary file to here from the QuickLookDocumentWriter constructor.
* WebView/WebDataSource.mm: Declared _quickLookContent.
(-[WebDataSource _quickLookContent]):
(-[WebDataSource _setQuickLookContent:]):
* WebView/WebDataSourceInternal.h: Overrode _quickLookContent as a read/write property.
* WebView/WebDataSourcePrivate.h: Declared _quickLookContent as a readonly property.
* WebView/WebPreferenceKeysPrivate.h: Defined WebKitQuickLookDocumentSavingPreferenceKey.
* WebView/WebPreferences.mm:
(-[WebPreferences quickLookDocumentSavingEnabled]):
(-[WebPreferences setQuickLookDocumentSavingEnabled:]):
* WebView/WebPreferencesPrivate.h: Declared property quickLookDocumentSavingEnabled.
* WebView/WebView.mm:
(-[WebView quickLookContentForURL:]): Changed to always return nil.
* WebView/WebViewPrivate.h: Added a comment stating that clients should use
-[WebDataSource _quickLookContent] instead.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/QuickLook.mm:
(-[QuickLookNavigationDelegate _webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:]):
(-[QuickLookNavigationDelegate _webView:didFinishLoadForQuickLookDocumentInMainFrame:]):
(runTest):
(-[QuickLookFrameLoadDelegate webView:didFinishLoadForFrame:]):
(TEST):

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

2 years ago[iOS] Expose WebCore::DataDetection::detectContentInRange WKWebProcessPlugInRangeHandle
mitz@apple.com [Mon, 30 Jan 2017 00:26:36 +0000 (00:26 +0000)]
[iOS] Expose WebCore::DataDetection::detectContentInRange WKWebProcessPlugInRangeHandle
https://bugs.webkit.org/show_bug.cgi?id=167565

Reviewed by Sam Weinig.

Source/WebKit2:

Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandle.mm

* Shared/API/Cocoa/WKDataDetectorTypes.h: Added. Moved the enum definition from
  WKWebViewConfiguration.h to here.
* Shared/API/Cocoa/WKDataDetectorTypesInternal.h: Added.
(fromWKDataDetectorTypes): Moved from WKWebView.mm.

* UIProcess/API/Cocoa/WKWebView.mm:
(fromWKDataDetectorTypes): Moved to WKDataDetectorTypesInternal.h.

* UIProcess/API/Cocoa/WKWebViewConfiguration.h: Moved WKDataDetectorTypes definition out
  to WKDataDetectorTypes.h.

* WebKit2.xcodeproj/project.pbxproj: Added references to new files.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
(-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Added. Calls
  DataDetection::detectContentInRange.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandle.mm: Added.
(-[BundleRangeHandleRemoteObject textFromBodyRange:]):
(-[BundleRangeHandleRemoteObject bodyInnerHTMLAfterDetectingData:]):
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandlePlugIn.mm: Added.
(-[BundleRangeHandlePlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[BundleRangeHandlePlugIn webProcessPlugInBrowserContextController:didFinishDocumentLoadForFrame:]):
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandleProtocol.h: Added.

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

2 years agoSimple line layout: PerformanceTests/Layout/simple-line-layout-innertext.html regress...
zalan@apple.com [Sun, 29 Jan 2017 20:21:08 +0000 (20:21 +0000)]
Simple line layout: PerformanceTests/Layout/simple-line-layout-innertext.html regressed at r211108
https://bugs.webkit.org/show_bug.cgi?id=167562

Reviewed by Antti Koivisto.

Apparently RunResolver::Run::constructStringForHyphenIfNeeded() is in a superhot codepath.
The Run should not have any additional members anyway, so let's construct the hyphenated
string on demand.
Progression on simple-line-layout-innertext.html is from ~34runs/sec back to ~50runs/sec.

Covered by existing text.

* rendering/RenderTreeAsText.cpp:
(WebCore::writeSimpleLine):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::Run):
(WebCore::SimpleLineLayout::RunResolver::Run::textWithHyphen):
(WebCore::SimpleLineLayout::RunResolver::Run::text):
(WebCore::SimpleLineLayout::RunResolver::Run::constructStringForHyphenIfNeeded): Deleted.
* rendering/SimpleLineLayoutResolver.h:

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

2 years agoAdd invalid value tests to Link header handling.
yoav@yoav.ws [Sun, 29 Jan 2017 15:13:44 +0000 (15:13 +0000)]
Add invalid value tests to Link header handling.
https://bugs.webkit.org/show_bug.cgi?id=167366

Reviewed by Alex Christensen.

* http/tests/preload/download_resources_from_invalid_headers-expected.txt:
* http/tests/preload/resources/download_resources_from_header.php:
* http/tests/preload/resources/invalid_resources_from_header.php:

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

2 years ago[EFL] Gardening on 29th Jan.
gyuyoung.kim@webkit.org [Sun, 29 Jan 2017 14:30:46 +0000 (14:30 +0000)]
[EFL] Gardening on 29th Jan.

Unreviewed EFL gardening. Update flaky tests and crash tests.

* platform/efl/TestExpectations:

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

2 years ago[Coordinated Graphics] WebPage shouldn't use the layerTreeHost directly
carlosgc@webkit.org [Sun, 29 Jan 2017 10:06:30 +0000 (10:06 +0000)]
[Coordinated Graphics] WebPage shouldn't use the layerTreeHost directly
https://bugs.webkit.org/show_bug.cgi?id=167494

Reviewed by Michael Catanzaro.

In Coordinated Graphics we have a couple of methods that the WebPage uses directly from the layer tree host,
instead of using the drawing area interface. This patch adds DrawingArea::didChangeViewportAttributes and
DrawingArea::deviceOrPageScaleFactorChanged and renames LayerTreeHost::didChangeViewportProperties as
LayerTreeHost::didChangeViewportAttributes for consistency.

* Shared/CoordinatedGraphics/SimpleViewportController.cpp:
(WebKit::SimpleViewportController::didChangeViewportAttributes): Receive an rvalue reference to avoid copies.
* Shared/CoordinatedGraphics/SimpleViewportController.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::didChangeViewportAttributes): Forward it to the layer tree host if any.
(WebKit::AcceleratedDrawingArea::deviceOrPageScaleFactorChanged): Ditto.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes): Renamed and updated to pass an rvalue reference.
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::didChangeViewportAttributes): Renamed and updated to pass an rvalue reference.
(WebKit::LayerTreeHost::didChangeViewportProperties): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged): Use the drawing area.
(WebKit::WebPage::scalePage): Ditto
(WebKit::WebPage::setDeviceScaleFactor): Ditto.
(WebKit::WebPage::viewportPropertiesDidChange): Ditto.

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

2 years agoMigrate 97 *-disabled tests to use TestExpectations
ddkilzer@apple.com [Sun, 29 Jan 2017 07:30:39 +0000 (07:30 +0000)]
Migrate 97 *-disabled tests to use TestExpectations
<https://webkit.org/b/167537>

Reviewed by Darin Adler.

* TestExpectations: Skip renamed tests.

* fast/dom/HTMLDataGridElement/DataGridColumns-basic-expected.txt: Removed.
* fast/dom/HTMLDataGridElement/DataGridColumns-basic.html-disabled: Removed.
* fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes-expected.txt: Removed.
* fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes.html-disabled: Removed.
* fast/dom/HTMLDataGridElement/DataGridColumns-dom-expected.txt: Removed.
* fast/dom/HTMLDataGridElement/DataGridColumns-dom.html-disabled: Removed.
* fast/dom/HTMLDataGridElement/DataGridDataSource-basic-expected.txt: Removed.
* fast/dom/HTMLDataGridElement/DataGridDataSource-basic.html-disabled: Removed.
- Tests disabled in r52512. DataGrid feature removed in r84991.

* http/tests/appcache/dynamic-entries-no-cache-expected.txt: Removed.
* http/tests/appcache/dynamic-entries-no-cache.html-disabled: Removed.
- Test disabled in r39816. AppCache dynamic entry feature removed in r95486.

* svg/W3C-SVG-1.1/resources/filters-comptran-01-f.svg-disabled: Removed.
- Unused. Same as LayoutTests/svg/W3C-SVG-1.1/filters-comptran-01-b.svg.

* animations/font-size-using-ems.html: Renamed from LayoutTests/animations/font-size-using-ems.html-disabled.
* compositing/objects/composited-object-alignment.html: Renamed from LayoutTests/compositing/objects/composited-object-alignment.html-disabled.
* compositing/tiling/huge-layer-resize.html: Renamed from LayoutTests/compositing/tiling/huge-layer-resize.html-disabled.
* compositing/tiling/huge-layer.html: Renamed from LayoutTests/compositing/tiling/huge-layer.html-disabled.
* css2.1/t1202-counter-10-b.html: Renamed from LayoutTests/css2.1/t1202-counter-10-b.html-disabled.
* css2.1/t1202-counters-10-b.html: Renamed from LayoutTests/css2.1/t1202-counters-10-b.html-disabled.
* css2.1/t1204-increment-00-c-o.html: Renamed from LayoutTests/css2.1/t1204-increment-00-c-o.html-disabled.
* css2.1/t1204-increment-01-c-o.html: Renamed from LayoutTests/css2.1/t1204-increment-01-c-o.html-disabled.
* css2.1/t1204-increment-02-c-o.html: Renamed from LayoutTests/css2.1/t1204-increment-02-c-o.html-disabled.
* css2.1/t1204-reset-00-c-o.html: Renamed from LayoutTests/css2.1/t1204-reset-00-c-o.html-disabled.
* css2.1/t1204-reset-01-c-o.html: Renamed from LayoutTests/css2.1/t1204-reset-01-c-o.html-disabled.
* css2.1/t1204-reset-02-c-o.html: Renamed from LayoutTests/css2.1/t1204-reset-02-c-o.html-disabled.
* dom/xhtml/level2/html/HTMLFrameElement09.xhtml: Renamed from LayoutTests/dom/xhtml/level2/html/HTMLFrameElement09.xhtml-disabled.
* dom/xhtml/level3/core/documentadoptnode22.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/documentadoptnode22.xhtml-disabled.
* dom/xhtml/level3/core/documentnormalizedocument06.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/documentnormalizedocument06.xhtml-disabled.
* dom/xhtml/level3/core/documentsetdocumenturi01.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/documentsetdocumenturi01.xhtml-disabled.
* dom/xhtml/level3/core/documentsetdocumenturi02.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/documentsetdocumenturi02.xhtml-disabled.
* dom/xhtml/level3/core/domimplementationregistry12.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/domimplementationregistry12.xhtml-disabled.
* dom/xhtml/level3/core/domimplementationregistry23.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/domimplementationregistry23.xhtml-disabled.
* dom/xhtml/level3/core/nodecomparedocumentposition14.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/nodecomparedocumentposition14.xhtml-disabled.
* dom/xhtml/level3/core/nodecomparedocumentposition15.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/nodecomparedocumentposition15.xhtml-disabled.
* dom/xhtml/level3/core/noderemovechild03.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/noderemovechild03.xhtml-disabled.
* dom/xhtml/level3/core/nodereplacechild06.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/nodereplacechild06.xhtml-disabled.
* dom/xhtml/level3/core/nodereplacechild07.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/nodereplacechild07.xhtml-disabled.
* dom/xhtml/level3/core/nodereplacechild08.xhtml: Renamed from LayoutTests/dom/xhtml/level3/core/nodereplacechild08.xhtml-disabled.
* editing/execCommand/create-list-1.html: Renamed from LayoutTests/editing/execCommand/create-list-1.html-disabled.
* editing/input/attributed-substring-from-range-lines.html: Renamed from LayoutTests/editing/input/attributed-substring-from-range-lines.html-disabled.
* editing/pasteboard/paste-empty-startcontainer.html: Renamed from LayoutTests/editing/pasteboard/paste-empty-startcontainer.html-disabled.
* editing/selection/inconsistent-in-removeChildNode.html: Renamed from LayoutTests/editing/selection/inconsistent-in-removeChildNode.html-disabled.
* editing/style/5091898.html: Renamed from LayoutTests/editing/style/5091898.html-disabled.
* fast/css/css2-system-color.html: Renamed from LayoutTests/fast/css/css2-system-color.html-disabled.
* fast/css/font-face-in-shadow-DOM.html: Renamed from LayoutTests/fast/css/font-face-in-shadow-DOM.html-disabled.
* fast/css/limited-vendor-prefix-behavior.html: Renamed from LayoutTests/fast/css/limited-vendor-prefix-behavior.html-disabled.
* fast/dom/Window/timeout-released-on-close.html: Renamed from LayoutTests/fast/dom/Window/timeout-released-on-close.html-disabled.
* fast/dom/Window/window-resize-nan.html: Renamed from LayoutTests/fast/dom/Window/window-resize-nan.html-disabled.
* fast/dom/gc-8.html: Renamed from LayoutTests/fast/dom/gc-8.html-disabled.
* fast/dynamic/crash-paint-no-documentElement-renderer.html: Renamed from LayoutTests/fast/dynamic/crash-paint-no-documentElement-renderer.html-disabled.
* fast/events/destroyed-atomic-string.html: Renamed from LayoutTests/fast/events/destroyed-atomic-string.html-disabled.
* fast/events/key-events-in-frame.html: Renamed from LayoutTests/fast/events/key-events-in-frame.html-disabled.
* fast/frames/iframe-scroll-page-up-down.html: Renamed from LayoutTests/fast/frames/iframe-scroll-page-up-down.html-disabled.
* fast/html/marquee-alternate.html: Renamed from LayoutTests/fast/html/marquee-alternate.html-disabled.
* fast/leaks/003.html: Renamed from LayoutTests/fast/leaks/003.html-disabled.
* fast/loader/api-test-go-to-current-back-forward-item.html: Renamed from LayoutTests/fast/loader/api-test-go-to-current-back-forward-item.html-disabled.
* fast/loader/api-test-new-window-data-load-base-url.html: Renamed from LayoutTests/fast/loader/api-test-new-window-data-load-base-url.html-disabled.
* fast/loader/form-events-back-forward.html: Renamed from LayoutTests/fast/loader/form-events-back-forward.html-disabled.
* fast/notifications/notifications-event-stop-propagation.html: Renamed from LayoutTests/fast/notifications/notifications-event-stop-propagation.html-disabled.
* fast/notifications/notifications-multi-events.html: Renamed from LayoutTests/fast/notifications/notifications-multi-events.html-disabled.
* fast/ruby/after-block-doesnt-crash.html: Renamed from LayoutTests/fast/ruby/after-block-doesnt-crash.html-disabled.
* fast/ruby/after-table-doesnt-crash.html: Renamed from LayoutTests/fast/ruby/after-table-doesnt-crash.html-disabled.
* fast/ruby/generated-after-counter-doesnt-crash.html: Renamed from LayoutTests/fast/ruby/generated-after-counter-doesnt-crash.html-disabled.
* fast/ruby/generated-before-and-after-counter-doesnt-crash.html: Renamed from LayoutTests/fast/ruby/generated-before-and-after-counter-doesnt-crash.html-disabled.
* fast/shadow-dom/copy-shadow-tree.html: Renamed from LayoutTests/fast/shadow-dom/copy-shadow-tree.html-disabled.
* fast/table/double-height-table-no-tbody.html: Renamed from LayoutTests/fast/table/double-height-table-no-tbody.html-disabled.
* fast/text/large-text-composed-char-dos.html: Renamed from LayoutTests/fast/text/large-text-composed-char-dos.html-disabled.
* http/tests/multipart/win-boundary-crash.html: Renamed from LayoutTests/http/tests/multipart/win-boundary-crash.html-disabled.
* http/tests/navigation/post-goback-repost-policy.html: Renamed from LayoutTests/http/tests/navigation/post-goback-repost-policy.html-disabled.
* http/tests/navigation/success200-frames-goback.html: Renamed from LayoutTests/http/tests/navigation/success200-frames-goback.html-disabled.
* http/tests/navigation/success200-frames-reload.html: Renamed from LayoutTests/http/tests/navigation/success200-frames-reload.html-disabled.
* http/tests/navigation/success200-subframeload-goback.html: Renamed from LayoutTests/http/tests/navigation/success200-subframeload-goback.html-disabled.
* java/lc3/ArrayMethods/object-001.html: Renamed from LayoutTests/java/lc3/ArrayMethods/object-001.html-disabled.
* java/lc3/forin/array-001.html: Renamed from LayoutTests/java/lc3/forin/array-001.html-disabled.
* jquery/effects.html: Renamed from LayoutTests/jquery/effects.html-disabled.
* js/garbage-collect-after-string-appends.html: Renamed from LayoutTests/js/garbage-collect-after-string-appends.html-disabled.
* js/kde/Date.html: Renamed from LayoutTests/js/kde/Date.html-disabled.
* js/resources/garbage-collect-after-string-appends.js: Renamed from LayoutTests/js/resources/garbage-collect-after-string-appends.js-disabled.
* js/string-concatenate-outofmemory.html: Renamed from LayoutTests/js/string-concatenate-outofmemory.html-disabled.
* media/video-canvas.html: Renamed from LayoutTests/media/video-canvas.html-disabled.
* platform/mac/plugins/pluginDocumentView-deallocated-dataSource.html: Renamed from LayoutTests/platform/mac/plugins/pluginDocumentView-deallocated-dataSource.html-disabled.
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.1_decodeURI/S15.1.3.1_A2.5_T1.html: Renamed from LayoutTests/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.1_decodeURI/S15.1.3.1_A2.5_T1.html-disabled.
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.2_decodeURIComponent/S15.1.3.2_A2.5_T1.html: Renamed from LayoutTests/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.2_decodeURIComponent/S15.1.3.2_A2.5_T1.html-disabled.
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T1.html: Renamed from LayoutTests/sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T1.html-disabled.
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T2.html: Renamed from LayoutTests/sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T2.html-disabled.
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T3.html: Renamed from LayoutTests/sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T3.html-disabled.
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T4.html: Renamed from LayoutTests/sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T4.html-disabled.
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T5.html: Renamed from LayoutTests/sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T5.html-disabled.
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T6.html: Renamed from LayoutTests/sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T6.html-disabled.
* sputnik/Unicode/Unicode_218/S7.6_A1.1_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_218/S7.6_A1.1_T5.html-disabled.
* sputnik/Unicode/Unicode_218/S7.6_A3.1.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_218/S7.6_A3.1.html-disabled.
* sputnik/Unicode/Unicode_218/S7.6_A3.2.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_218/S7.6_A3.2.html-disabled.
* sputnik/Unicode/Unicode_218/S7.6_A5.2_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_218/S7.6_A5.2_T5.html-disabled.
* sputnik/Unicode/Unicode_320/S7.6_A1.1_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_320/S7.6_A1.1_T5.html-disabled.
* sputnik/Unicode/Unicode_320/S7.6_A5.2_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_320/S7.6_A5.2_T5.html-disabled.
* sputnik/Unicode/Unicode_410/S7.6_A1.1_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_410/S7.6_A1.1_T5.html-disabled.
* sputnik/Unicode/Unicode_410/S7.6_A5.2_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_410/S7.6_A5.2_T5.html-disabled.
* sputnik/Unicode/Unicode_500/S7.6_A1.1_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_500/S7.6_A1.1_T5.html-disabled.
* sputnik/Unicode/Unicode_500/S7.6_A5.2_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_500/S7.6_A5.2_T5.html-disabled.
* sputnik/Unicode/Unicode_510/S7.6_A1.1_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_510/S7.6_A1.1_T5.html-disabled.
* sputnik/Unicode/Unicode_510/S7.6_A5.2_T5.html: Renamed from LayoutTests/sputnik/Unicode/Unicode_510/S7.6_A5.2_T5.html-disabled.
* svg/batik/text/textBiDi.svg: Renamed from LayoutTests/svg/batik/text/textBiDi.svg-disabled.
* svg/custom/filter-source-alpha.svg: Renamed from LayoutTests/svg/custom/filter-source-alpha.svg-disabled.
* svg/custom/font-face-fallback.svg: Renamed from LayoutTests/svg/custom/font-face-fallback.svg-disabled.
* svg/custom/js-font-test.svg: Renamed from LayoutTests/svg/custom/js-font-test.svg-disabled.
* svg/zoom/page/zoom-svg-through-object-with-text.xhtml: Renamed from LayoutTests/svg/zoom/page/zoom-svg-through-object-with-text.xhtml-disabled.
- Renamed disabled tests now that they're skipped in TestExpectations.

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

2 years ago[Threaded Compositor] Crash when detaching the CoordinatedGraphicsScene
carlosgc@webkit.org [Sun, 29 Jan 2017 07:16:51 +0000 (07:16 +0000)]
[Threaded Compositor] Crash when detaching the CoordinatedGraphicsScene
https://bugs.webkit.org/show_bug.cgi?id=167547

Reviewed by Michael Catanzaro.

It seems that commitSceneState() can be called after the CoordinatedGraphicsScene has been detached.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::commitSceneState): Return early if scene has been detached.
(WebKit::CoordinatedGraphicsScene::detach): Take the render queue lock before clearing the render queue.

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

2 years ago[Threaded Compositor] Crash when deleting the compositor run loop
carlosgc@webkit.org [Sun, 29 Jan 2017 07:15:33 +0000 (07:15 +0000)]
[Threaded Compositor] Crash when deleting the compositor run loop
https://bugs.webkit.org/show_bug.cgi?id=167545

Reviewed by Michael Catanzaro.

The problem is that we are releasing the WorkQueue before the update timer that keeps a reference to the run
loop, destroyed by the WorkQueue. So, invalidate the WorkQueue in the next run loop iteration to ensure it
happens after the CompositingRunLoop destructor.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::~CompositingRunLoop):

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

2 years ago[GTK] ASSERTION FAILED: !m_layerTreeHost in DrawingAreaImpl::display()
carlosgc@webkit.org [Sun, 29 Jan 2017 07:14:12 +0000 (07:14 +0000)]
[GTK] ASSERTION FAILED: !m_layerTreeHost in DrawingAreaImpl::display()
https://bugs.webkit.org/show_bug.cgi?id=167548

Reviewed by Michael Catanzaro.

The problem is that non accelerated compositing forceRepaint implementation is doing a layout and then calling
display. The layout makes the drawing area enter in AC mode and display asserts that we have a layer tree
host. forceRepaint shouldn't do the layout because display already does that and it correctly handles the case
of entering AC mode during the layout. It shouldn't call setNeedsDisplay either, because that schedules a
display, but we are going to display synchronously.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::forceRepaint):

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

2 years agoWeb Inspector: Need some limit on Async Call Stacks for async loops (rAF loops)
mattbaker@apple.com [Sun, 29 Jan 2017 01:02:22 +0000 (01:02 +0000)]
Web Inspector: Need some limit on Async Call Stacks for async loops (rAF loops)
https://bugs.webkit.org/show_bug.cgi?id=165633
<rdar://problem/29738502>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

This patch limits the memory used by the Inspector backend to store async
stack trace data.

Asynchronous stack traces are stored as a disjoint set of parent pointer
trees. Tree nodes represent asynchronous operations, and hold a copy of
the stack trace at the time the operation was scheduled. Each tree can
be regarded as a set of stack traces, stored as singly linked lists that
share part of their structure (specifically their tails). Traces belonging
to the same tree will at least share a common root. A stack trace begins
at a leaf node and follows the chain of parent pointers to the root of
of the tree. Leaf nodes always contain pending asynchronous calls.

When an asynchronous operation is scheduled with requestAnimationFrame,
setInterval, etc, a node is created containing the current call stack and
some bookkeeping data for the operation. An unique identifier comprised
of an operation type and callback identifier is mapped to the node. If
scheduling the callback was itself the result of an asynchronous call,
the node becomes a child of the node associated with that call, otherwise
it becomes the root of a new tree.

A node is either `pending`, `active`, `dispatched`, or `canceled`. Nodes
start out as pending. After a callback for a pending node is dispatched
the node is marked as such, unless it is a repeating callback such as
setInterval, in which case it remains pending. Once a node is no longer
pending it is removed, as long as it has no children. Since nodes are
reference counted, it is a property of the stack trace tree that nodes
that are no longer pending and have no children pointing to them will be
automatically pruned from the tree.

If an async operation is canceled (e.g. cancelTimeout), the associated
node is marked as such. If the callback is not being dispatched at the
time, and has no children, it is removed.

Because async operations can be chained indefinitely, stack traces are
limited to a maximum depth. The depth of a stack trace is equal to the
sum of the depths of its nodes, with a node's depth equal to the number
of frames in its associated call stack. For any stack trace,

    S = { s𝟶, s𝟷, …, s𝑘 }, with endpoints s𝟶, s𝑘
    depth(S) = depth(s𝟶) + depth(s𝟷) + … + depth(s𝑘)

A stack trace is truncated when it exceeds the maximum depth. Truncation
occurs on node boundaries, not call frames, consequently the maximum depth
is more of a target than a guarantee:

    d = maximum stack trace depth
    for all S, depth(S) ≤ d + depth(s𝑘)

Because nodes can belong to multiple stack traces, it may be necessary
to clone the tail of a stack trace being truncated to prevent other traces
from being effected.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/AsyncStackTrace.cpp: Added.
(Inspector::AsyncStackTrace::create):
(Inspector::AsyncStackTrace::AsyncStackTrace):
(Inspector::AsyncStackTrace::~AsyncStackTrace):
(Inspector::AsyncStackTrace::isPending):
(Inspector::AsyncStackTrace::isLocked):
(Inspector::AsyncStackTrace::willDispatchAsyncCall):
(Inspector::AsyncStackTrace::didDispatchAsyncCall):
(Inspector::AsyncStackTrace::didCancelAsyncCall):
(Inspector::AsyncStackTrace::buildInspectorObject):
(Inspector::AsyncStackTrace::truncate):
(Inspector::AsyncStackTrace::remove):
* inspector/AsyncStackTrace.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::didScheduleAsyncCall):
(Inspector::InspectorDebuggerAgent::didCancelAsyncCall):
(Inspector::InspectorDebuggerAgent::willDispatchAsyncCall):
(Inspector::InspectorDebuggerAgent::didDispatchAsyncCall):
(Inspector::InspectorDebuggerAgent::didPause):
(Inspector::InspectorDebuggerAgent::clearAsyncStackTraceData):
(Inspector::InspectorDebuggerAgent::buildAsyncStackTrace): Deleted.
(Inspector::InspectorDebuggerAgent::refAsyncCallData): Deleted.
(Inspector::InspectorDebuggerAgent::derefAsyncCallData): Deleted.
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/protocol/Console.json:

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
Text for "Truncated" marker tree element.

* UserInterface/Models/StackTrace.js:
(WebInspector.StackTrace):
(WebInspector.StackTrace.fromPayload):
(WebInspector.StackTrace.prototype.get truncated):
Plumbing for new Console.StackTrace property `truncated`.

* UserInterface/Views/ThreadTreeElement.css:
(.tree-outline > .item.thread + ol > .item.truncated-call-frames):
(.tree-outline > .item.thread + ol > .item.truncated-call-frames .icon):
Styles for "Truncated" marker tree element.

* UserInterface/Views/ThreadTreeElement.js:
(WebInspector.ThreadTreeElement.prototype.refresh):
Append "Truncated" marker tree element if necessary.

* Versions/Inspector-iOS-10.3.json:

LayoutTests:

Add truncation test cases and cleanup call frame logging.

* inspector/debugger/async-stack-trace-expected.txt:
* inspector/debugger/async-stack-trace.html:
* inspector/debugger/resources/log-active-stack-trace.js: Added.
(TestPage.registerInitializer.window.getActiveStackTrace):
(TestPage.registerInitializer.logStackTrace.logCallFrame):
(TestPage.registerInitializer.):
(TestPage.registerInitializer.window.logActiveStackTrace):
(TestPage.registerInitializer):

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

2 years agoRemote Inspector: Listing should be updated when a target gains or loses a debugger...
commit-queue@webkit.org [Sun, 29 Jan 2017 00:39:45 +0000 (00:39 +0000)]
Remote Inspector: Listing should be updated when a target gains or loses a debugger session
https://bugs.webkit.org/show_bug.cgi?id=167449

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-28
Reviewed by Brian Burg.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::setupFailed):
(Inspector::RemoteInspector::updateTargetListing):
(Inspector::RemoteInspector::receivedSetupMessage):
(Inspector::RemoteInspector::receivedDidCloseMessage):
(Inspector::RemoteInspector::receivedConnectionDiedMessage):
Whenever we add/remove a connection we should update the listing properties
for that target that corresponded to that connection. In this way group
updating active sessions, the target, and pushing listing together.

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

2 years agoDon't flash a tap highlight for the entirety of an editable WKWebView
timothy_horton@apple.com [Sun, 29 Jan 2017 00:16:51 +0000 (00:16 +0000)]
Don't flash a tap highlight for the entirety of an editable WKWebView
https://bugs.webkit.org/show_bug.cgi?id=167486
<rdar://problem/30193996>

Reviewed by Dan Bernstein.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
Bail from providing a tap highlight if we are about to highlight
the entire body of an editable web view.

* dom/Document.h:
Export.

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

2 years agoCheck USE(APPLE_INTERNAL_SDK) instead of specific headers when importing from WebKitA...
wenson_hsieh@apple.com [Sat, 28 Jan 2017 23:13:17 +0000 (23:13 +0000)]
Check USE(APPLE_INTERNAL_SDK) instead of specific headers when importing from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=167555

Reviewed by Dan Bernstein.

Instead of guarding #import <WebKitAdditions/*> on the existence of the imported file, consult
USE(APPLE_INTERNAL_SDK) instead.

Source/WebCore:

* page/ios/EventHandlerIOS.mm:
* platform/ios/DragImageIOS.mm:
* platform/ios/PasteboardIOS.mm:
* platform/mac/DragDataMac.mm:

Source/WebKit2:

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:

Source/WTF:

* wtf/Platform.h:

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

2 years agoAdd Link Preload as an off-by-default experimental feature menu item.
yoav@yoav.ws [Sat, 28 Jan 2017 22:53:54 +0000 (22:53 +0000)]
Add Link Preload as an off-by-default experimental feature menu item.
https://bugs.webkit.org/show_bug.cgi?id=167201

Reviewed by Ryosuke Niwa.

Source/WebCore:

Removed the explicit setting of the Link Preload experimental feature,
as it is now on by default for testing.

No new tests as this just removes methods from settings.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences linkPreloadEnabled]):
(-[WebPreferences setLinkPreloadEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit/win:

* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::valueForKey):
(WebPreferences::setLinkPreloadEnabled):
(WebPreferences::linkPreloadEnabled):
* WebPreferences.h:
* Interfaces/IWebPreferencesPrivate.idl:

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetLinkPreloadEnabled):
(WKPreferencesGetLinkPreloadEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):

Websites/webkit.org:

* experimental-features.html: Added Link Preload.

LayoutTests:

Removed code explicitly enabling Link preload from the tests, as it is now
turned on by default for testing. Corrected expectation files accordingly.

* http/tests/fetch/redirectmode-and-preload.html:
* http/tests/preload/delaying_onload_link_preload_after_discovery.html:
* http/tests/preload/delaying_onload_link_preload_after_discovery_image.html:
* http/tests/preload/download_resources-expected.txt:
* http/tests/preload/download_resources.html:
* http/tests/preload/download_resources_from_header_iframe.html:
* http/tests/preload/download_resources_from_invalid_headers.html:
* http/tests/preload/dynamic_adding_preload.html:
* http/tests/preload/dynamic_remove_preload_href-expected.txt:
* http/tests/preload/dynamic_remove_preload_href.html:
* http/tests/preload/not_delaying_window_onload_before_discovery.html:
* http/tests/preload/onerror_event-expected.txt:
* http/tests/preload/onerror_event.html:
* http/tests/preload/onload_event-expected.txt:
* http/tests/preload/onload_event.html:
* http/tests/preload/resources/download_resources_from_header.php:
* http/tests/preload/resources/invalid_resources_from_header.php:
* http/tests/preload/single_download_preload-expected.txt:
* http/tests/preload/single_download_preload.html:
* http/tests/security/cached-cross-origin-preloaded-css-stylesheet.html:
* http/tests/security/cached-cross-origin-preloading-css-stylesheet.html:

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

2 years agoFix typo in error message
commit-queue@webkit.org [Sat, 28 Jan 2017 22:35:17 +0000 (22:35 +0000)]
Fix typo in error message
https://bugs.webkit.org/show_bug.cgi?id=167554

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-28
Reviewed by Sam Weinig.

* bindings/scripts/CodeGenerator.pm:
(GetEnumByType):

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

2 years ago[Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen...
commit-queue@webkit.org [Sat, 28 Jan 2017 18:16:41 +0000 (18:16 +0000)]
[Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen in media documents
https://bugs.webkit.org/show_bug.cgi?id=167552
<rdar://problem/29601646>

Patch by Antoine Quint <graouts@apple.com> on 2017-01-28
Reviewed by Eric Carlson.

Source/WebCore:

In the case of media documents, there is a built-in behavior, implemented in MediaDocument::defaultEventHandler(),
that toggles playback when clicking or double-clicking the video. We disable this behavior by adding a "click" event
handler on the entire media shadow root and calling "preventDefault()".

Test: media/modern-media-controls/media-documents/click-on-video-should-not-pause.html

* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._containerWasClicked):

LayoutTests:

Add a new test that checks that clicking on a <video> within a media document does not paused after being clicked.
Since this behavior uses click events, we use window.eventSender and skip this test on iOS.

* media/modern-media-controls/media-documents/click-on-video-should-not-pause-expected.txt: Added.
* media/modern-media-controls/media-documents/click-on-video-should-not-pause.html: Added.
* platform/ios-simulator/TestExpectations:

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

2 years ago[Xcode] Clean up PAL and WebCore’s build settings a little
mitz@apple.com [Sat, 28 Jan 2017 18:05:17 +0000 (18:05 +0000)]
[Xcode] Clean up PAL and WebCore’s build settings a little
https://bugs.webkit.org/show_bug.cgi?id=167292

Reviewed by Sam Weinig.

Source/WebCore:

* Configurations/Base.xcconfig: Simplified the definition of
  GCC_WARN_64_TO_32_BIT_CONVERSION, removed the unused build setting PREBINDING, removed
  a duplicate definition of GCC_GENERATE_DEBUGGING_SYMBOLS, and removed definitions specific
  to OS X versions that are no longer supported.

* Configurations/DebugRelease.xcconfig: Removed definitions specific to OS X versions
  that are no longer supported.

Source/WebCore/PAL:

* ChangeLog: Created this file.

* Configurations/Base.xcconfig: Simplified the definition of
  GCC_WARN_64_TO_32_BIT_CONVERSION, removed the unused build setting PREBINDING, removed
  a duplicate definition of GCC_GENERATE_DEBUGGING_SYMBOLS, and removed definitions specific
  to OS X versions that are no longer supported.

* Configurations/DebugRelease.xcconfig: Removed definitions specific to OS X versions
  that are no longer supported.

* Configurations/PAL.xcconfig: Removed header search paths that do not exist or do not
  make sense. Simplified the definitions of INSTALL_PATH and SKIP_INSTALL. Removed the
  unusued build settings PRODUCT_BUNDLE_IDENTIFIER and
  WK_PREFIXED_IPHONEOS_DEPLOYMENT_TARGET. Removed the redundant definition of
  EXECUTABLE_PREFIX.

* PAL.xcodeproj/project.pbxproj: Sorted the Configurations group.

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

2 years agoResolve beforeChild's render tree position before calling addChildIgnoringContinuation.
zalan@apple.com [Sat, 28 Jan 2017 16:26:48 +0000 (16:26 +0000)]
Resolve beforeChild's render tree position before calling addChildIgnoringContinuation.
https://bugs.webkit.org/show_bug.cgi?id=167540
<rdar://problem/30126535>

Reviewed by Simon Fraser.

Source/WebCore:

Use the actual render tree position for the beforeChild when inside a flow thread.

Test: fast/multicol/assert-on-continuation-with-spanner.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addChild):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChild):
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::resolveMovedChild):

LayoutTests:

* fast/multicol/assert-on-continuation-with-spanner-expected.txt: Added.
* fast/multicol/assert-on-continuation-with-spanner.html: Added.

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

2 years agoAvoid synchronous style recalc in dispatchUnloadEvents().
akling@apple.com [Sat, 28 Jan 2017 15:19:59 +0000 (15:19 +0000)]
Avoid synchronous style recalc in dispatchUnloadEvents().
<https://webkit.org/b/167551>

Reviewed by Antti Koivisto.

It shouldn't be necessary to force a synchronous style resolution in an unloading document.
This call has been here since the import of KHTMLPart.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchUnloadEvents):

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

2 years agoREGRESSION(r196383): Automatic shrink-to-fit of RuleSet no longer works.
akling@apple.com [Sat, 28 Jan 2017 12:16:23 +0000 (12:16 +0000)]
REGRESSION(r196383): Automatic shrink-to-fit of RuleSet no longer works.
<https://webkit.org/b/167543>

Reviewed by Antti Koivisto.

Re-enable the automatic shrink-to-fit optimization in RuleSet.
This was disabled accidentally, which I discovered while investigating
the memory footprint of extension stylesheets.

* css/RuleSet.h:

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

2 years agoGive scripts 'high' load priority
antti@apple.com [Sat, 28 Jan 2017 12:04:43 +0000 (12:04 +0000)]
Give scripts 'high' load priority
https://bugs.webkit.org/show_bug.cgi?id=167550

Reviewed by Andreas Kling.

For historical reasons it is currently 'medium', same as web fonts and some other non-parsing blocking things.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::defaultPriorityForResourceType):

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

2 years agoImport web-platform-tests/user-timing
joepeck@webkit.org [Sat, 28 Jan 2017 09:26:27 +0000 (09:26 +0000)]
Import web-platform-tests/user-timing
https://bugs.webkit.org/show_bug.cgi?id=167542
<rdar://problem/22746307>

Rubber-stamped by Ryosuke Niwa.

Only failures are ones where User Timing Level 2 differs
from User Timing Level 1.

* resources/ImportExpectations:
* web-platform-tests/user-timing/OWNERS: Added.
* web-platform-tests/user-timing/idlharness-expected.txt: Added.
* web-platform-tests/user-timing/idlharness.html: Added.
* web-platform-tests/user-timing/resources/w3c-import.log: Added.
* web-platform-tests/user-timing/resources/webperftestharness.js: Added.
* web-platform-tests/user-timing/resources/webperftestharnessextension.js: Added.
* web-platform-tests/user-timing/test_user_timing_clear_marks-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_clear_marks.html: Added.
* web-platform-tests/user-timing/test_user_timing_clear_measures-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_clear_measures.html: Added.
* web-platform-tests/user-timing/test_user_timing_entry_type-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_entry_type.html: Added.
* web-platform-tests/user-timing/test_user_timing_exists-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_exists.html: Added.
* web-platform-tests/user-timing/test_user_timing_mark-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_mark.html: Added.
* web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html: Added.
* web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.js: Added.
* web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_without_parameter-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_without_parameter.html: Added.
* web-platform-tests/user-timing/test_user_timing_mark_exceptions-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_mark_exceptions.html: Added.
* web-platform-tests/user-timing/test_user_timing_mark_with_name_of_navigation_timing_optional_attribute-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_mark_with_name_of_navigation_timing_optional_attribute.html: Added.
* web-platform-tests/user-timing/test_user_timing_measure-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_measure.html: Added.
* web-platform-tests/user-timing/test_user_timing_measure_exceptions-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_measure_exceptions.html: Added.
* web-platform-tests/user-timing/test_user_timing_measure_navigation_timing-expected.txt: Added.
* web-platform-tests/user-timing/test_user_timing_measure_navigation_timing.html: Added.
* web-platform-tests/user-timing/w3c-import.log: Added.

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

2 years agoAdd User Timing Experimental Feature
joepeck@webkit.org [Sat, 28 Jan 2017 09:26:14 +0000 (09:26 +0000)]
Add User Timing Experimental Feature
https://bugs.webkit.org/show_bug.cgi?id=167542
<rdar://problem/22746307>

Reviewed by Ryosuke Niwa.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::performanceTimelineEnabled):
* page/Performance.idl:
* page/PerformanceEntry.idl:
Make a better RuntimeEnabledFeature named "PerformanceTiming" which
is enabled if either UserTiming or ResourceTiming is enabled. This
will then expose the APIs that are only useful when at least one of
the APIs are available.

* page/PerformanceEntry.cpp:
(WebCore::PerformanceEntry::name): Deleted.
(WebCore::PerformanceEntry::entryType): Deleted.
(WebCore::PerformanceEntry::startTime): Deleted.
(WebCore::PerformanceEntry::duration): Deleted.
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::name):
(WebCore::PerformanceEntry::entryType):
(WebCore::PerformanceEntry::startTime):
(WebCore::PerformanceEntry::duration):
Inline simple accessors.

* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::measure):
Fix a bug introduced by ExceptionOr refactoring.

(WebCore::UserTiming::clearMarks):
(WebCore::UserTiming::clearMeasures):
(WebCore::clearPerformanceEntries):
(WebCore::clearPeformanceEntries): Deleted.
Fix method name typo.

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences userTimingEnabled]):
(-[WebPreferences setUserTimingEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
Add setting for User Timing runtime enabled feature.

Source/WebKit/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::setUserTimingEnabled):
(WebPreferences::userTimingEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):
Add setting for User Timing runtime enabled feature.

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetUserTimingEnabled):
(WKPreferencesGetUserTimingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Experimental feature. Off for now while we update ResourceTiming
and NavigationTiming to be compatible with Performance Timing 2.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):

Websites/webkit.org:

* experimental-features.html:

LayoutTests:

* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:
Update results now that experimental User Timing feature is enabled in tests.

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

2 years agoPatch Review: EWS Bubbles wrap to multiple lines but can fit on one line
joepeck@webkit.org [Sat, 28 Jan 2017 09:25:59 +0000 (09:25 +0000)]
Patch Review: EWS Bubbles wrap to multiple lines but can fit on one line
https://bugs.webkit.org/show_bug.cgi?id=167519

Reviewed by Ryosuke Niwa.

Tools:

* QueueStatusServer/templates/statusbubble.html:
To measure the bubbleContainer's width, it must not be wrapping based
on its parent container. So when measuring the width temporarily set
the parent to a very large width so as to not artificially wrap us.
Restore the parent's width after measuring.

Websites/bugs.webkit.org:

While we do post message to determine the size, the fact that we have
constrained the iframe to a size of 450px meant its body is 450px and
the div containing the bubbles wraps at 450px. Its full size (~458px)
is not returned. Although we solve this artifical constraint problem
inside of the bubble containerMetrics measuring, up this default value
from 450 to 460 to reduce UI jitter (the current measurement on my
machine is 458px).

* PrettyPatch/PrettyPatch.rb:

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

2 years ago<rdar://problem/30247736> WebKit2-7604.1.5 has failed to build: error: only virtual...
mitz@apple.com [Sat, 28 Jan 2017 08:02:16 +0000 (08:02 +0000)]
<rdar://problem/30247736> WebKit2-7604.1.5 has failed to build: error: only virtual member functions can be marked 'override'

* UIProcess/ios/PageClientImplIOS.h: Guard the declaration of requestPasswordForQuickLookDocument
  with USE(QUICK_LOOK) to match the base class.
* UIProcess/ios/PageClientImplIOS.mm: Guard the implementation as well.

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

2 years agoIgnore Xcode’s project.xcworkspace and userdata directories in this new project like...
mitz@apple.com [Sat, 28 Jan 2017 07:08:08 +0000 (07:08 +0000)]
Ignore Xcode’s project.xcworkspace and userdata directories in this new project like we do
in other projects.

Source/ThirdParty/libwebrtc:

* libwebrtc.xcodeproj: Added property svn:ignore.

Source/WebCore:

* PAL/PAL.xcodeproj: Added property svn:ignore.

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

2 years agoFix the iOS build when USE(QUICK_LOOK) is disabled.
aestes@apple.com [Sat, 28 Jan 2017 06:49:15 +0000 (06:49 +0000)]
Fix the iOS build when USE(QUICK_LOOK) is disabled.

* testing/Internals.cpp:
(WebCore::Internals::setQuickLookPassword):
* testing/Internals.h:

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

2 years ago[WK1] Do not prevent the drag client from initializing on Mac
wenson_hsieh@apple.com [Sat, 28 Jan 2017 05:08:31 +0000 (05:08 +0000)]
[WK1] Do not prevent the drag client from initializing on Mac
https://bugs.webkit.org/show_bug.cgi?id=167541

Reviewed by Dan Bernstein.

Fixes fallout from r211192. To ensure compability with WebKit clients, we need to ensure that WebDragClient is
initialized everywhere when creating a WebView. Stub out method implementations as no-ops for non-Mac platforms.
This caused certain clients, such as Mail, to crash when a webView closes due to  null dereference.

* WebCoreSupport/WebDragClient.mm:
(WebDragClient::WebDragClient):
(WebDragClient::actionMaskForDrag):
(WebDragClient::willPerformDragDestinationAction):
(WebDragClient::dragSourceActionMaskForPoint):
(WebDragClient::willPerformDragSourceAction):
(WebDragClient::startDrag):
(WebDragClient::declareAndWriteDragImage):
(WebDragClient::declareAndWriteAttachment):
* WebView/WebView.mm:
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

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

2 years ago[iOS] Add a test for _WKNSFileManagerExtras
aestes@apple.com [Sat, 28 Jan 2017 05:05:37 +0000 (05:05 +0000)]
[iOS] Add a test for _WKNSFileManagerExtras
https://bugs.webkit.org/show_bug.cgi?id=167478

Reviewed by Andreas Kling.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/NSFileManagerExtras.mm: Added.
(expectAttributes):
(TEST):

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

2 years ago[Cocoa] No way to get the text from a WKWebProcessPlugInRangeHandle
mitz@apple.com [Sat, 28 Jan 2017 04:50:48 +0000 (04:50 +0000)]
[Cocoa] No way to get the text from a WKWebProcessPlugInRangeHandle
https://bugs.webkit.org/show_bug.cgi?id=167535

Reviewed by Sam Weinig.

Added a text property to WKWebProcessPlugInRangeHandle.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Declare new property.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
(-[WKWebProcessPlugInRangeHandle text]): Added. Calls InjectedBundleRangeHandle::text.

* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::text): Added. Calls WebCore::Range::text.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:

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

2 years agoLift template escape sequence restrictions in tagged templates
utatane.tea@gmail.com [Sat, 28 Jan 2017 03:09:12 +0000 (03:09 +0000)]
Lift template escape sequence restrictions in tagged templates
https://bugs.webkit.org/show_bug.cgi?id=166871

Reviewed by Saam Barati.

JSTests:

Update the error messages and add new tests.

* ChakraCore/test/es6/unicode_6_identifier_Blue524737.baseline-jsc:
* stress/lift-template-literal.js: Added.
(dump):
(testTag.return.tag):
(testTag):
* stress/template-literal-syntax.js:

Source/JavaScriptCore:

This patch implements stage 3 Lifting Template Literal Restriction[1].
Prior to this patch, template literal becomes syntax error if it contains
invalid escape sequences. But it is too restricted; Template literal
can have cooked and raw representations and only cooked representation
can escape sequences. So even if invalid escape sequences are included,
the raw representation can be valid.

Lifting Template Literal Restriction relaxes the above restriction.
When invalid escape sequence is included, if target template literals
are used as tagged templates, we make the result of the template including
the invalid escape sequence `undefined` instead of making it SyntaxError
immediately. It allows us to accept the templates including invalid
escape sequences in the raw representations in tagged templates.

On the other hand, the raw representation is only used in tagged templates.
So if invalid escape sequences are included in the usual template literals,
we just make it SyntaxError as before.

[1]: https://github.com/tc39/proposal-template-literal-revision

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitGetTemplateObject):
* bytecompiler/NodesCodegen.cpp:
(JSC::TemplateStringNode::emitBytecode):
(JSC::TemplateLiteralNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createTemplateString):
* parser/Lexer.cpp:
(JSC::Lexer<CharacterType>::parseUnicodeEscape):
(JSC::Lexer<T>::parseTemplateLiteral):
(JSC::Lexer<T>::lex):
(JSC::Lexer<T>::scanTemplateString):
(JSC::Lexer<T>::scanTrailingTemplateString): Deleted.
* parser/Lexer.h:
* parser/NodeConstructors.h:
(JSC::TemplateStringNode::TemplateStringNode):
* parser/Nodes.h:
(JSC::TemplateStringNode::cooked):
(JSC::TemplateStringNode::raw):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentElement):
(JSC::Parser<LexerType>::parseTemplateString):
(JSC::Parser<LexerType>::parseTemplateLiteral):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/ParserTokens.h:
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createTemplateString):
* runtime/TemplateRegistry.cpp:
(JSC::TemplateRegistry::getTemplateObject):
* runtime/TemplateRegistryKey.h:
(JSC::TemplateRegistryKey::cookedStrings):
(JSC::TemplateRegistryKey::create):
(JSC::TemplateRegistryKey::TemplateRegistryKey):
* runtime/TemplateRegistryKeyTable.cpp:
(JSC::TemplateRegistryKeyTable::createKey):
* runtime/TemplateRegistryKeyTable.h:

LayoutTests:

Update the error messages.

* inspector/runtime/parse-expected.txt:
* js/unicode-escape-sequences-expected.txt:

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

2 years agoWeb Inspector: gradient editor should provide horizontal slider for 'angle' value...
commit-queue@webkit.org [Sat, 28 Jan 2017 02:27:56 +0000 (02:27 +0000)]
Web Inspector: gradient editor should provide horizontal slider for 'angle' value where applicable
https://bugs.webkit.org/show_bug.cgi?id=166937

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-27
Reviewed by Joseph Pecoraro.

* UserInterface/Views/GradientEditor.css:
(.gradient-editor):
(.gradient-editor > .gradient-angle):
(.gradient-editor > .gradient-angle > input[type="range"]):
(.gradient-editor > .gradient-angle > input[type="number"]):
(.gradient-editor > .gradient-angle > input::-webkit-inner-spin-button):
(.gradient-editor > .gradient-angle > input): Deleted.

* UserInterface/Views/GradientEditor.js:
(WebInspector.GradientEditor):
(WebInspector.GradientEditor.prototype.set gradient):
(WebInspector.GradientEditor.prototype.gradientSliderStopWasSelected):
(WebInspector.GradientEditor.prototype._gradientTypeChanged):
(WebInspector.GradientEditor.prototype._angleChanged):
(WebInspector.GradientEditor.prototype.dragToAdjustControllerWasAdjustedByAmount): Deleted.
(WebInspector.GradientEditor.prototype._angleInputValueDidChange): Deleted.
Remove the DragToAdjustController and replace with an <input type="range">.

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

2 years agoVersioning.
jmarcell@apple.com [Sat, 28 Jan 2017 01:50:28 +0000 (01:50 +0000)]
Versioning.

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

2 years agoMake the CLI for the sampling profiler better for inlined call site indices
sbarati@apple.com [Sat, 28 Jan 2017 01:04:06 +0000 (01:04 +0000)]
Make the CLI for the sampling profiler better for inlined call site indices
https://bugs.webkit.org/show_bug.cgi?id=167482

Reviewed by Mark Lam.

This patches changes the command line interface for the sampling
profiler to also dump the machine frame that the semantic code
origin is in if the semantic code origin is inlined. This helps
when doing performance work because it's helpful to know the
context that an inlined frame is in. Before, we used to just
say it was in the baseline JIT if it didn't have its own optimized
compile. Now, we can tell that its inlined into a DFG or FTL frame.

* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::buildSamples):
* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::processUnverifiedStackTraces):
(JSC::SamplingProfiler::reportTopFunctions):
(JSC::SamplingProfiler::reportTopBytecodes):
* runtime/SamplingProfiler.h:
(JSC::SamplingProfiler::StackFrame::CodeLocation::hasCodeBlockHash):
(JSC::SamplingProfiler::StackFrame::CodeLocation::hasBytecodeIndex):
(JSC::SamplingProfiler::StackFrame::CodeLocation::hasExpressionInfo):
(JSC::SamplingProfiler::StackFrame::hasExpressionInfo):
(JSC::SamplingProfiler::StackFrame::lineNumber):
(JSC::SamplingProfiler::StackFrame::columnNumber):
(JSC::SamplingProfiler::StackFrame::hasBytecodeIndex): Deleted.
(JSC::SamplingProfiler::StackFrame::hasCodeBlockHash): Deleted.

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

2 years agorun-benchmarks should make sure it passes the test url to the right application
keith_miller@apple.com [Sat, 28 Jan 2017 00:55:39 +0000 (00:55 +0000)]
run-benchmarks should make sure it passes the test url to the right application
https://bugs.webkit.org/show_bug.cgi?id=167533

Reviewed by Joseph Pecoraro.

This fixes an issue when trying to run-benchmark script with the
system default browser set to STP. Previously, it would run
the test in STP rather than the provided build. Now, it should run
in the provided build.

* Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
(OSXSafariDriver.launch_url):

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

2 years agosetTimeout / setInterval's string execution should inherit SourceOrigin correctly
utatane.tea@gmail.com [Sat, 28 Jan 2017 00:49:01 +0000 (00:49 +0000)]
setTimeout / setInterval's string execution should inherit SourceOrigin correctly
https://bugs.webkit.org/show_bug.cgi?id=167097

Reviewed by Darin Adler.

Source/WebCore:

Tests: js/dom/modules/import-from-set-interval.html
       js/dom/modules/import-from-set-timeout.html

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):

LayoutTests:

We set the default SourceOrigin for the ScriptController::executeScriptInWorld.
The default SourceOrigin has the document baseURL and CachedScriptFetcher.

setTimeout and setInterval use this interface. And it uses the default SourceOrigin
for the document (Realm of the setTimeout / setInterval). This is the expected
behavior in the dynamic import proposal.

* js/dom/modules/import-from-set-interval-expected.txt: Added.
* js/dom/modules/import-from-set-interval.html: Added.
* js/dom/modules/import-from-set-timeout-expected.txt: Added.
* js/dom/modules/import-from-set-timeout.html: Added.

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

2 years agoMerge CachedModuleScript and LoadableModuleScript
utatane.tea@gmail.com [Sat, 28 Jan 2017 00:47:30 +0000 (00:47 +0000)]
Merge CachedModuleScript and LoadableModuleScript
https://bugs.webkit.org/show_bug.cgi?id=167500

Reviewed by Darin Adler.

CachedModuleScript becomes duplicate with LoadableModuleScript.
And CachedModuleScript does not offer any meaningful functionality
to LoadableModuleScript.
This patch merges CachedModuleScript to LoadableModuleScript.

No behavior change.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CachedModuleScript.cpp: Removed.
* bindings/js/CachedModuleScript.h: Removed.
* bindings/js/CachedModuleScriptClient.h: Removed.
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::loadModuleScript):
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScript):
(WebCore::ScriptController::setupModuleScriptHandlers):
* bindings/js/ScriptController.h:
* dom/LoadableModuleScript.cpp:
(WebCore::LoadableModuleScript::create):
(WebCore::LoadableModuleScript::LoadableModuleScript):
(WebCore::LoadableModuleScript::~LoadableModuleScript):
(WebCore::LoadableModuleScript::isLoaded):
(WebCore::LoadableModuleScript::error):
(WebCore::LoadableModuleScript::wasCanceled):
(WebCore::LoadableModuleScript::notifyLoadCompleted):
(WebCore::LoadableModuleScript::notifyLoadFailed):
(WebCore::LoadableModuleScript::notifyLoadWasCanceled):
(WebCore::LoadableModuleScript::execute):
(WebCore::LoadableModuleScript::load):
(WebCore::LoadableModuleScript::notifyFinished): Deleted.
* dom/LoadableModuleScript.h:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::executeModuleScript):
* dom/ScriptElement.h:

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

2 years agoMove smartInsertDeleteEnabled to WebPageCreationParameters
achristensen@apple.com [Sat, 28 Jan 2017 00:33:17 +0000 (00:33 +0000)]
Move smartInsertDeleteEnabled to WebPageCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=167530

Reviewed by Brady Eidson.

* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::create):
(WebKit::WebPage::WebPage):
(WebKit::m_userInterfaceLayoutDirection):
(WebKit::WebPage::reinitializeWebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
* WebProcess/WebProcess.h:
Instead of making a WebPage then immediately sending it a message to set smartInsertDeleteEnabled,
just call setSmartInsertDeleteEnabled at the end of the WebPage creation.  No change in behaviour.

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

2 years agoAdd a simple demo for Touch stylus events
dino@apple.com [Sat, 28 Jan 2017 00:27:19 +0000 (00:27 +0000)]
Add a simple demo for Touch stylus events
https://bugs.webkit.org/show_bug.cgi?id=167534

Reviewed by Simon Fraser.

* demos/touch/stylus.html: Added.

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

2 years agoIconLoadingClient API doesn't work asynchronously.
beidson@apple.com [Sat, 28 Jan 2017 00:10:55 +0000 (00:10 +0000)]
IconLoadingClient API doesn't work asynchronously.
<rdar://problem/30243429> and https://bugs.webkit.org/show_bug.cgi?id=167532

Reviewed by Alex Christensen.

Make a WTF::Function (inherently not compatible with ObjC blocks as they must be copyable)
into a std::function, which is copyable.

* UIProcess/API/APIIconLoadingClient.h:
(API::IconLoadingClient::getLoadDecisionForIcon):

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

* UIProcess/Cocoa/IconLoadingDelegate.h:
* UIProcess/Cocoa/IconLoadingDelegate.mm:
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):

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

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

2 years agoJSCustomElementInterface::invokeCallback can be called with a null callback because...
msaboff@apple.com [Sat, 28 Jan 2017 00:03:36 +0000 (00:03 +0000)]
JSCustomElementInterface::invokeCallback can be called with a null callback because Weak<>
https://bugs.webkit.org/show_bug.cgi?id=167522

Reviewed by Filip Pizlo.

Added all provided callbacks to the global object with a private name the same way
that the constructor was added.  This will keep these callbacks from being GC'ed.

* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):

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

2 years ago[Cocoa] Prepare ComplexTextController for unit testing
mmaxfield@apple.com [Fri, 27 Jan 2017 23:56:58 +0000 (23:56 +0000)]
[Cocoa] Prepare ComplexTextController for unit testing
https://bugs.webkit.org/show_bug.cgi?id=167493

Reviewed by Simon Fraser.

Addressing post-review comments from Simon Fraser.

Source/WebCore:

* platform/graphics/FontCascade.h:
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::createForTesting):
* platform/graphics/mac/ComplexTextControllerCoreText.h:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):

Tools:

* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::TEST_F):

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

2 years agoTweak the test to avoid one pixel of difference on some hardware.
simon.fraser@apple.com [Fri, 27 Jan 2017 23:43:33 +0000 (23:43 +0000)]
Tweak the test to avoid one pixel of difference on some hardware.

* css3/filters/backdrop/backdrop-filter-uneven-corner-radii-expected.html:
* css3/filters/backdrop/backdrop-filter-uneven-corner-radii.html:

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

2 years agoExtend create_hash_table to specify Intrinsic
utatane.tea@gmail.com [Fri, 27 Jan 2017 23:29:26 +0000 (23:29 +0000)]
Extend create_hash_table to specify Intrinsic
https://bugs.webkit.org/show_bug.cgi?id=167505

Reviewed by Sam Weinig.

This patch extends create_hash_table to specify Intrinsic.
We can set Intrinsic in the static property table definition
in runtime/XXX.h.

And drop the adhoc code for String.fromCharCode in create_hash_table.

* create_hash_table:
* runtime/StringConstructor.cpp:

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

2 years agoElement with a backdrop-filter and a mask may not correctly mask the backdrop
simon.fraser@apple.com [Fri, 27 Jan 2017 23:16:17 +0000 (23:16 +0000)]
Element with a backdrop-filter and a mask may not correctly mask the backdrop
https://bugs.webkit.org/show_bug.cgi?id=167456
rdar://problem/29320059

Reviewed by Antoine Quint.

Source/WebCore:

If a layer had a backdrop filter, but also corner radii that triggered using a mask layer,
then the call to updateClippingStrategy() in GraphicsLayerCA::updateBackdropFiltersRect() would
set the backdrop layer's mask, but GraphicsLayerCA::updateMaskLayer() would promptly then set
the mask layer back to nil.

Fix by having GraphicsLayerCA::updateMaskLayer() put the mask on the structural layer, if there
is one. We always have a structural layer with backdrops, so this will mask both the layer
and the backdrop.

Test: css3/filters/backdrop/backdrop-filter-uneven-corner-radii.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateMaskLayer):
* platform/graphics/mac/WebLayer.mm:
(-[CALayer _descriptionWithPrefix:]): Dump the mask layer.

LayoutTests:

* css3/filters/backdrop/backdrop-filter-uneven-corner-radii-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-uneven-corner-radii.html: Added.

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

2 years agoFix remaining bad uses of logDiagnosticMessageWithValue()
cdumez@apple.com [Fri, 27 Jan 2017 23:11:17 +0000 (23:11 +0000)]
Fix remaining bad uses of logDiagnosticMessageWithValue()
https://bugs.webkit.org/show_bug.cgi?id=167526

Reviewed by Alex Christensen.

Source/WebCore:

Drop unused keys, add new ones.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
(WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
(WebCore::DiagnosticLoggingKeys::userZoomActionKey):
(WebCore::DiagnosticLoggingKeys::deltaKey): Deleted.
(WebCore::DiagnosticLoggingKeys::backNavigationKey): Deleted.
(WebCore::DiagnosticLoggingKeys::requestKey): Deleted.
(WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey): Deleted.
(WebCore::DiagnosticLoggingKeys::userKey): Deleted.
(WebCore::DiagnosticLoggingKeys::zoomedKey): Deleted.
(WebCore::DiagnosticLoggingKeys::notInCacheKey): Deleted.
* page/DiagnosticLoggingKeys.h:

Source/WebKit2:

Fix remaining bad uses of logDiagnosticMessageWithValue(). It can only
be called with numeric values.

* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
(WebKit::NetworkCache::Statistics::recordRetrievalFailure):
(WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::goToItem):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::willStartUserTriggeredZooming):

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

2 years agoProclaim that we are considering font-display, rhythmic sizing, and text decoration...
mmaxfield@apple.com [Fri, 27 Jan 2017 22:39:33 +0000 (22:39 +0000)]
Proclaim that we are considering font-display, rhythmic sizing, and text decoration level 4
https://bugs.webkit.org/show_bug.cgi?id=167340

Reviewed by Saam Barati.

* features.json:

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

2 years agomedia/track/track-in-band-style.html is flaky
jer.noble@apple.com [Fri, 27 Jan 2017 22:23:32 +0000 (22:23 +0000)]
media/track/track-in-band-style.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167516

Reviewed by Eric Carlson.

Update the test to use 'cuechange' rather than a 200ms timer.

* media/track/track-in-band-style-expected.txt:
* media/track/track-in-band-style.html:
* platform/mac/TestExpectations:

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

2 years agoFix diagnostic logging under loader/
cdumez@apple.com [Fri, 27 Jan 2017 21:07:57 +0000 (21:07 +0000)]
Fix diagnostic logging under loader/
https://bugs.webkit.org/show_bug.cgi?id=167512

Reviewed by Alex Christensen.

Fix diagnostic logging under loader/. We should not be using logDiagnosticLoggingWithValue()
without a numeric value.

* loader/ResourceLoader.cpp:
(WebCore::logResourceResponseSource):
* loader/SubresourceLoader.cpp:
(WebCore::logResourceLoaded):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::logMemoryCacheResourceRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::logRevalidation):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::memoryCacheEntryDecisionKey):
(WebCore::DiagnosticLoggingKeys::memoryCacheUsageKey):
(WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey):
(WebCore::DiagnosticLoggingKeys::resourceLoadedKey):
(WebCore::DiagnosticLoggingKeys::resourceResponseSourceKey):
* page/DiagnosticLoggingKeys.h:

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

2 years agoscanExternalRememberedSet needs to mergeIfNecessary
fpizlo@apple.com [Fri, 27 Jan 2017 21:01:50 +0000 (21:01 +0000)]
scanExternalRememberedSet needs to mergeIfNecessary
https://bugs.webkit.org/show_bug.cgi?id=167523

Reviewed by Keith Miller.

The protocol for opaque roots is that if you add to them outside of draining, then you need to call
mergeIfNecessary.

This means that every MarkingConstraint that adds opaque roots needs to mergeIfNecessary after.

scanExternalRememberedSet transitively calls addOpaqueRoot, is called from a MarkingConstraint, and
was missing a call to mergeIfNecessary. This fixes it.

* API/JSVirtualMachine.mm:
(scanExternalRememberedSet):

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

2 years agoFix diagnostic logging in media code
cdumez@apple.com [Fri, 27 Jan 2017 20:35:53 +0000 (20:35 +0000)]
Fix diagnostic logging in media code
https://bugs.webkit.org/show_bug.cgi?id=167510

Reviewed by Alex Christensen.

Fix diagnostic logging in media code. It should not use logDiagnosticMessageWithValue()
with a non-numeric value.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updatePlayState):

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

2 years agoRound CPU Usage diagnostic logging to 2 significant digits
cdumez@apple.com [Fri, 27 Jan 2017 20:33:12 +0000 (20:33 +0000)]
Round CPU Usage diagnostic logging to 2 significant digits
https://bugs.webkit.org/show_bug.cgi?id=167515
<rdar://problem/30236297>

Reviewed by Antti Koivisto.

Round CPU Usage diagnostic logging to 2 significant digits
as requested by diagnostic logging team.

* UIProcess/PerActivityStateCPUUsageSampler.cpp:
(WebKit::toStringRoundingSignificantFigures):
(WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):

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

2 years ago[Cocoa] Prepare ComplexTextController for unit testing
mmaxfield@apple.com [Fri, 27 Jan 2017 20:28:11 +0000 (20:28 +0000)]
[Cocoa] Prepare ComplexTextController for unit testing
https://bugs.webkit.org/show_bug.cgi?id=167493

Reviewed by Dean Jackson.

Source/WebCore:

ComplexTextController has three phases:
1. Interrogate Core Text about some text
2. Compute layout advances and paint advances from the information retrieved from
Core Text
3. Iterate through the layout advances or paint advances.

This patch tests phases 2 and 3 by chopping ComplexTextController between
phases 1 and 2, and injecting foreign metrics from a unit test. These metrics
have been gathered from real-world uses; however, a layout test is not appropriate
because the fonts which produced these metrics are not licensed appropriately.
The tests can enforce the correct behavior by using ComplexTextController's
public API.

This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=166013.
However, the fix for that bug is quite large, so I've split out this smaller piece
to ease the reviewing burden. The tests I've added are disabled for now (because
they fail), but will be enabled by the fix to that bug.

No new tests because there is no behavior change.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FontCascade.h:
* platform/graphics/FontDescription.h:
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::ComplexTextController):
(WebCore::ComplexTextController::finishConstruction):
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::createForTesting):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):

Tools:

Create four unit tests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp: Added.
(TestWebKitAPI::ComplexTextControllerTest::SetUp):
(TestWebKitAPI::TEST_F):

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

2 years agoLayoutTest fast/mediastream/getUserMedia-webaudio.html is flaky
commit-queue@webkit.org [Fri, 27 Jan 2017 19:37:05 +0000 (19:37 +0000)]
LayoutTest fast/mediastream/getUserMedia-webaudio.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167513

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-01-27

* TestExpectations: Not yet ready to run this test.

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

2 years agoSimple line layout: Do not bail out on -webkit-line-box-contain: block glyphs unless...
zalan@apple.com [Fri, 27 Jan 2017 19:24:26 +0000 (19:24 +0000)]
Simple line layout: Do not bail out on -webkit-line-box-contain: block glyphs unless text overflows vertically.
https://bugs.webkit.org/show_bug.cgi?id=167481
<rdar://problem/30180150>

Reviewed by Antti Koivisto.

Source/WebCore:

Since -webkit-line-box-contain: glyphs requires variable line height support, we can use simple line layout
only when each line happen to have the same height ('block' property value is set, glyphs do not overflow the block line height).

Test: fast/text/simple-line-layout-line-box-contain-glyphs.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForText):
(WebCore::SimpleLineLayout::canUseForFontAndText):
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::printReason):

LayoutTests:

* fast/text/simple-line-layout-line-box-contain-glyphs-expected.html: Added.
* fast/text/simple-line-layout-line-box-contain-glyphs.html: Added.

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

2 years agoFix PageCache diagnostic logging
cdumez@apple.com [Fri, 27 Jan 2017 19:14:57 +0000 (19:14 +0000)]
Fix PageCache diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167508

Reviewed by Sam Weinig.

Fix PageCache diagnostic logging. It should not call logDiagnosticMessageWithValue()
with a non-numeric value. Use logDiagnosticMessage() instead.

* history/PageCache.cpp:
(WebCore::logPageCacheFailureDiagnosticMessage):
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::pageCacheFailureKey):
(WebCore::DiagnosticLoggingKeys::successKey): Deleted.
(WebCore::DiagnosticLoggingKeys::failureKey): Deleted.
* page/DiagnosticLoggingKeys.h:

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

2 years agoStyles should not show background-repeat-x/y, or -webkit-mask-repeat-x/y
commit-queue@webkit.org [Fri, 27 Jan 2017 18:58:13 +0000 (18:58 +0000)]
Styles should not show background-repeat-x/y, or -webkit-mask-repeat-x/y
https://bugs.webkit.org/show_bug.cgi?id=167255

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-27
Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/css/css-property.html

* css/makeprop.pl:
(addProperty):
Add a generated function `isInternalCSSProperty` that checks the given CSSPropertyID against
a derived list of properties from CSSProperties.json with "internal-only".

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::styleWithProperties):
Only pass CSS property payloads to the frontend if they are not internal.

LayoutTests:

Checks that internal-only CSS properties are marked as invalid when passed to WebInspector.

* inspector/css/css-property-expected.txt: Added.
* inspector/css/css-property.html: Added.

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

2 years agoImplement Cache-control: immutable
antti@apple.com [Fri, 27 Jan 2017 18:44:18 +0000 (18:44 +0000)]
Implement Cache-control: immutable
https://bugs.webkit.org/show_bug.cgi?id=167497

Reviewed by Chris Dumez.

Source/WebCore:

Cache-control value 'immutable' indicates that a subresource does not change and so does not need to be
revalidated on a normal reload. This can significantly speed up reloads and reduce network traffic.

It is has been implemented in Firefox and is already used by Facebook.

https://tools.ietf.org/html/draft-mcmanus-immutable-00
https://hacks.mozilla.org/2017/01/using-immutable-caching-to-speed-up-the-web/

This patch implements Cache-control: immutable for memory cache only. A disk cache implementation
doesn't seem necessary as the resource is basically always expected to be in memory cache on reload.

Immutable is only supported for https as suggested by the draft specification (and Gecko implementation).

Test: http/tests/cache/cache-control-immutable-http.html
      http/tests/cache/cache-control-immutable-https.html

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::makeRevalidationDecision):

    On normal reloads (CachePolicyRevalidate) of https resources check for 'Cache-control: immutable'.
    If the resource is not expired don't revalidate it.

* platform/network/CacheValidation.cpp:
(WebCore::parseCacheControlDirectives):
* platform/network/CacheValidation.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::cacheControlContainsImmutable):
* platform/network/ResourceResponseBase.h:

LayoutTests:

* http/tests/cache/cache-control-immutable-http-expected.txt: Added.
* http/tests/cache/cache-control-immutable-http.html: Added.
* http/tests/cache/cache-control-immutable-https-expected.txt: Added.
* http/tests/cache/cache-control-immutable-https.html: Added.
* http/tests/cache/resources/cache-control-immutable.js: Added.
* http/tests/cache/resources/iframe-with-script.cgi: Added.

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

2 years ago[WebRTC] Use MediaEndPointPeerConnection if not using libwebrtc
commit-queue@webkit.org [Fri, 27 Jan 2017 18:20:01 +0000 (18:20 +0000)]
[WebRTC] Use MediaEndPointPeerConnection if not using libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167504

Patch by Youenn Fablet <youennf@gmail.com> on 2017-01-27
Reviewed by Alex Christensen.

No change of behavior.

* Modules/mediastream/MediaEndpointPeerConnection.cpp: If libwebrtc, we should use libwebrtc peer connection backend.

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

2 years agoRebaseline bindings tests after r211238.
ryanhaddad@apple.com [Fri, 27 Jan 2017 17:29:33 +0000 (17:29 +0000)]
Rebaseline bindings tests after r211238.

Unreviewed test gardening.

* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJIT::visitChildren):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::visitChildren):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::visitChildren):

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

2 years agoMarking media/modern-media-controls/layout-node/addChild.html as flaky.
ryanhaddad@apple.com [Fri, 27 Jan 2017 17:29:28 +0000 (17:29 +0000)]
Marking media/modern-media-controls/layout-node/addChild.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=167461

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[css-grid] Move Grid class out of RenderGrid
svillar@igalia.com [Fri, 27 Jan 2017 16:28:24 +0000 (16:28 +0000)]
[css-grid] Move Grid class out of RenderGrid
https://bugs.webkit.org/show_bug.cgi?id=167418

Reviewed by Antti Koivisto.

The RenderGrid should be able to use different implementations of
the Grid class. The latter is big enough to be in its own file. That
would help on the effort of moving the grid track sizing algorithm
out of RenderGrid too.

No new tests required as we're just moving code.

* CMakeLists.txt:
* rendering/Grid.cpp: Added.
(WebCore::Grid::Grid):
(WebCore::Grid::numTracks):
(WebCore::Grid::ensureGridSize):
(WebCore::Grid::insert):
(WebCore::Grid::setSmallestTracksStart):
(WebCore::Grid::smallestTrackStart):
(WebCore::Grid::gridItemArea):
(WebCore::Grid::setGridItemArea):
(WebCore::Grid::setAutoRepeatTracks):
(WebCore::Grid::autoRepeatTracks):
(WebCore::Grid::setAutoRepeatEmptyColumns):
(WebCore::Grid::setAutoRepeatEmptyRows):
(WebCore::Grid::hasAutoRepeatEmptyTracks):
(WebCore::Grid::isEmptyAutoRepeatTrack):
(WebCore::Grid::autoRepeatEmptyTracks):
(WebCore::Grid::gridItemSpan):
(WebCore::Grid::setNeedsItemsPlacement):
(WebCore::GridIterator::GridIterator):
(WebCore::GridIterator::nextGridItem):
(WebCore::GridIterator::isEmptyAreaEnough):
(WebCore::GridIterator::nextEmptyGridArea):
* rendering/Grid.h: Added.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
(WebCore::RenderGrid::Grid::numTracks): Deleted.
(WebCore::RenderGrid::Grid::ensureGridSize): Deleted.
(WebCore::RenderGrid::Grid::insert): Deleted.
(WebCore::RenderGrid::Grid::setSmallestTracksStart): Deleted.
(WebCore::RenderGrid::Grid::smallestTrackStart): Deleted.
(WebCore::RenderGrid::Grid::gridItemArea): Deleted.
(WebCore::RenderGrid::Grid::setGridItemArea): Deleted.
(WebCore::RenderGrid::Grid::setAutoRepeatTracks): Deleted.
(WebCore::RenderGrid::Grid::autoRepeatTracks): Deleted.
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyColumns): Deleted.
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyRows): Deleted.
(WebCore::RenderGrid::Grid::hasAutoRepeatEmptyTracks): Deleted.
(WebCore::RenderGrid::Grid::isEmptyAutoRepeatTrack): Deleted.
(WebCore::RenderGrid::Grid::autoRepeatEmptyTracks): Deleted.
(WebCore::RenderGrid::Grid::gridItemSpan): Deleted.
(WebCore::RenderGrid::Grid::setNeedsItemsPlacement): Deleted.
(WebCore::RenderGrid::GridIterator::GridIterator): Deleted.
(WebCore::RenderGrid::GridIterator::nextGridItem): Deleted.
(WebCore::RenderGrid::GridIterator::isEmptyAreaEnough): Deleted.
(WebCore::RenderGrid::GridIterator::nextEmptyGridArea): Deleted.
* rendering/RenderGrid.h:

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

2 years agoUnreviewed, update scroll snapping demos to use current Module 1 spec
wenson_hsieh@apple.com [Fri, 27 Jan 2017 15:58:05 +0000 (15:58 +0000)]
Unreviewed, update scroll snapping demos to use current Module 1 spec

* demos/scroll-snap/index.html:

Adopt the new CSS properties scroll-snap-type and scroll-snap-align.

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

2 years ago[Threaded Compositor] Stop creating the GLContext on demand the first time makeContex...
carlosgc@webkit.org [Fri, 27 Jan 2017 12:10:56 +0000 (12:10 +0000)]
[Threaded Compositor] Stop creating the GLContext on demand the first time makeContextCurrent is called
https://bugs.webkit.org/show_bug.cgi?id=167496

Reviewed by Žan Doberšek.

This is causing problems with animations when entering AC mode on demand. What happens is that the threaded
compositor is created, then the animation is scheduled and during the first animation iteration the GLContext is
created, making the first frame of the animation quite slow. In my computer creating the GLContext takes 0.8
seconds. If the animation duration is less than the time it takes to create the GLContext, the animation ends
without iterating. This causing timeouts in the bots in tests like
animations/animation-iteration-event-destroy-renderer.html that expect webkitAnimationIteration events that
never fire.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::ThreadedCompositor): Create the GLContext right after the compositing thread is
created if we already have a native surface handle.
(WebKit::ThreadedCompositor::createGLContext): Helper to create the GLContext.
(WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Create the GLContext when a native surface
handle is given.
(WebKit::ThreadedCompositor::makeContextCurrent): Deleted.
(WebKit::ThreadedCompositor::renderLayerTree): Make the context cunrrent directly here.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

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