WebKit-https.git
4 years agoComposited negative z-index elements are hidden behind the body sometimes
simon.fraser@apple.com [Sun, 27 Nov 2016 02:06:59 +0000 (02:06 +0000)]
Composited negative z-index elements are hidden behind the body sometimes
https://bugs.webkit.org/show_bug.cgi?id=165080
rdar://problem/22260229

Reviewed by Zalan Bujtas.

Source/WebCore:

If the <body> falls into the "directly composited background color" code path
(say, because it's composited because of composited negative z-index children,
and has content of its own), then we failed to take root background propagation
into account, and put the opaque root background color on the body's layer.

Fix by sharing some code from RenderBox related to whether the body's renderer
paints its background.

Tests cover the buggy case, and the case where the <html> has its own background color.

Tests: compositing/backgrounds/negative-z-index-behind-body-non-propagated.html
       compositing/backgrounds/negative-z-index-behind-body.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintsOwnBackground):
(WebCore::RenderBox::paintBackground):
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
(WebCore::skipBodyBackground): Deleted.
* rendering/RenderBox.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):

LayoutTests:

* compositing/backgrounds/negative-z-index-behind-body-expected.html: Added.
* compositing/backgrounds/negative-z-index-behind-body-non-propagated-expected.html: Added.
* compositing/backgrounds/negative-z-index-behind-body-non-propagated.html: Added.
* compositing/backgrounds/negative-z-index-behind-body.html: Added.

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

4 years agoConvert testharnessreport.js to LF linebreaks, from CRLF, which broke patches.
simon.fraser@apple.com [Sat, 26 Nov 2016 23:35:11 +0000 (23:35 +0000)]
Convert testharnessreport.js to LF linebreaks, from CRLF, which broke patches.

* resources/testharnessreport.js:
(convertResult):
(self.testRunner.add_completion_callback.):
(self.testRunner.add_completion_callback):

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

4 years agoAdd literals for various time units
simon.fraser@apple.com [Sat, 26 Nov 2016 23:21:39 +0000 (23:21 +0000)]
Add literals for various time units
https://bugs.webkit.org/show_bug.cgi?id=165074

Reviewed by Filip Pizlo.

Source/WTF:

Add _min, _s, _ms, _us and _ns literals for easy creation of Seconds from long double
and unsigned long long types (those allowed for custom literals).

Add minutes-related functions (there are one or two use cases in WebCore).

* wtf/Seconds.h:
(WTF::Seconds::minutes):
(WTF::Seconds::fromMinutes):
(WTF::Seconds::fromMilliseconds):
(WTF::Seconds::fromMicroseconds):
(WTF::Seconds::fromNanoseconds):
(WTF::operator _min):
(WTF::operator _s):
(WTF::operator _ms):
(WTF::operator _us):
(WTF::operator _ns):

Tools:

Add tests for new time literals. Add new tests for units.

* TestWebKitAPI/Tests/WTF/Time.cpp:
(TestWebKitAPI::TEST):

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

4 years agoFix compile warnings after r208415
ossy@webkit.org [Sat, 26 Nov 2016 00:17:19 +0000 (00:17 +0000)]
Fix compile warnings after r208415
https://bugs.webkit.org/show_bug.cgi?id=165061

Reviewed by Andy Estes.

* TestWebKitAPI/Tests/WTF/Time.cpp:
(TestWebKitAPI::TEST):

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

4 years ago[GTK] Follow-up fixes to r208974
mcatanzaro@igalia.com [Fri, 25 Nov 2016 18:38:15 +0000 (18:38 +0000)]
[GTK] Follow-up fixes to r208974
https://bugs.webkit.org/show_bug.cgi?id=164771

Unreviewed, implement Carlos's review feedback.

* UIProcess/API/gtk/WebKitNotification.cpp:
(webkit_notification_get_tag):
* UIProcess/API/gtk/WebKitNotificationProvider.cpp:
(WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
(WebKitNotificationProvider::show):
* UIProcess/API/gtk/WebKitNotificationProvider.h:

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

4 years ago[CSS Font Loading] FontFace.load() promises don't always fire
mmaxfield@apple.com [Fri, 25 Nov 2016 17:35:06 +0000 (17:35 +0000)]
[CSS Font Loading] FontFace.load() promises don't always fire
https://bugs.webkit.org/show_bug.cgi?id=165037

Reviewed by Simon Fraser.

Source/WebCore:

We currently handle web fonts in two phases. The first phase is building up
StyleRuleFontFace objects which reflect the style on the page. The second is creating
CSSFontFace objects from those StyleRuleFontFace objects. When script modifies the
style on the page, we can often update the CSSFontFace objects, but there are some
modifications which we don't know how to model. For these operations, we destroy the
CSSFontFace objects and rebuild them from the newly modified StyleRuleFontFace objects.

Normally, this is fine. However, with the CSS font loading API, the CSSFontFaces back
Javascript objects which will persist across the rebuilding step mentioned above. This
means that the FontFace objects need to adopt the new CSSFontFace objects and forget
the old CSSFontFace objects.

This gets a little tricky because the operation which caused the rebuild may actually
be a modification to the specific @font-face block which backs a Javascript FontFace
object. Because the CSSOM can be used to change the src: attribute of the FontFace
object, I decided in r201971 to clear the FontFace's promise in case an old load would
cause the promise to resolve. However, this would never happen because the old
CSSFontFace is unparented during the FontFace::adopt()ion of the new CSSFontFace.
Therefore, old loads may still complete, but the signal would never make it to the
FontFace and therefore would not cause the promise to resolve. In addition, clearing
the promise during a rebuild is problematic because that rebuild may be caused by
operations which have nothing to do with the specific FontFace object in question (so
the FontFace object should be observably uneffected.)

Because of the above reasons, this patch simply stops clearing the promise during the
rebuild phase.

Tests: fast/text/fontface-rebuild-during-loading.html
       fast/text/fontface-rebuild-during-loading-2.html

* css/FontFace.cpp:
(WebCore::FontFace::adopt):

LayoutTests:

* fast/text/fontfaceset-rebuild-during-loading-2-expected.txt: Added.
* fast/text/fontfaceset-rebuild-during-loading-2.html: Added.

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

4 years agoMemoryPressureHandler should only trigger synchronous GC on iOS
akling@apple.com [Fri, 25 Nov 2016 14:59:07 +0000 (14:59 +0000)]
MemoryPressureHandler should only trigger synchronous GC on iOS
<https://webkit.org/b/165043>
<rdar://problem/29312684>

Reviewed by Sam Weinig.

On iOS we know that there is really only one web process in play at a time,
so it's okay to do a synchronous GC immediately in response to high memory pressure.

On other platforms, we may have tens or hundreds of web processes, and if they
all start doing full GCs at the same time, it can easily bring a system to its knees
if it's already under pressure.

Fix this by using garbageCollectSoon() on non-iOS platforms.

* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):

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

4 years ago[GTK] Notifications API does not expose or respect the "tag" attribute
mcatanzaro@igalia.com [Thu, 24 Nov 2016 20:10:25 +0000 (20:10 +0000)]
[GTK] Notifications API does not expose or respect the "tag" attribute
https://bugs.webkit.org/show_bug.cgi?id=164771

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:

Expose a tag property on WebKitNotification. Ensure that any previous notification with the
same tag is closed when showing a new notification with that tag.

* UIProcess/API/gtk/WebKitNotification.cpp:
(webkit_notification_class_init):
(webkitNotificationCreate):
(webkit_notification_get_tag):
* UIProcess/API/gtk/WebKitNotification.h:
* UIProcess/API/gtk/WebKitNotificationProvider.cpp:
(WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
(WebKitNotificationProvider::show):
* UIProcess/API/gtk/WebKitNotificationProvider.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:

Tools:

Verify that showing a notification with the same tag as another notification closes the
previous notification before the new notification is shown.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewNotification):

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

4 years ago[css-grid] Convert grid representation into a class
svillar@igalia.com [Thu, 24 Nov 2016 15:08:11 +0000 (15:08 +0000)]
[css-grid] Convert grid representation into a class
https://bugs.webkit.org/show_bug.cgi?id=165042

Reviewed by Manuel Rego Casasnovas.

So far grids are represented as Vectors of Vectors. There are a couple of issues associated
to that decision. First or all, the source code in RenderGrid assumes the existence of that
data structure, meaning that we cannot eventually change it without changing a lot of
code. Apart from the coupling there is another issue, RenderGrid is full of methods to
access and manipulate that data structure.

Instead, it'd be much better to have a Grid class encapsulating both the data structures and
the methods required to access/manipulate it. Note that follow-up patches will move even
more data and procedures into this new class from the RenderGrid code.

No new tests required as this is a refactoring.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::ensureGridSize): Moved from RenderGrid.
(WebCore::RenderGrid::Grid::insert): Ditto.
(WebCore::RenderGrid::Grid::clear): Ditto.
(WebCore::RenderGrid::GridIterator::GridIterator):
(WebCore::RenderGrid::gridColumnCount): Use Grid's methods.
(WebCore::RenderGrid::gridRowCount): Ditto.
(WebCore::RenderGrid::placeItemsOnGrid): Use Grid's methods to insert children.
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Ditto.
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Ditto.
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Ditto.
(WebCore::RenderGrid::numTracks): Use Grid's methods.
(WebCore::RenderGrid::ensureGridSize): Deleted. Moved to Grid class.
(WebCore::RenderGrid::insertItemIntoGrid): Deleted. Moved to Grid class.
* rendering/RenderGrid.h:

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

4 years agoUnreviewed. Fix GTK+ test /webkit2/WebKitWebContext/get-plugins after r208429.
carlosgc@webkit.org [Thu, 24 Nov 2016 13:35:34 +0000 (13:35 +0000)]
Unreviewed. Fix GTK+ test /webkit2/WebKitWebContext/get-plugins after r208429.

Test plugin library was renamed as libTestNetscapePlugIn.so in r208429.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
(testWebContextGetPlugins): Update the library name.

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

4 years agoRemove unused bool return from Element::willRecalcStyle
antti@apple.com [Thu, 24 Nov 2016 12:54:00 +0000 (12:54 +0000)]
Remove unused bool return from Element::willRecalcStyle
https://bugs.webkit.org/show_bug.cgi?id=165059

Reviewed by Andreas Kling.

It is always true.

* dom/Element.cpp:
(WebCore::Element::willRecalcStyle):
* dom/Element.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::willRecalcStyle):
* html/HTMLFrameSetElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
* html/HTMLPlugInImageElement.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):
* svg/SVGElement.cpp:
(WebCore::SVGElement::willRecalcStyle):
* svg/SVGElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::willRecalcStyle):
* svg/SVGUseElement.h:

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

4 years agoRemove ENABLE_ASSEMBLER_WX_EXCLUSIVE code
zandobersek@gmail.com [Wed, 23 Nov 2016 09:37:58 +0000 (09:37 +0000)]
Remove ENABLE_ASSEMBLER_WX_EXCLUSIVE code
https://bugs.webkit.org/show_bug.cgi?id=165027

Reviewed by Darin Adler.

.:

* Source/cmake/WebKitFeatures.cmake: Remove the ENABLE_ASSEMBLER_WX_EXCLUSIVE option.

Source/JavaScriptCore:

Remove the code guarded with ENABLE(ASSEMBLER_WX_EXCLUSIVE).
No port enables this and the guarded code doesn't build at all,
so it's safe to say it's abandoned.

* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
(JSC::ExecutableAllocator::ExecutableAllocator):
(JSC::ExecutableAllocator::reprotectRegion): Deleted.

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

4 years ago[Mac] In Legacy WebKit, pressing an arrow key in editable content doesn’t hide the...
mitz@apple.com [Wed, 23 Nov 2016 04:05:21 +0000 (04:05 +0000)]
[Mac] In Legacy WebKit, pressing an arrow key in editable content doesn’t hide the mouse cursor
https://bugs.webkit.org/show_bug.cgi?id=165036
<rdar://problem/5708580>

Reviewed by Alexey Proskuryakov.

* WebView/WebHTMLView.mm:
(-[WebHTMLView performKeyEquivalent:]): Hide the cursor if WebCore handled the event,
  similarly to what we do in -keyDown: and to what WKWebView does with all key events.

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

4 years agoFix exception scope verification failures in JSC profiler files.
mark.lam@apple.com [Tue, 22 Nov 2016 20:52:05 +0000 (20:52 +0000)]
Fix exception scope verification failures in JSC profiler files.
https://bugs.webkit.org/show_bug.cgi?id=164971

Reviewed by Saam Barati.

* profiler/ProfilerBytecodeSequence.cpp:
(JSC::Profiler::BytecodeSequence::addSequenceProperties):
* profiler/ProfilerCompilation.cpp:
(JSC::Profiler::Compilation::toJS):
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::toJS):
(JSC::Profiler::Database::toJSON):
* profiler/ProfilerOSRExitSite.cpp:
(JSC::Profiler::OSRExitSite::toJS):
* profiler/ProfilerOriginStack.cpp:
(JSC::Profiler::OriginStack::toJS):

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

4 years agoCrashTracer: [USER] com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::Extens...
antti@apple.com [Tue, 22 Nov 2016 20:13:38 +0000 (20:13 +0000)]
CrashTracer: [USER] com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::ExtensionStyleSheets::pageUserSheet + 14
https://bugs.webkit.org/show_bug.cgi?id=165030

Reviewed by Darin Adler.

Source/WebCore:

We failed to reset the style scope when an element was moved to a different document. This could lead to having dangling
document pointers in style scope and style resolver.

Test: fast/shadow-dom/shadow-host-move-to-different-document.html

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::didMoveToNewDocument):

    Reset style scope.

* dom/ShadowRoot.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):

    Some more assertions.

* style/StyleScope.h:
(WebCore::Style::Scope::document):

LayoutTests:

* fast/shadow-dom/shadow-host-move-to-different-document-expected.html: Added.
* fast/shadow-dom/shadow-host-move-to-different-document.html: Added.

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

4 years agoFix exception scope verification failures in JSONObject.cpp.
mark.lam@apple.com [Tue, 22 Nov 2016 19:16:55 +0000 (19:16 +0000)]
Fix exception scope verification failures in JSONObject.cpp.
https://bugs.webkit.org/show_bug.cgi?id=165025

Reviewed by Saam Barati.

* runtime/JSONObject.cpp:
(JSC::gap):
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::stringify):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::Holder::appendNextProperty):
(JSC::Walker::walk):
(JSC::JSONProtoFuncParse):
(JSC::JSONProtoFuncStringify):
(JSC::JSONStringify):

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

4 years agoOne more tiny bit of follow-up.
darin@apple.com [Tue, 22 Nov 2016 18:43:53 +0000 (18:43 +0000)]
One more tiny bit of follow-up.

* wtf/text/TextBreakIterator.cpp:
(WTF::numCharactersInGraphemeClusters): Removed unneeded always-true check.

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

4 years agoQuick follow-up to previous patch.
darin@apple.com [Tue, 22 Nov 2016 18:35:03 +0000 (18:35 +0000)]
Quick follow-up to previous patch.

* wtf/text/TextBreakIterator.cpp:
(WTF::numCharactersInGraphemeClusters): Removed incorrect assertion.

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

4 years agoMake normal case fast in the input element limitString function
darin@apple.com [Tue, 22 Nov 2016 17:16:02 +0000 (17:16 +0000)]
Make normal case fast in the input element limitString function
https://bugs.webkit.org/show_bug.cgi?id=165023

Reviewed by Dan Bernstein.

Source/WebCore:

When running Speedometer, the limitLength function was showing up as hot.
Fixed a couple obvious problems with that function's performance.

* html/TextFieldInputType.cpp:
(WebCore::isASCIILineBreak): Deleted. The isHTMLLineBreak function does
the same thing, but faster.
(WebCore::limitLength): Added a FIXME comment explaining that the function
isn't really a good idea. Don't call through to numCharactersInGraphemeClusters
at all for 8-bit strings since we don't allow CR or LF characters in the string
anyway, so there are no grapheme clusters more than a single code unit. Removed
optimization when the length is the string's length that String::left already does.
(WebCore::TextFieldInputType::sanitizeValue): Use isHTMLLineBreak instead of
isASCIILineBreak.
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent): Ditto.

* platform/LocalizedStrings.cpp: Use auto a lot more rather than writing out
RetainPtr.
(WebCore::truncatedStringForLookupMenuItem): Removed unneeded special case for
empty strings. Removed unneeded string with the ellipsis character in it, since
the makeString function already knows how to append a character to a string.

* rendering/RenderText.cpp:
(WebCore::mapLineBreakToIteratorMode): Updated for change to LineBreakIteratorMode.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition): Ditto.

Source/WTF:

* wtf/text/LineBreakIteratorPoolICU.h: Removed many unneeded includes.
Simplified the class a bit, removing some extra definitions.
(WTF::LineBreakIteratorPool::sharedPool): Use NeverDestroyed instead of new.
(WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword): Reimplemented in
a simpler way without using StringBuilder. Also updated for change to
LineBreakIteratorMode.
(WTF::LineBreakIteratorPool::put): Use uncheckedAppend since the code is
careful to only use the inline capacity in the vector.

* wtf/text/TextBreakIterator.cpp: Moved some includes in here from the header.
(WTF::mapLineIteratorModeToRules): Updated for change to LineBreakIteratorMode.
(WTF::openLineBreakIterator): Ditto.
(WTF::numGraphemeClusters): Added a fast path for all 8-bit strings; don't
use ICU for that case, even if there is a CR character in it.
(WTF::numCharactersInGraphemeClusters): Added a fast path for strings that are
short enough to entirely fit without even looking at the characters; that's a
case we likely hit all the time. Also added a fast path for all 8-bit strings.

* wtf/text/TextBreakIterator.h: Changed LineBreakIteratorMode to be an enum
class and not repeat UAX14 in the names of the modes. Initialize data members
in the class definition rather than the constructors.

Tools:

* TestWebKitAPI/CMakeLists.txt: Added TextBreakIterator.cpp.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Ditto.
* TestWebKitAPI/Tests/WTF/TextBreakIterator.cpp: Added.
Contains some tests for the numGraphemeClusters and
numCharactersInGraphemeClusters functions that I used to make sure
that the new fast paths I added work correctly.

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

4 years ago[css-grid] Isolate size of internal representation from actual grid size
svillar@igalia.com [Tue, 22 Nov 2016 14:34:55 +0000 (14:34 +0000)]
[css-grid] Isolate size of internal representation from actual grid size
https://bugs.webkit.org/show_bug.cgi?id=165006

Reviewed by Manuel Rego Casasnovas.

RenderGrid has an internal representation of a grid used to place grid items, compute grid
positions, run the track sizing algorithm etc. That data structure normally has exactly the
same size as the actual grid specified using the grid-template-xxx properties (or any other
shorthand). But in some cases, like for example when the grid is empty, the internal data
structure does not really match the actual grid. In the particular case of empty grids no
memory allocations are done to create a grid representation as it is not needed.

From now on both gridColumnCount() and gridRowCount() will always return the size of the
data structure representing the grid whereas the newly added numTracks() will always return
the actual size of the grid.

This is the first required step of the process of isolating the data used by the grid track
sizing algorithm from the actual internal state of the LayoutGrid object.

No new tests as this is just a code refactoring.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridColumnCount): Always return the number of columns of the internal
data structure to represent the grid.
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Use the actual size of the grid to
create the GridSizingData structure.
(WebCore::RenderGrid::placeItemsOnGrid): Use the actual size of the grid to create the
GridSizingData structure.
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::numTracks): New method which returns the actual size of the grid.
* rendering/RenderGrid.h:

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

4 years ago[GTK] Fix introspection warning
svillar@igalia.com [Tue, 22 Nov 2016 11:14:44 +0000 (11:14 +0000)]
[GTK] Fix introspection warning
https://bugs.webkit.org/show_bug.cgi?id=165026

Reviewed by Michael Catanzaro.

This fixes an introspection annotation for a new API added in r208532.

* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkit_web_page_class_init):

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

4 years agoUnreviewed, add myself as a WebKit committer.
tpopela@redhat.com [Tue, 22 Nov 2016 11:09:11 +0000 (11:09 +0000)]
Unreviewed, add myself as a WebKit committer.

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

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

4 years ago[SOUP] Simplify custom protocols handler implementation
carlosgc@webkit.org [Tue, 22 Nov 2016 07:49:55 +0000 (07:49 +0000)]
[SOUP] Simplify custom protocols handler implementation
https://bugs.webkit.org/show_bug.cgi?id=164922

Reviewed by Michael Catanzaro.

We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
their own APIs and this is not used by WTR at all.

* PlatformEfl.cmake: Remove files from compilation.
* PlatformGTK.cmake: Ditto.
* Shared/API/c/WKBase.h:
* Shared/API/c/soup/WKBaseSoup.h: Removed.
* UIProcess/API/APICustomProtocolManagerClient.h: Added.
(API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
(API::CustomProtocolManagerClient::startLoading):
(API::CustomProtocolManagerClient::stopLoading):
(API::CustomProtocolManagerClient::invalidate):
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
* UIProcess/API/C/soup/WKContextSoup.h: Removed.
* UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
* UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
* UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
* UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
* UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
(EwkUrlSchemeRequest::EwkUrlSchemeRequest):
(EwkUrlSchemeRequest::finish):
(EwkUrlSchemeRequest::invalidate):
* UIProcess/API/efl/ewk_url_scheme_request_private.h:
(EwkUrlSchemeRequest::create):
(EwkUrlSchemeRequest::manager):
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
(attachCustomProtocolManagerClientToContext):
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
* UIProcess/API/gtk/WebKitPrivate.h:
* UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
* UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
(webkitURISchemeRequestCreate):
(webkitURISchemeRequestCancel):
(webkitURISchemeRequestGetManager):
(webkitURISchemeRequestInvalidate):
(webkitURISchemeRequestReadCallback):
(webkit_uri_scheme_request_finish_error):
* UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkitWebContextDispose):
(webkit_web_context_register_uri_scheme):
(webkitWebContextStartLoadingCustomProtocol):
(webkitWebContextInvalidateCustomProtocolRequests):
* UIProcess/API/gtk/WebKitWebContextPrivate.h:
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
* UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
(WebKit::CustomProtocolManagerProxy::processDidClose):
* UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
(WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
(WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
(WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
(WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
(WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
(WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
(WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
(WebKit::WebProcessPool::setCustomProtocolManagerClient):
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
* UIProcess/WebProcessPool.h:
* UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
(WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
(WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
* UIProcess/efl/RequestManagerClientEfl.h:
* UIProcess/efl/WebProcessPoolEfl.cpp:
* UIProcess/gtk/WebProcessPoolGtk.cpp:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
build the list of custom protocols to send to the network process.

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

4 years agoHasher::addCharacters() should be able to handle zero length strings.
mark.lam@apple.com [Tue, 22 Nov 2016 06:30:33 +0000 (06:30 +0000)]
Hasher::addCharacters() should be able to handle zero length strings.
https://bugs.webkit.org/show_bug.cgi?id=165024

Reviewed by Yusuke Suzuki.

Source/WTF:

Currently, it will fail to handle zero length strings if it has a pending
character.  The fix is simply to return early if length is 0.

* wtf/Hasher.h:
(WTF::StringHasher::addCharacters):

Tools:

* TestWebKitAPI/Tests/WTF/StringHasher.cpp:
(TestWebKitAPI::TEST):

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

4 years agoRemoved an extra space character at the end of line.
mark.lam@apple.com [Tue, 22 Nov 2016 03:35:25 +0000 (03:35 +0000)]
Removed an extra space character at the end of line.

Not reviewed.

* runtime/JSCell.cpp:
(JSC::JSCell::toNumber):

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

4 years agoFix exception scope verification failures in FunctionConstructor.cpp.
mark.lam@apple.com [Tue, 22 Nov 2016 02:05:27 +0000 (02:05 +0000)]
Fix exception scope verification failures in FunctionConstructor.cpp.
https://bugs.webkit.org/show_bug.cgi?id=165011

Reviewed by Saam Barati.

* runtime/FunctionConstructor.cpp:
(JSC::constructFunction):
(JSC::constructFunctionSkippingEvalEnabledCheck):

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

4 years agoFix exception scope verification failures in GetterSetter.cpp.
mark.lam@apple.com [Tue, 22 Nov 2016 02:04:52 +0000 (02:04 +0000)]
Fix exception scope verification failures in GetterSetter.cpp.
https://bugs.webkit.org/show_bug.cgi?id=165013

Reviewed by Saam Barati.

* runtime/GetterSetter.cpp:
(JSC::callGetter):
(JSC::callSetter):

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

4 years agoDisable #line markers in bison output on Windows
annulen@yandex.ru [Tue, 22 Nov 2016 01:57:30 +0000 (01:57 +0000)]
Disable #line markers in bison output on Windows
https://bugs.webkit.org/show_bug.cgi?id=164973

Reviewed by Darin Adler.

New bison versions since 3.0 have bug that causes unescaped paths
to be printed in #line directives. On Windows CMake passes absolute
paths to bison that have backslashes in them, leading to compiler
errors or warnings because of unrecognized escape sequences.

No new tests needed.

* css/makegrammar.pl:

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

4 years agoCrash in com.apple.JavaScriptCore: WTF::ThreadSpecific<WTF::WTFThreadData, + 142
utatane.tea@gmail.com [Mon, 21 Nov 2016 23:54:43 +0000 (23:54 +0000)]
Crash in com.apple.JavaScriptCore: WTF::ThreadSpecific<WTF::WTFThreadData, + 142
https://bugs.webkit.org/show_bug.cgi?id=164898

Reviewed by Darin Adler.

JSTests:

* stress/tagged-template-registry-key-collect.js: Added.
(shouldBe):
(tag):
(i.eval):
* stress/tagged-template-registry-key.js: Added.
(shouldBe):
(tag):
(a):
(b):

Source/JavaScriptCore:

The callsite object (JSArray) of tagged template literal is managed by WeakGCMap since
same tagged template literal need to return an identical object.
The problem is that we used TemplateRegistryKey as the key of the WeakGCMap. WeakGCMap
can prune its entries in the collector thread. At that time, this TemplateRegistryKey
is deallocated. Since it includes String (and then, StringImpl), we accidentally call
ref(), deref() and StringImpl::destroy() in the different thread from the main thread
while this TemplateRegistryKey is allocated in the main thread.

Instead, we use TemplateRegistryKey* as the key of WeakGCMap. Then, to keep its liveness
while the entry of the WeakGCMap is alive, the callsite object has the reference to
the JSTemplateRegistryKey. And it holds Ref<TemplateRegistryKey>.

And now we need to lookup WeakGCMap with TemplateRegistryKey*. To do so, we create
interning system for TemplateRegistryKey. It is similar to AtomicStringTable and
SymbolRegistry. TemplateRegistryKey is allocated from this table. This table atomize the
TemplateRegistryKey. So we can use the pointer comparison between TemplateRegistryKey.
It allows us to lookup the entry from WeakGCMap by TemplateRegistryKey*.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addTemplateRegistryKeyConstant):
(JSC::BytecodeGenerator::emitGetTemplateObject):
* bytecompiler/BytecodeGenerator.h:
* runtime/JSGlobalObject.cpp:
(JSC::getTemplateObject):
* runtime/JSTemplateRegistryKey.cpp:
(JSC::JSTemplateRegistryKey::JSTemplateRegistryKey):
(JSC::JSTemplateRegistryKey::create):
* runtime/JSTemplateRegistryKey.h:
* runtime/TemplateRegistry.cpp:
(JSC::TemplateRegistry::getTemplateObject):
* runtime/TemplateRegistry.h:
* runtime/TemplateRegistryKey.cpp: Copied from Source/JavaScriptCore/runtime/TemplateRegistry.h.
(JSC::TemplateRegistryKey::~TemplateRegistryKey):
* runtime/TemplateRegistryKey.h:
(JSC::TemplateRegistryKey::calculateHash):
(JSC::TemplateRegistryKey::create):
(JSC::TemplateRegistryKey::TemplateRegistryKey):
* runtime/TemplateRegistryKeyTable.cpp: Added.
(JSC::TemplateRegistryKeyTranslator::hash):
(JSC::TemplateRegistryKeyTranslator::equal):
(JSC::TemplateRegistryKeyTranslator::translate):
(JSC::TemplateRegistryKeyTable::~TemplateRegistryKeyTable):
(JSC::TemplateRegistryKeyTable::createKey):
(JSC::TemplateRegistryKeyTable::unregister):
* runtime/TemplateRegistryKeyTable.h: Copied from Source/JavaScriptCore/runtime/JSTemplateRegistryKey.h.
(JSC::TemplateRegistryKeyTable::KeyHash::hash):
(JSC::TemplateRegistryKeyTable::KeyHash::equal):
* runtime/VM.h:
(JSC::VM::templateRegistryKeyTable):

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

4 years agoFix exception scope verification failures in runtime/Error* files.
mark.lam@apple.com [Mon, 21 Nov 2016 23:24:18 +0000 (23:24 +0000)]
Fix exception scope verification failures in runtime/Error* files.
https://bugs.webkit.org/show_bug.cgi?id=164998

Reviewed by Darin Adler.

* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::create):
* runtime/ErrorInstance.h:
* runtime/ErrorPrototype.cpp:
(JSC::errorProtoFuncToString):

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

4 years ago[CMake] build fails after update to cmake 3.7
clopez@igalia.com [Mon, 21 Nov 2016 20:32:42 +0000 (20:32 +0000)]
[CMake] build fails after update to cmake 3.7
https://bugs.webkit.org/show_bug.cgi?id=165008

Reviewed by Dan Bernstein.

When we remove the CMake cache, we should remove both the
CMakeCache.txt file and the CMakeFiles directory.
See: https://gitlab.kitware.com/cmake/cmake/issues/14820

* Scripts/webkitdirs.pm:
(cmakeFilesPath):
(removeCMakeCache):

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

4 years agoFix exception scope verification failures in *Executable.cpp files.
mark.lam@apple.com [Mon, 21 Nov 2016 17:19:30 +0000 (17:19 +0000)]
Fix exception scope verification failures in *Executable.cpp files.
https://bugs.webkit.org/show_bug.cgi?id=164996

Reviewed by Darin Adler.

* runtime/DirectEvalExecutable.cpp:
(JSC::DirectEvalExecutable::create):
* runtime/IndirectEvalExecutable.cpp:
(JSC::IndirectEvalExecutable::create):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::prepareForExecutionImpl):

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

4 years agoFix Sierra CMake build after r208452
achristensen@apple.com [Mon, 21 Nov 2016 16:58:00 +0000 (16:58 +0000)]
Fix Sierra CMake build after r208452
https://bugs.webkit.org/show_bug.cgi?id=164437

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView updateMediaTouchBar]):
I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
It's needed for playbackSessionInterface to exist.

Source/WebKit2:

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateMediaTouchBar):
I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
It's needed for WebPlaybackSessionInterfaceMac to exist.

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

4 years ago[cmake][OpenWebRTC] Move SDPProcessorScriptResource rules to common WebCore
commit-queue@webkit.org [Mon, 21 Nov 2016 16:25:49 +0000 (16:25 +0000)]
[cmake][OpenWebRTC] Move SDPProcessorScriptResource rules to common WebCore
https://bugs.webkit.org/show_bug.cgi?id=164937

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-11-21
Reviewed by Youenn Fablet.

SDPProcessorScriptResource has been moved in common mediastream directory (bug 163940).

Since it is not specific to the GTK port, the matching cmake rules should be
moved out from PlatformGTK.cmake to the main WebCore CMakeLists.txt.

This is needed to build OpenWebRTC support in other ports, WPE in my case,
probably Mac, EFL and Qt as well.

This also fixes the path in SDP scripts dependencies, the old openwebrtc subdir
was still being used.

No new tests, build fix only

* CMakeLists.txt:
* PlatformGTK.cmake:

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

4 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.
carlosgc@webkit.org [Mon, 21 Nov 2016 11:18:10 +0000 (11:18 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit2:

* gtk/NEWS: Add release notes for 2.15.2.

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

4 years agoAdd URL::hostAndPort()
carlosgc@webkit.org [Mon, 21 Nov 2016 10:04:01 +0000 (10:04 +0000)]
Add URL::hostAndPort()
https://bugs.webkit.org/show_bug.cgi?id=164907

Reviewed by Alex Christensen.

As a convenient way of getting the host and port (if any) as a string.

* html/URLUtils.h:
(WebCore::URLUtils<T>::host): Use URL::hostAndPort().
* page/Location.cpp:
(WebCore::Location::host): Ditto.
* platform/URL.cpp:
(WebCore::URL::hostAndPort): Return host:port or just host if there isn't a port.
* platform/URL.h:
* platform/network/CredentialStorage.cpp:
(WebCore::originStringFromURL): Use URL::hostAndPort().
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::host): Ditto.

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

4 years ago[WebRTC][OpenWebRTC] parse turns urls
philn@webkit.org [Mon, 21 Nov 2016 09:41:29 +0000 (09:41 +0000)]
[WebRTC][OpenWebRTC] parse turns urls
https://bugs.webkit.org/show_bug.cgi?id=164587

Reviewed by Alejandro G. Castro.

* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
Hook turns servers between the RTCConfiguration and the underlying
OpenWebRTC layer.

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

4 years ago[Gstreamer] Add volume and mute support to the WebRTC mediaplayer
philn@webkit.org [Mon, 21 Nov 2016 09:39:26 +0000 (09:39 +0000)]
[Gstreamer] Add volume and mute support to the WebRTC mediaplayer
https://bugs.webkit.org/show_bug.cgi?id=153828

Reviewed by Darin Adler.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::setVolume): New implementation setting the OWR source volume property.
(WebCore::MediaPlayerPrivateGStreamerOwr::setMuted): New implementation setting the OWR source mute property.
(WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState): Also set audio OWR source mute state depending on the track enabled state.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged): chain to maybeHandleChangeMuteState.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:

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

4 years ago[WebRTC][OpenWebRTC] RTP bundling support
philn@webkit.org [Mon, 21 Nov 2016 09:29:22 +0000 (09:29 +0000)]
[WebRTC][OpenWebRTC] RTP bundling support
https://bugs.webkit.org/show_bug.cgi?id=162333

Reviewed by Alejandro G. Castro.

Configure the OpenWebRTC transport agent bundle policy according
to the RTCConfiguration and pass the receive SSRCs over to
OpenWebRTC as well. Those are needed so the agent is aware of the
bundle layout.

* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::updateReceiveConfiguration):
(WebCore::MediaEndpointOwr::updateSendConfiguration):
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):

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

4 years agoRemove m_customProtocolManagerProxy from WebProcessProxy
carlosgc@webkit.org [Mon, 21 Nov 2016 09:24:45 +0000 (09:24 +0000)]
Remove m_customProtocolManagerProxy from WebProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=164908

Reviewed by Andreas Kling.

Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can
be removed.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
* UIProcess/WebProcessProxy.h:

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

4 years ago[GTK][WebRTC] Switch to downstream OpenWebRTC and more recent GStreamer
philn@webkit.org [Mon, 21 Nov 2016 08:09:03 +0000 (08:09 +0000)]
[GTK][WebRTC] Switch to downstream OpenWebRTC and more recent GStreamer
https://bugs.webkit.org/show_bug.cgi?id=164817

Reviewed by Alejandro G. Castro.

This is temporary, hopefully. The OpenWebRTC patches will/should
be soon reviewed and upstream but meanwhile it makes sense to use
the Igalia downstream fork so that the WebRTC testing is easier.

Recent GStreamer patches are also needed for RTP bundling support
and RTP retransmission fixes.

* gtk/jhbuild.modules:
* gtk/openwebrtc.modules: Removed.
* gtk/patches/gst-plugins-good-0001-rtpbin-pipeline-gets-an-EOS-when-any-rtpsources-byes.patch: Added.
* gtk/patches/gst-plugins-good-0002-rtpbin-avoid-generating-errors-when-rtcp-messages-ar.patch: Added.
* gtk/patches/gst-plugins-good-0003-rtpbin-receive-bundle-support.patch: Added.

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

4 years ago[EncryptedMedia] Make EME API runtime-enabled
zandobersek@gmail.com [Mon, 21 Nov 2016 06:22:39 +0000 (06:22 +0000)]
[EncryptedMedia] Make EME API runtime-enabled
https://bugs.webkit.org/show_bug.cgi?id=164927

Reviewed by Jer Noble.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h: Add the necessary identifiers.

Source/WebCore:

Update the EME API IDL definitions to use the EnabledAtRuntime
attribute on the relevant interfaces, attributes and operations.
EncryptedMediaAPI is used as the attribute value.

The corresponding getter, setter and member boolean are added to
the RuntimeEnabledFeatures class.

* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeyStatusMap.idl:
* Modules/encryptedmedia/MediaKeySystemAccess.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/NavigatorEME.idl:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setEncryptedMediaAPIEnabled):
(WebCore::RuntimeEnabledFeatures::encryptedMediaAPIEnabled):
* html/HTMLMediaElement.idl:
* html/MediaEncryptedEvent.idl:

Source/WebKit2:

Add the new EncryptedMediaAPI preference. Set the same feature
flag on the shared RuntimeEnabledFeatures object to the
corresponding value that's stored in the WebPreferencesStore.

InjectedBundle::overrideBoolPreferenceForTestRunner() does the
same when the 'WebKitEncryptedMediaAPIEnabled' preference is
overridden in WKTR for testing purposes.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Enable the EME API via the WKTR InjectedBundle whenever testing
commences. This does not have any effect unless the EME feature
is enabled at compile-time, but it's still added to match other
features and for future use.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setEncryptedMediaAPIEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

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

4 years agoREGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky...
eric.carlson@apple.com [Mon, 21 Nov 2016 04:38:42 +0000 (04:38 +0000)]
REGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=164715
<rdar://problem/29277180>

Reviewed by Alexey Proskuryakov.

No new tests, fixes an existing test crash.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::contextDestroyed): Call base class method before clearing m_controller
  because it nullifies the security context.

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

4 years agoFix exception scope verification failures in ConstructData.cpp.
mark.lam@apple.com [Mon, 21 Nov 2016 01:34:20 +0000 (01:34 +0000)]
Fix exception scope verification failures in ConstructData.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164976

Reviewed by Darin Adler.

* runtime/ConstructData.cpp:
(JSC::construct):

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

4 years agoFix exception scope verification failures in CommonSlowPaths.cpp/h.
mark.lam@apple.com [Mon, 21 Nov 2016 01:33:09 +0000 (01:33 +0000)]
Fix exception scope verification failures in CommonSlowPaths.cpp/h.
https://bugs.webkit.org/show_bug.cgi?id=164975

Reviewed by Darin Adler.

* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::opIn):

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

4 years agoFix exception scope verification failures in DateConstructor.cpp and DatePrototype...
mark.lam@apple.com [Mon, 21 Nov 2016 01:31:20 +0000 (01:31 +0000)]
Fix exception scope verification failures in DateConstructor.cpp and DatePrototype.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164995

Reviewed by Darin Adler.

* runtime/DateConstructor.cpp:
(JSC::millisecondsFromComponents):
(JSC::constructDate):
* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToPrimitiveSymbol):

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

4 years agoAdd iOS text selection tests - long press clear and multi line selection tests
commit-queue@webkit.org [Mon, 21 Nov 2016 00:57:27 +0000 (00:57 +0000)]
Add iOS text selection tests - long press clear and multi line selection tests
https://bugs.webkit.org/show_bug.cgi?id=164899

Patch by Megan Gardner <megan_gardner@apple.com> on 2016-11-20
Reviewed by Darin Adler.

Test for clearing a selection after a long press.
Test for checking multi-line select, both increasing and decreasing, using the left selection.
Test for checking multi-line select, both increasing and decreasing, using the right selection.

* fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text-expected.txt: Added.
* fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html: Added.
* fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-expected.txt: Added.
* fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html: Added.
* fast/events/touch/ios/long-press-to-select-and-tap-to-clear-expected.txt: Added.
* fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html: Added.

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

4 years ago[JSC] speed up parsing of async functions
caitp@igalia.com [Sun, 20 Nov 2016 08:58:05 +0000 (08:58 +0000)]
[JSC] speed up parsing of async functions
https://bugs.webkit.org/show_bug.cgi?id=164808

Reviewed by Yusuke Suzuki.

JSTests:

Add tests for line terminator following "async" keyword in async
function syntax.

* stress/async-await-syntax.js:
(shouldBe):

Source/JavaScriptCore:

Minor adjustments to Parser in order to mitigate slowdown with async
function parsing enabled:

  - Tokenize "async" as a keyword
  - Perform less branching in various areas of the Parser

* parser/Keywords.table:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::maybeParseAsyncFunctionDeclarationStatement):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::createResolveAndUseVariable):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):
(JSC::Parser<LexerType>::printUnexpectedTokenText):
* parser/Parser.h:
(JSC::isAnyContextualKeyword):
(JSC::isIdentifierOrAnyContextualKeyword):
(JSC::isSafeContextualKeyword):
(JSC::Parser::matchSpecIdentifier):
* parser/ParserTokens.h:
* runtime/CommonIdentifiers.h:

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

4 years agoop_mod-* JSC tests needs a longer timeout too.
mark.lam@apple.com [Sun, 20 Nov 2016 03:29:44 +0000 (03:29 +0000)]
op_mod-* JSC tests needs a longer timeout too.
https://bugs.webkit.org/show_bug.cgi?id=164994

Reviewed by Yusuke Suzuki.

* stress/op_mod-ConstVar.js:
* stress/op_mod-VarConst.js:
* stress/op_mod-VarVar.js:

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

4 years agoSalt network cache hashes
antti@apple.com [Sun, 20 Nov 2016 00:38:09 +0000 (00:38 +0000)]
Salt network cache hashes
https://bugs.webkit.org/show_bug.cgi?id=164924

Reviewed by Alex Christensen.

To enhance privacy make cache content unidentifiable from file names alone.
This is done by generating a unique persistent salt for each cache instance.
It is used when computing hashes used in file names.

The patch also replaces plain text partition directory names with salted hashes.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeCacheKey):
(WebKit::NetworkCache::makeCacheKey): Deleted.
* NetworkProcess/cache/NetworkCache.h:

    Increment cache version.

* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::BlobStorage):
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::get):

    Use salt for blob content hash.

* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::computeSHA1):

    For simplicity all SHA1s are now salted.

(WebKit::NetworkCache::makeSalt):
(WebKit::NetworkCache::readOrMakeSalt):

    Read salt if it exists, generate and persist it otherwise.

* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::Key):

    Remove the "No partition" string and just empty.
    That was only needed to have a directory name of some sort.

(WebKit::NetworkCache::Key::computeHash):

    Use salt for key hash.

(WebKit::NetworkCache::Key::computePartitionHash):

    Separate hash for partition.

* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::makeSubresourcesKey):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeSaltFilePath):
(WebKit::NetworkCache::Storage::open):

    Cache can't be opened if we can't read or persist a salt.

(WebKit::NetworkCache::traverseRecordsFiles):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey):

    Use the partition hash in the directory name instead of a plain text name.

(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::salt):

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

4 years agoUpdate HTML form validation messages
cdumez@apple.com [Sat, 19 Nov 2016 21:22:13 +0000 (21:22 +0000)]
Update HTML form validation messages
https://bugs.webkit.org/show_bug.cgi?id=164957
<rdar://problem/29338669>

Reviewed by Darin Adler.

Source/WebCore:

Update HTML form validation messages as per recent feedback:
- Drop the "Please".
- Drop the period at the end.
- Drop the "if you want to proceed" that was used only for the checkbox.

No new tests, rebaselined existing tests.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::validationMessageValueMissingText):
(WebCore::validationMessageValueMissingForCheckboxText):
(WebCore::validationMessageValueMissingForFileText):
(WebCore::validationMessageValueMissingForRadioText):
(WebCore::validationMessageValueMissingForSelectText):
(WebCore::validationMessageTypeMismatchText):
(WebCore::validationMessageTypeMismatchForEmailText):
(WebCore::validationMessageTypeMismatchForURLText):
(WebCore::validationMessagePatternMismatchText):
(WebCore::validationMessageTooShortText):
(WebCore::validationMessageTooLongText):
(WebCore::validationMessageRangeUnderflowText):
(WebCore::validationMessageRangeOverflowText):
(WebCore::validationMessageStepMismatchText):
(WebCore::validationMessageBadInputForNumberText):

LayoutTests:

Rebaseline existing tests.

* fast/forms/number/number-validation-message-expected.txt:
* fast/forms/number/number-validation-message.html:
* fast/forms/validation-custom-message-expected.txt:
* fast/forms/validation-custom-message.html:
* fast/forms/validation-messages-expected.txt:
* fast/forms/validation-messages.html:
* fast/forms/validationMessage-expected.txt:

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

4 years agoAX: [ATK] Implement selection interface and states for elements supporting aria-selec...
jdiggs@igalia.com [Sat, 19 Nov 2016 21:12:24 +0000 (21:12 +0000)]
AX: [ATK] Implement selection interface and states for elements supporting aria-selected and for menu roles
https://bugs.webkit.org/show_bug.cgi?id=164865

Reviewed by Chris Fleizach.

Source/WebCore:

Implement AtkSelection and support ATK_STATE_SELECTABLE and ATK_STATE_SELECTED
for elements supporting aria-selected and for menu-related roles. Also enable the
equivalent support for the Mac because NSAccessibilitySelectedChildrenAttribute is
included as supported on the same roles.

In addition, fix several bugs discovered along the way: Call isSelected() on role
tab, because tab supports aria-selected; not aria-checked. Correct ATK mapping
of ListBoxRole and ListBoxOptionRole for combobox descendants. Always defer to
WebCore for inclusion/exclusion decisions related to elements with an explicit
ARIA role.

Tests: accessibility/aria-combobox-hierarchy.html
       accessibility/aria-selected-menu-items.html
       accessibility/aria-selected.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::selectedTabItem):
(WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isDescendantOfRole):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::canHaveSelectedChildren):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isSelected):
(WebCore::AccessibilityRenderObject::canHaveSelectedChildren):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(webkitAccessibleSelectionGetSelectionCount):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
(getInterfaceMaskFromObject):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

LayoutTests:

New tests for the added support. In addition, update the expectations for
aria-combobox.html to reflect the corrected ATK mapping of ListBoxRole for
combobox descendants.

* accessibility/aria-combobox-expected.txt: Updated.
* accessibility/aria-combobox-hierarchy.html: Added.
* accessibility/aria-selected-menu-items.html: Added.
* accessibility/aria-selected.html: Added.
* platform/gtk/accessibility/aria-combobox-hierarchy-expected.txt: Added.
* platform/gtk/accessibility/aria-selected-expected.txt: Added.
* platform/gtk/accessibility/aria-selected-menu-items-expected.txt: Added.
* platform/mac/accessibility/aria-combobox-hierarchy-expected.txt: Added.
* platform/mac/accessibility/aria-selected-expected.txt: Added.
* platform/mac/accessibility/aria-selected-menu-items-expected.txt: Added.

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

4 years agoFix the Mac and iOS bulds.
simon.fraser@apple.com [Sat, 19 Nov 2016 21:04:53 +0000 (21:04 +0000)]
Fix the Mac and iOS bulds.

* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView _stableStateOverride]):
(-[TestRunnerWKWebView _setStableStateOverride:]):

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

4 years ago[iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars...
simon.fraser@apple.com [Sat, 19 Nov 2016 19:34:18 +0000 (19:34 +0000)]
[iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
https://bugs.webkit.org/show_bug.cgi?id=164855

Reviewed by Sam Weinig.
Source/WebCore:

During UI-process panning and zooming, we send visible rect updates to the web process
with inStableState=false, and don't update GraphicsLayers until we get into a stable state.

This causes a problem where the web process has a stale notion of where the GraphicsLayers
for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
in the scrolling tree.

To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
reconcileViewportConstrainedLayerPositions).

This allows us to remmove "viewportIsStable" from GraphicsLayer flushing, and FrameView.

SetOrSyncScrollingLayerPosition is made into an enum class.

Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html

* page/FrameView.cpp:
(WebCore::FrameView::reset):
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
(WebCore::AsyncScrollingCoordinator::syncViewportConstrainedLayerPositions): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::reconcileScrollingState):
(WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
(WebCore::ScrollingCoordinator::syncViewportConstrainedLayerPositions): Deleted.
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
(WebCore::ScrollingStateFixedNode::syncLayerPositionForViewportRect): Deleted.
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect):
(WebCore::ScrollingStateNode::syncLayerPositionForViewportRect): Deleted.
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
(WebCore::ScrollingStateStickyNode::syncLayerPositionForViewportRect): Deleted.
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setPosition):
(WebCore::GraphicsLayer::approximatePosition):
(WebCore::GraphicsLayer::setApproximatePosition):
(WebCore::GraphicsLayer::flushCompositingState):
(WebCore::GraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): No longer bail for viewportConstained layers when the viewport is unstable.
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::flushCompositingState):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::flushCompositingState):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):

Source/WebKit/win:

Remove the "inStableState" parameter from flushCompositingState() etc.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::flushPendingLayerChanges):
* WebView.cpp:
(WebView::flushPendingGraphicsLayerChanges):

Source/WebKit2:

During UI-process panning and zooming, we send visible rect updates to the web process
with inStableState=false, and don't update GraphicsLayers until we get into a stable state.

This causes a problem where the web process has a stale notion of where the GraphicsLayers
for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
in the scrolling tree.

To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
reconcileViewportConstrainedLayerPositions).

Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html

* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingTree.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send
ScrollingLayerPositionAction::SetApproximate if the state is not stable.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):

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

4 years agoMake it possible to test non-stable-state scrolling on iOS
simon.fraser@apple.com [Sat, 19 Nov 2016 19:02:04 +0000 (19:02 +0000)]
Make it possible to test non-stable-state scrolling on iOS
https://bugs.webkit.org/show_bug.cgi?id=164905

Reviewed by Dan Bernstein.

Source/WebKit2:

Make it possible for an iOS layout test to force every visible rect update
from the UI process to the web process to be in a non-stable state. This emulates
what happens during panning and zooming interactions, and allows us to test the
scrolling and layer trees in these transient states.

This is done by adding a testing property on WKWebView, _stableStateOverride, whose
getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
consults the NSNumber's boolValue and uses it to override the stable state.

To facilitate this kind of testing, also add immediateScrollToOffset() and
immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
which provides a callback that fires after one trip to the web process and back.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
(-[WKWebView _stableStateOverride]):
(-[WKWebView _setStableStateOverride:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

Make it possible for an iOS layout test to force every visible rect update
from the UI process to the web process to be in a non-stable state. This emulates
what happens during panning and zooming interactions, and allows us to test the
scrolling and layer trees in these transient states.

This is done by adding a testing property on WKWebView, _stableStateOverride, whose
getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
consults the NSNumber's boolValue and uses it to override the stable state.

To facilitate this kind of testing, also add immediateScrollToOffset() and
immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
which provides a callback that fires after one trip to the web process and back.

Add code generation support for optional boolean attributes in IDL.

Align CodeGeneratorDumpRenderTree.pm and CodeGeneratorTestRunner.pm.

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
(_generateImplementationFile):
(_platformTypeConstructor):
(_returnExpression):
* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::doAfterPresentationUpdate):
(WTR::contentOffsetBoundedInValidRange):
(WTR::UIScriptController::scrollToOffset):
(WTR::UIScriptController::immediateScrollToOffset):
(WTR::UIScriptController::immediateZoomToScale):
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::doAfterPresentationUpdate):
* TestRunnerShared/Bindings/JSWrappable.h:
(WTR::JSValueMakeBooleanOrNull):
(WTR::JSValueToNullableBoolean):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::immediateScrollToOffset):
(WTR::UIScriptController::immediateZoomToScale):
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(_classRefGetter):
(_platformTypeConstructor):
(_returnExpression):
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView dealloc]):
(-[TestRunnerWKWebView _stableStateOverride]):
(-[TestRunnerWKWebView _setStableStateOverride:]):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::doAsyncTask):
(WTR::UIScriptController::doAfterPresentationUpdate):
(WTR::UIScriptController::zoomToScale):
(WTR::UIScriptController::immediateScrollToOffset):
(WTR::UIScriptController::immediateZoomToScale):
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::doAfterPresentationUpdate):

LayoutTests:

* scrollingcoordinator/ios/non-stable-viewport-scroll-expected.txt: Added.
* scrollingcoordinator/ios/non-stable-viewport-scroll.html: Added.

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

4 years agoAdd --timeoutMultiplier option to allow some tests more time to run.
mark.lam@apple.com [Sat, 19 Nov 2016 17:39:25 +0000 (17:39 +0000)]
Add --timeoutMultiplier option to allow some tests more time to run.
https://bugs.webkit.org/show_bug.cgi?id=164951

Reviewed by Yusuke Suzuki.

JSTests:

Extended the timeout for these tests by 50% more because they run quite slow on
low-end machines.

* stress/op_div-ConstVar.js:
* stress/op_div-VarConst.js:
* stress/op_div-VarVar.js:

Source/JavaScriptCore:

* jsc.cpp:
(timeoutThreadMain):
- Modified to factor in a timeout multiplier that can adjust the timeout duration.
(startTimeoutThreadIfNeeded):
- Moved the code that starts the timeout thread here from main() so that we can
call it after command line args have been parsed instead.
(main):
- Deleted old timeout thread starting code.
(CommandLine::parseArguments):
- Added parsing of the --timeoutMultiplier option.
(jscmain):
- Start the timeout thread if needed after we've parsed the command line args.

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

4 years agoAX: [ATK] Expose aria-busy via ATK_STATE_BUSY
jdiggs@igalia.com [Sat, 19 Nov 2016 08:08:03 +0000 (08:08 +0000)]
AX: [ATK] Expose aria-busy via ATK_STATE_BUSY
https://bugs.webkit.org/show_bug.cgi?id=164909

Reviewed by Chris Fleizach.

Source/WebCore:

Expose aria-busy via ATK_STATE_BUSY. Also rename ariaLiveRegionBusy()
to isBusy() because in ARIA 1.1 aria-busy is no longer limited to live
regions.

Test: accessibility/aria-busy.html

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isBusy):
(WebCore::AccessibilityObject::ariaLiveRegionBusy): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isBusy):
(WebCore::AccessibilityRenderObject::ariaLiveRegionBusy): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkStateSetFromCoreObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityARIAIsBusy]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

Tools:

Implement boolAttributeValue() for ATK so we can test AXElementBusy.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::boolAttributeValue):

LayoutTests:

* accessibility/aria-busy-expected.txt: Added.
* accessibility/aria-busy.html: Added.

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

4 years agoFix missing exception checks in JSC inspector files.
mark.lam@apple.com [Sat, 19 Nov 2016 08:03:48 +0000 (08:03 +0000)]
Fix missing exception checks in JSC inspector files.
https://bugs.webkit.org/show_bug.cgi?id=164959

Reviewed by Saam Barati.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::weakMapEntries):
(Inspector::JSInjectedScriptHost::weakSetEntries):
(Inspector::JSInjectedScriptHost::iteratorEntries):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::scopeDescriptions):

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

4 years agoREGRESSION(r200964): Tab focus navigation is broken on results.en.voyages-sncf.com
rniwa@webkit.org [Sat, 19 Nov 2016 08:02:03 +0000 (08:02 +0000)]
REGRESSION(r200964): Tab focus navigation is broken on results.en.voyages-sncf.com
https://bugs.webkit.org/show_bug.cgi?id=164888

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was caused by FocusNavigationScope::parentInScope incorrectly returning nullptr when moving out of
a user agent shadow tree of a SVG use element. Fixed the bug by explicitly checking against the focus scope's
root node or its slot element. Also removed a superfluous early return when the parent node is a focus scope.

Tests: fast/shadow-dom/focus-navigation-out-of-slot.html
       fast/shadow-dom/focus-navigation-passes-shadow-host.html
       fast/shadow-dom/focus-navigation-passes-svg-use-element.html

* page/FocusController.cpp:
(WebCore::FocusNavigationScope::parentInScope):

LayoutTests:

Add regression tests for moving the focus across a shadow tree and a SVG use element
and the one that moves out of a slot element.

* fast/shadow-dom/focus-navigation-out-of-slot-expected.txt: Added.
* fast/shadow-dom/focus-navigation-out-of-slot.html: Added.
* fast/shadow-dom/focus-navigation-passes-shadow-host-expected.txt: Added.
* fast/shadow-dom/focus-navigation-passes-shadow-host.html: Added.
* fast/shadow-dom/focus-navigation-passes-svg-use-element-expected.txt: Added.
* fast/shadow-dom/focus-navigation-passes-svg-use-element.html: Added.
* platform/ios-simulator/TestExpectations: Skip the newly added tests on iOS.

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

4 years ago[iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into...
simon.fraser@apple.com [Sat, 19 Nov 2016 07:35:47 +0000 (07:35 +0000)]
[iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
https://bugs.webkit.org/show_bug.cgi?id=164980

Reviewed by Chris Dumez.

Source/WebCore:

WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
flag that impacts tile coverage.

During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().

Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.

Tests: fast/scrolling/ios/scroll-events-default.html
       fast/scrolling/ios/scroll-events-responsive.html
       fast/scrolling/ios/scroll-events-unresponsive.html

* page/Page.h:
(WebCore::Page::eventThrottlingBehaviorOverride):
(WebCore::Page::setEventThrottlingBehaviorOverride):
* testing/Internals.cpp:
(WebCore::Internals::setEventThrottlingBehaviorOverride):
(WebCore::Internals::eventThrottlingBehaviorOverride):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
flag that impacts tile coverage.

During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().

Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEventThrottlingBehaviorOverride):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::eventThrottlingDelay):

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::prepare):

LayoutTests:

* fast/scrolling/ios/scroll-events-default-expected.txt: Added.
* fast/scrolling/ios/scroll-events-default.html: Added.
* fast/scrolling/ios/scroll-events-responsive-expected.txt: Added.
* fast/scrolling/ios/scroll-events-responsive.html: Added.
* fast/scrolling/ios/scroll-events-unresponsive-expected.txt: Added.
* fast/scrolling/ios/scroll-events-unresponsive.html: Added.

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

4 years agoUnreviewed attempt to fix the build after r208917.
cdumez@apple.com [Sat, 19 Nov 2016 05:09:02 +0000 (05:09 +0000)]
Unreviewed attempt to fix the build after r208917.

* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):

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

4 years agoUnreviewed attempt to fix the build after r208917.
cdumez@apple.com [Sat, 19 Nov 2016 04:45:47 +0000 (04:45 +0000)]
Unreviewed attempt to fix the build after r208917.

* dom/CustomElementReactionQueue.cpp:

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

4 years agoUpdate SubtleCrypto::decrypt to match the latest spec
jiewen_tan@apple.com [Sat, 19 Nov 2016 04:38:59 +0000 (04:38 +0000)]
Update SubtleCrypto::decrypt to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164739
<rdar://problem/29257848>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::decrypt method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-decrypt.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-decrypt.
2. It implements decrypt operations of the following algorithms: AES-CBC,
   RSAES-PKCS1-V1_5, and RSA-OAEP.

Tests: crypto/subtle/aes-cbc-decrypt-malformed-parameters.html
       crypto/subtle/aes-cbc-generate-key-encrypt-decrypt.html
       crypto/subtle/aes-cbc-import-key-decrypt.html
       crypto/subtle/decrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-decrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label.html
       crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html
       crypto/subtle/rsa-oaep-import-key-decrypt-label.html
       crypto/subtle/rsa-oaep-import-key-decrypt.html
       crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html
       crypto/workers/subtle/aes-cbc-import-key-decrypt.html
       crypto/workers/subtle/rsa-oaep-import-key-decrypt.html
       crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::toCryptoKey):
(WebCore::toVector):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::JSSubtleCrypto::decrypt):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::decrypt):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::decryptRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::decryptRSA_OAEP):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):

LayoutTests:

* crypto/subtle/aes-cbc-decrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-cbc-decrypt-malformed-parameters.html: Added.
* crypto/subtle/aes-cbc-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/aes-cbc-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/aes-cbc-import-key-decrypt-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-decrypt.html: Added.
* crypto/subtle/decrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/decrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-decrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/rsa-oaep-decrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label-expected.txt: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label.html: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/rsa-oaep-import-key-decrypt-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-decrypt-label-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-decrypt-label.html: Added.
* crypto/subtle/rsa-oaep-import-key-decrypt.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-decrypt-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html: Added.
* crypto/workers/subtle/aes-cbc-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/aes-cbc-import-key-decrypt.html: Added.
* crypto/workers/subtle/resources/aes-cbc-import-key-decrypt.js: Added.
* crypto/workers/subtle/resources/rsa-oaep-import-key-decrypt.js: Added.
* crypto/workers/subtle/resources/rsaes-pkcs1-v1_5-import-key-decrypt.js: Added.
* crypto/workers/subtle/rsa-oaep-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/rsa-oaep-import-key-decrypt.html: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html: Added.

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

4 years agoUnreviewed, rolling out r208837.
cdumez@apple.com [Sat, 19 Nov 2016 04:25:38 +0000 (04:25 +0000)]
Unreviewed, rolling out r208837.

The bots did not show a progression

Reverted changeset:

"REGRESSION(r208082): 1% Speedometer regression on iOS"
https://bugs.webkit.org/show_bug.cgi?id=164852
http://trac.webkit.org/changeset/208837

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

4 years agoRemove use of std::chrono in WebPage and entrained code
simon.fraser@apple.com [Sat, 19 Nov 2016 03:33:36 +0000 (03:33 +0000)]
Remove use of std::chrono in WebPage and entrained code
https://bugs.webkit.org/show_bug.cgi?id=164967

Reviewed by Tim Horton.

Replace std::chrono with Seconds and Monotonic Time.

Use more C++11 initialization for WebPage data members.

Source/WebCore:

* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::scrollPositionChanged):
(WebCore::FrameView::setScrollVelocity):
* page/FrameView.h:
* platform/Timer.h:
(WebCore::TimerBase::startRepeating):
(WebCore::TimerBase::startOneShot):
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::augmentRepeatInterval):
* platform/graphics/TiledBacking.h:
(WebCore::VelocityData::VelocityData):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect):

Source/WebKit2:

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::timestamp):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MonotonicTime>::encode):
(IPC::ArgumentCoder<MonotonicTime>::decode):
(IPC::ArgumentCoder<Seconds>::encode):
(IPC::ArgumentCoder<Seconds>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ios/WKContentView.mm:
(WebKit::HistoricalVelocityData::HistoricalVelocityData):
(WebKit::HistoricalVelocityData::velocityForNewData):
(WebKit::HistoricalVelocityData::append):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::eventThrottlingDelay):
* WebProcess/WebPage/ViewUpdateDispatcher.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::m_userActivityHysteresis):
(WebKit::WebPage::didFlushLayerTreeAtTime):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::eventThrottlingDelay):
(WebKit::WebPage::updateVisibleContentRects):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

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

4 years agoAX: "(inverted-colors)" media query only matches on page reload; should match on...
dino@apple.com [Sat, 19 Nov 2016 02:51:15 +0000 (02:51 +0000)]
AX: "(inverted-colors)" media query only matches on page reload; should match on change
https://bugs.webkit.org/show_bug.cgi?id=163564
<rdar://problem/28807350>

Source/WebCore:

Reviewed by Simon Fraser.

Mark some media queries as responding to notifications that
system accessibility settings have changed. When Page gets told
that has happened, check if any of the results have changed.

Tests: fast/media/mq-inverted-colors-live-update.html
       fast/media/mq-monochrome-live-update.html
       fast/media/mq-prefers-reduced-motion-live-update.html

* css/MediaQueryEvaluator.cpp:
(WebCore::isAccessibilitySettingsDependent):
(WebCore::MediaQueryEvaluator::evaluate):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::addAccessibilitySettingsDependentMediaQueryResult):
(WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange):
* css/StyleResolver.h:
(WebCore::StyleResolver::hasAccessibilitySettingsDependentMediaQueries):
* page/Page.cpp:
(WebCore::Page::accessibilitySettingsDidChange):
* page/Page.h:

Source/WebKit2:

Reviewed by Simon Fraser.

Listen for the appropriate notifications that accessibility settings
have changed. This is a single notification on macOS, which uses WebViewImpl,
and more fine-grained notifications on iOS, using WKWebView.

When we see the notification, send a message to the WebProcess which will
then tell the WebCore::Page.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _accessibilitySettingsDidChange:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKAccessibilitySettingsObserver initWithImpl:]):
(-[WKAccessibilitySettingsObserver dealloc]):
(-[WKAccessibilitySettingsObserver _settingsDidChange:]):
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::accessibilitySettingsDidChange):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::accessibilitySettingsDidChange):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::accessibilitySettingsDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Reviewed by NOBODY (OOPS!).

Add a UIScriptController method that tricks WebKit into thinking
it has received a notification that accessibility settings have
changed. Combined with our forced overrides, this allows us to
test if a page would react to the notifications.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::simulateAccessibilitySettingsChangeNotification):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::simulateAccessibilitySettingsChangeNotification):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::simulateAccessibilitySettingsChangeNotification):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::simulateAccessibilitySettingsChangeNotification):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::simulateAccessibilitySettingsChangeNotification):

LayoutTests:

Reviewed by Simon Fraser.

* fast/media/mq-inverted-colors-live-update-in-subframes-expected.html: Added.
* fast/media/mq-inverted-colors-live-update-in-subframes.html: Added.
* fast/media/mq-inverted-colors-live-update-expected.html: Added.
* fast/media/mq-inverted-colors-live-update.html: Added.
* fast/media/mq-monochrome-live-update-expected.html: Added.
* fast/media/mq-monochrome-live-update.html: Added.
* fast/media/mq-prefers-reduced-motion-live-update-expected.html: Added.
* fast/media/mq-prefers-reduced-motion-live-update.html: Added.

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

4 years agoRename the 'other' Apple Pay Button type to 'donate'
andersca@apple.com [Sat, 19 Nov 2016 02:45:25 +0000 (02:45 +0000)]
Rename the 'other' Apple Pay Button type to 'donate'
https://bugs.webkit.org/show_bug.cgi?id=164978

Reviewed by Dean Jackson.

* DerivedSources.make:
* WebCorePrefix.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
* rendering/style/RenderStyleConstants.h:

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

4 years agoFix missing exception checks in DFGOperations.cpp.
mark.lam@apple.com [Sat, 19 Nov 2016 01:46:01 +0000 (01:46 +0000)]
Fix missing exception checks in DFGOperations.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164958

Reviewed by Geoffrey Garen.

* dfg/DFGOperations.cpp:

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

4 years agoFix exception scope verification failures in ShadowChicken.cpp.
mark.lam@apple.com [Sat, 19 Nov 2016 01:40:14 +0000 (01:40 +0000)]
Fix exception scope verification failures in ShadowChicken.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164966

Reviewed by Saam Barati.

* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::functionsOnStack):

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

4 years agoUSE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView...
commit-queue@webkit.org [Sat, 19 Nov 2016 01:00:27 +0000 (01:00 +0000)]
USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
https://bugs.webkit.org/show_bug.cgi?id=164962

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-11-18
Reviewed by Dean Jackson.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

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

4 years ago[WebGL2] Implement texStorage2D()
mmaxfield@apple.com [Sat, 19 Nov 2016 01:00:16 +0000 (01:00 +0000)]
[WebGL2] Implement texStorage2D()
https://bugs.webkit.org/show_bug.cgi?id=164493

Reviewed by Dean Jackson.

Source/WebCore:

Create a new validation function which only accepts sized internalFormats.
After running texStorage2D(), we also texSubImage2D() to zero-fill it. This
is to compensate for potentially buggy drivers.

Because glTexStorage2D() was only added to OpenGL in version 4.2, not all
OpenGL 3.2+ contexts can implement this command. However, according to
https://developer.apple.com/opengl/capabilities/ all Apple GPUs have the
GL_ARB_texture_storage which implements this call. In the future, we could
implement texStorage2D() on top of texImage2D() if there are any ports which
want WebGL2 but don't have 4.2 and don't have the extension.

Also, when calling texStorage2D, callers specify an internalFormat but not a
type/format pair. This means that storing the texture's type is only valid
for WebGL 1 contexts. This patch surrounds all calls to reading the texture
type with guards and adds an ASSERT() at the read site to make sure the
right thing is happening.

Test: fast/canvas/webgl/webgl2-texStorage.html

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateTexStorageFuncParameters):
(WebCore::WebGL2RenderingContext::texStorage2D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::validateTexFunc):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::texImage2D):
* html/canvas/WebGLTexture.cpp:
(WebCore::WebGLTexture::WebGLTexture):
(WebCore::WebGLTexture::getType):
(WebCore::WebGLTexture::needToUseBlackTexture):
(WebCore::WebGLTexture::canGenerateMipmaps):
(WebCore::internalFormatIsFloatType):
(WebCore::internalFormatIsHalfFloatType):
(WebCore::WebGLTexture::update):
* html/canvas/WebGLTexture.h:
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::texImage2DResourceSafe):
(WebCore::GraphicsContext3D::packImageData):
(WebCore::GraphicsContext3D::extractImageData):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::texStorage2D):
(WebCore::GraphicsContext3D::texStorage3D):

LayoutTests:

* fast/canvas/webgl/webgl2-texStorage-expected.txt: Added.
* fast/canvas/webgl/webgl2-texStorage.html: Added.

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

4 years agoTextDecoder constructor should not accept replacement encodings
achristensen@apple.com [Sat, 19 Nov 2016 00:58:54 +0000 (00:58 +0000)]
TextDecoder constructor should not accept replacement encodings
https://bugs.webkit.org/show_bug.cgi?id=164903

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/encoding/api-replacement-encodings-expected.txt:

Source/WebCore:

Covered by newly passing web platform tests.

* dom/TextDecoder.cpp:
(WebCore::TextDecoder::create):
https://encoding.spec.whatwg.org/#textdecoder says about the constructor:
"If label is either not a label or is a label for replacement, throws a RangeError."
See https://bugs.webkit.org/show_bug.cgi?id=159180 for the mapping of the replacement
codec names to "replacement".

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

4 years agoAssertion failures in ActiveDOMObject::~ActiveDOMObject under Database destructor
cdumez@apple.com [Sat, 19 Nov 2016 00:38:43 +0000 (00:38 +0000)]
Assertion failures in ActiveDOMObject::~ActiveDOMObject under Database destructor
https://bugs.webkit.org/show_bug.cgi?id=164955
<rdar://problem/29336715>

Reviewed by Brady Eidson.

Make sure the Database's DatabaseContext object is destroyed on the context
thread given that DatabaseContext is an ActiveDOMObject and there is an
assertion in the ActiveDOMObject destructor that it should be destroyed on
on the context thread.

No new tests, already covered by existing tests.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::~Database):

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

4 years agoFix API test after r208902
achristensen@apple.com [Fri, 18 Nov 2016 23:50:08 +0000 (23:50 +0000)]
Fix API test after r208902
https://bugs.webkit.org/show_bug.cgi?id=144194

* TestWebKitAPI/Tests/Cocoa/URLExtras.mm:
(TestWebKitAPI::TEST):
The fullwidth solidus, U+FF0F, changed encoding from IDN2003 to IDN2008, probably to prevent domains from using it
to spoof other domains.  https://webkit.org/blog/ and https://webkit.org\uFF0Fblog/ would otherwise look
too similar when rendered.

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

4 years agoRefactor drag and drop for WebKit2 to encode DragData message exchange.
enrica@apple.com [Fri, 18 Nov 2016 23:35:28 +0000 (23:35 +0000)]
Refactor drag and drop for WebKit2 to encode DragData message exchange.
https://bugs.webkit.org/show_bug.cgi?id=164945

Reviewed by Tim Horton.

Source/WebCore:

No new tests. No change in functionality.

* loader/EmptyClients.h:
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::createMouseEvent):
(WebCore::documentFragmentFromDragData):
(WebCore::DragController::dragIsMove):
(WebCore::DragController::dragEntered):
(WebCore::DragController::dragExited):
(WebCore::DragController::dragUpdated):
(WebCore::DragController::performDragOperation):
(WebCore::DragController::dragEnteredOrUpdated):
(WebCore::DragController::tryDocumentDrag):
(WebCore::DragController::operationForLoad):
(WebCore::DragController::dispatchTextInputEventFor):
(WebCore::DragController::concludeEditDrag):
(WebCore::DragController::canProcessDrag):
(WebCore::DragController::tryDHTMLDrag):
* page/DragController.h:
* page/efl/DragControllerEfl.cpp:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/mac/DragControllerMac.mm:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/win/DragControllerWin.cpp:
(WebCore::DragController::dragOperation):
(WebCore::DragController::isCopyKeyDown):
* platform/DragData.h:
(WebCore::DragData::DragData):

Source/WebKit/mac:

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::actionMaskForDrag):
(WebDragClient::willPerformDragDestinationAction):

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragControllerAction):
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::willPerformDragDestinationAction):
(WebKit::WebDragClient::actionMaskForDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

4 years agoAdd runtime flag to enable pointer lock. Enable pointer lock feature for mac.
commit-queue@webkit.org [Fri, 18 Nov 2016 23:33:05 +0000 (23:33 +0000)]
Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
https://bugs.webkit.org/show_bug.cgi?id=163801

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-11-18
Reviewed by Simon Fraser.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

These tests now pass with DumpRenderTree.
LayoutTests/pointer-lock/lock-already-locked.html
LayoutTests/pointer-lock/lock-element-not-in-dom.html
LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
LayoutTests/pointer-lock/mouse-event-api.html

PointerLockController::requestPointerLock now protects against synchronous callback
to allowPointerLock().

Add pointerLockEnabled setting.

* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
(WebCore::Document::exitPointerLock): Fix existing typo.
(WebCore::Document::pointerLockElement):
* features.json:
* page/EventHandler.cpp:
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
* page/Settings.in:

Source/WebKit/mac:

Plumb through PointerLockEnabled setting.

* Configurations/FeatureDefines.xcconfig:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::requestPointerUnlock):
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences pointerLockEnabled]):
(-[WebPreferences setPointerLockEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add SPI to notify client of pointer lock and for client to allow or deny.
Unlock pointer when view is not longer active.

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::requestPointerLock):
(API::UIClient::didLosePointerLock):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
(WKPageDidAllowPointerLock):
(WKPageDidDenyPointerLock):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/API/C/WKPreferences.cpp:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::requestPointerLock):
(WebKit::UIDelegate::UIClient::didLosePointerLock):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::requestPointerLock):
(WebKit::WebPageProxy::didAllowPointerLock):
(WebKit::WebPageProxy::didDenyPointerLock):
(WebKit::WebPageProxy::requestPointerUnlock):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:

* wtf/FeatureDefines.h: ENABLE_POINTER_LOCK true for Mac.

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

4 years agoSupport IDN2008 with UTS #46 instead of IDN2003
achristensen@apple.com [Fri, 18 Nov 2016 22:47:24 +0000 (22:47 +0000)]
Support IDN2008 with UTS #46 instead of IDN2003
https://bugs.webkit.org/show_bug.cgi?id=144194

Reviewed by Darin Adler.

Source/WebCore:

Use uidna_nameToASCII instead of the deprecated uidna_IDNToASCII.
It uses IDN2008 instead of IDN2003, and it uses UTF #46 when used with a UIDNA opened with uidna_openUTS46.
This follows https://url.spec.whatwg.org/#concept-domain-to-ascii except we do not use Transitional_Processing
to prevent homograph attacks on german domain names with "ß" and "ss" in them.  These are now treated as separate domains.
Firefox also doesn't use Transitional_Processing. Chrome and the current specification use Transitional_processing,
but https://github.com/whatwg/url/issues/110 might change the spec.

In addition, http://unicode.org/reports/tr46/ says:
"implementations are encouraged to apply the Bidi and ContextJ validity criteria"
Bidi checks prevent domain names with bidirectional text, such as latin and hebrew characters in the same domain.  Chrome and Firefox do this.

ContextJ checks prevent code points such as U+200D, which is a zero-width joiner which users would not see when looking at the domain name.
Firefox currently enables ContextJ checks and it is suggested by UTS #46, so we'll do it.

ContextO checks, which we do not use and neither does any other browser nor the spec, would fail if a domain contains code points such as U+30FB,
which looks somewhat like a dot.  We can investigate enabling these checks later.

Covered by new API tests and rebased LayoutTests.
The new API tests verify that we do not use transitional processing, that we do apply the Bidi and ContextJ checks, but not ContextO checks.

* platform/URLParser.cpp:
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::internationalDomainNameTranscoder):
* platform/URLParser.h:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::mapHostNameWithRange):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):
Add some tests from http://unicode.org/faq/idn.html verifying that we follow UTS46's deviations from IDN2008.
Add some tests based on https://tools.ietf.org/html/rfc5893 verifying that we check for bidirectional text.
Add a test based on https://tools.ietf.org/html/rfc5892 verifying that we do not do ContextO check.
Add a test for U+321D and U+321E which have particularly interesting punycode encodings.  We match Firefox here now.
Also add a test from http://www.unicode.org/reports/tr46/#IDNAComparison verifying we are not using IDN2003.
We should consider importing all of http://www.unicode.org/Public/idna/9.0.0/IdnaTest.txt as URL domain tests.

LayoutTests:

* fast/encoding/idn-security.html:
Move some characters with changed IDN encodings to inside the check for old ICU.
* fast/url/idna2003-expected.txt:
* fast/url/idna2008-expected.txt:
Update expected results.  We are now more compliant with IDN2008.

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

4 years agoREGRESSION(r208867): JSC test failure: ChakraCore.yaml/ChakraCore/test/strict/05...
utatane.tea@gmail.com [Fri, 18 Nov 2016 22:32:01 +0000 (22:32 +0000)]
REGRESSION(r208867): JSC test failure: ChakraCore.yaml/ChakraCore/test/strict/05.arguments_sm.js.default
https://bugs.webkit.org/show_bug.cgi?id=164929

Reviewed by Mark Lam.

ES2017 drops arguments.caller and JavaScriptCore is updated to meet the spec.
This patch rebaselines the result of ChakraCore test for JSC.

* ChakraCore/test/strict/05.arguments_sm.baseline-jsc:

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

4 years agoMarking two js/dom/domjit-function-get-element-by-id-* tests as flaky.
ryanhaddad@apple.com [Fri, 18 Nov 2016 22:31:13 +0000 (22:31 +0000)]
Marking two js/dom/domjit-function-get-element-by-id-* tests as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164797

Unreviewed test gardening.

* TestExpectations:

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

4 years agoBetter testing for accessibility media queries
dino@apple.com [Fri, 18 Nov 2016 22:30:44 +0000 (22:30 +0000)]
Better testing for accessibility media queries
https://bugs.webkit.org/show_bug.cgi?id=164954
<rdar://problem/29338292>

Reviewed by Myles Maxfield.

Source/WebCore:

Provide an override mode for the accessibility media queries
that rely on system settings. This way we can test that they
are least responding to something.

Tests: fast/media/mq-inverted-colors-forced-value.html
       fast/media/mq-monochrome-forced-value.html

* css/MediaQueryEvaluator.cpp: Query the Settings to see if we're
forcing a value.
(WebCore::monochromeEvaluate):
(WebCore::invertedColorsEvaluate):
(WebCore::prefersReducedMotionEvaluate):
* page/Settings.h:
* testing/InternalSettings.cpp: Add new forcing values for inverted-colors
and monochrome.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::settingsToInternalSettingsValue):
(WebCore::internalSettingsToSettingsValue):
(WebCore::InternalSettings::forcedColorsAreInvertedAccessibilityValue):
(WebCore::InternalSettings::setForcedColorsAreInvertedAccessibilityValue):
(WebCore::InternalSettings::forcedDisplayIsMonochromeAccessibilityValue):
(WebCore::InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue):
(WebCore::InternalSettings::forcedPrefersReducedMotionAccessibilityValue):
(WebCore::InternalSettings::setForcedPrefersReducedMotionAccessibilityValue):
(WebCore::InternalSettings::forcedPrefersReducedMotionValue): Deleted.
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

* fast/media/mq-inverted-colors-forced-value-expected.html: Added.
* fast/media/mq-inverted-colors-forced-value.html: Copied from LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html.
* fast/media/mq-monochrome-forced-value-expected.html: Added.
* fast/media/mq-monochrome-forced-value.html: Added.
* fast/media/mq-prefers-reduced-motion-forced-value.html:

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

4 years agoUnreviewed, fix cloop.
fpizlo@apple.com [Fri, 18 Nov 2016 22:29:11 +0000 (22:29 +0000)]
Unreviewed, fix cloop.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::stronglyVisitStrongReferences):

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

4 years agoConcurrent GC should be able to run splay in debug mode and earley/raytrace in releas...
fpizlo@apple.com [Fri, 18 Nov 2016 22:11:51 +0000 (22:11 +0000)]
Concurrent GC should be able to run splay in debug mode and earley/raytrace in release mode with no perf regression
https://bugs.webkit.org/show_bug.cgi?id=164282

Reviewed by Geoffrey Garen and Oliver Hunt.

PerformanceTests:

CDjs is a fun benchmark for stressing concurrent GCs, but to really give the GC a good
workout you need to increase the amount of work that the test does. This adds a second
configuration of the benchmark that has more aircraft. It uses much more memory and causes us
to do more GCs and those GCs take longer.

* JetStream/cdjs/benchmark.js:
(benchmarkImpl):
(benchmark):
* JetStream/cdjs/large.js: Added.

Source/JavaScriptCore:

The two three remaining bugs were:

- Improper ordering inside putDirectWithoutTransition() and friends. We need to make sure
  that the GC doesn't see the store to Structure::m_offset until we've resized the butterfly.
  That proved a bit tricky. On the other hand, this means that we could probably remove the
  requirement that the GC holds the Structure lock in some cases. I haven't removed that lock
  yet because I still think it might protect some weird cases, and it doesn't seem to cost us
  anything.

- CodeBlock's GC strategy needed to be made thread-safe (visitWeakly, visitChildren, and
  their friends now hold locks) and incremental-safe (we need to update predictions in the
  finalizer to make sure we clear anything that was put into a value profile towards the end
  of GC).

- The GC timeslicing scheduler needed to be made a bit more aggressive to deal with
  generational workloads like earley, raytrace, and CDjs. Once I got those benchmarks to run,
  I found that they would do many useless iterations of GC because they wouldn't pause long
  enough after rescanning weak references and roots. I added a bunch of knobs for forcing a
  pause. In the end, I realized that I could get the desired effect by putting a ceiling on
  mutator utilization. We want the GC to finish quickly if it is possible to do so, even if
  the amount of allocation that the mutator had done is low. Having a utilization ceiling
  seems to accomplish this for benchmarks with trivial heaps (earley and raytrace) as well as
  huge heaps (like CDjs in its "large" configuration).

This preserves splay performance, makes the concurrent GC more stable, and makes the
concurrent GC not a perf regression on earley or raytrace. It seems to give us great CDjs
performance as well, but this is still hard to tell because we crash a lot in that benchmark.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitWeakly):
(JSC::CodeBlock::visitChildren):
(JSC::CodeBlock::shouldVisitStrongly):
(JSC::CodeBlock::shouldJettisonDueToOldAge):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::determineLiveness):
(JSC::CodeBlock::WeakReferenceHarvester::visitWeakReferences):
(JSC::CodeBlock::UnconditionalFinalizer::finalizeUnconditionally):
(JSC::CodeBlock::visitOSRExitTargets):
(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::CodeBlock::stronglyVisitWeakReferences):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::clearVisitWeaklyHasBeenCalled):
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):
* heap/Heap.cpp:
(JSC::Heap::ResumeTheWorldScope::ResumeTheWorldScope):
(JSC::Heap::markToFixpoint):
(JSC::Heap::beginMarking):
(JSC::Heap::addToRememberedSet):
(JSC::Heap::collectInThread):
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::mutatorFence):
* heap/MarkedBlock.cpp:
* runtime/JSCellInlines.h:
(JSC::JSCell::finishCreation):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectWithoutTransition):
(JSC::JSObject::putDirectInternal):
* runtime/Options.h:
* runtime/Structure.cpp:
(JSC::Structure::add):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::add):

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

4 years agoMarking http/tests/misc/link-rel-icon-beforeload.html as failing on mac-wk1.
ryanhaddad@apple.com [Fri, 18 Nov 2016 22:04:43 +0000 (22:04 +0000)]
Marking http/tests/misc/link-rel-icon-beforeload.html as failing on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=164933

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

4 years agoWeb Inspector: TimelineDataGridNode assertions when refreshing page
mattbaker@apple.com [Fri, 18 Nov 2016 22:04:08 +0000 (22:04 +0000)]
Web Inspector: TimelineDataGridNode assertions when refreshing page
https://bugs.webkit.org/show_bug.cgi?id=162642
<rdar://problem/28505898>

Reviewed by Timothy Hatcher.

This patch fixes a number of deficiencies in the Network tab that caused
TimelineDataGridNode graphs to refresh before the tab became visible.

* UserInterface/Views/ElementsTabContentView.js:
(WebInspector.ElementsTabContentView):
(WebInspector.ElementsTabContentView.prototype.shown):
Drive-by fix: defer showing the DOM content view until the tab is shown.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
Drive-by event listener cleanup.
(WebInspector.NetworkGridContentView.prototype.get startTime):
(WebInspector.NetworkGridContentView.prototype.get endTime):
Back endTime with a variable, instead of using the ruler value which
isn't valid before the tab is shown for the first time.

(WebInspector.NetworkGridContentView.prototype.shown):
Force the grid to update its layout, and that of the Timeline column ruler.
During layout the ruler's secondsPerPixel value is used, which isn't
valid until the ruler does an initial layout.

(WebInspector.NetworkGridContentView.prototype.reset):
Clear pending records. This was causing duplicates to appear when the
inspected page was refreshed multiple times prior to showing the Network
tab for the first time.

(WebInspector.NetworkGridContentView.prototype.layout):
Should more closely match behavior in NetworkTimelineView.prototype.layout.
Graph end time padding is added if no longer updating the current time.

(WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
Track endTime of the last record added, so that the graph end time can
be padded once the current time is no longer being updated.

(WebInspector.NetworkGridContentView.prototype._update):
(WebInspector.NetworkGridContentView.prototype._stopUpdatingCurrentTime):
Graph end time padding shouldn't be applied here, since this isn't called
if the inspected page finishes loading before the view is shown.

(WebInspector.NetworkGridContentView.prototype._clearNetworkItems): Deleted.
Replaced by an arrow function.

* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype._networkTimelineReset):
Don't show the content view if the tab is hidden.

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

4 years agoUnsupported emoji are invisible
mmaxfield@apple.com [Fri, 18 Nov 2016 21:55:09 +0000 (21:55 +0000)]
Unsupported emoji are invisible
https://bugs.webkit.org/show_bug.cgi?id=164944
<rdar://problem/28591608>

Reviewed by Dean Jackson.

Source/WebCore:

In WidthIterator, we explicitly skip characters which the OS has no font
to render with. However, for emoji, we should draw something to show that
there is missing content. Because we have nothing to draw, we can draw
the .notdef glyph (empty box, or "tofu").

Test: fast/text/emoji-draws.html

* platform/graphics/WidthIterator.cpp:
(WebCore::characterMustDrawSomething):
(WebCore::WidthIterator::advanceInternal):

LayoutTests:

* fast/text/emoji-draws-expected-mismatch.html: Added.
* fast/text/emoji-draws.html: Added.

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

4 years ago[WebIDL] Add support for record types
weinig@apple.com [Fri, 18 Nov 2016 21:47:42 +0000 (21:47 +0000)]
[WebIDL] Add support for record types
https://bugs.webkit.org/show_bug.cgi?id=164935

Reviewed by Tim Horton.

Source/WebCore:

Add support for WebIDLs record types. We map them to HashMap<String, {OtherType}>.

* bindings/generic/IDLTypes.h:
- Add IDLRecord type and helper predicate.
- Remove IDLRegExp which is no longer in WebIDL and we never supported.

* bindings/js/JSDOMBinding.cpp:
(WebCore::stringToByteString):
(WebCore::identifierToByteString):
(WebCore::valueToByteString):
(WebCore::hasUnpairedSurrogate):
(WebCore::stringToUSVString):
(WebCore::identifierToUSVString):
(WebCore::valueToUSVString):
* bindings/js/JSDOMBinding.h:
Refactor ByteString and USVString conversion to support converting from
either a JSValue or Identifier.

* bindings/js/JSDOMConvert.h:
(WebCore::DetailConverter<IDLRecord<K, V>>):
(WebCore::JSConverter<IDLRecord<K, V>>):
Add conversion support for record types. Use Detail::IdentifierConverter helper
to convert identifiers to strings using the correct conversion rules.

(WebCore::Converter<IDLUnion<T...>>::convert):
Update comments in union conversion to match current spec. Remove check
for regular expressions and add support for record types.

* bindings/scripts/CodeGenerator.pm:
(IsRefPtrType):
Add record and union types to the list of things that aren't RefPtrs.

(IsRecordType):
Add predicate for testing if a type is a record.

(IsWrapperType):
Remove check for union. This is now handled in the IsRefPtrType check.

(SkipIncludeHeader): Deleted.
(GetSequenceInnerType): Deleted.
(GetFrozenArrayInnerType): Deleted.
(GetSequenceOrFrozenArrayInnerType): Deleted.
Remove no longer necessary functions.

* bindings/scripts/CodeGeneratorJS.pm:
(AddIncludesForImplementationType):
Remove check for includes to skip. This is now only called for interfaces, which should be included
unconditionally.

(AddToIncludesForIDLType):
Add includes and recursive includes for record types.

(GenerateOverloadedFunctionOrConstructor):
Update to account for records.

(GetGnuVTableRefForInterface):
(GetGnuVTableNameForInterface):
(GetGnuMangledNameForInterface):
(GetWinVTableNameForInterface):
(GetWinMangledNameForInterface):
Strength-reduce GetNativeTypeForConversions and GetNamespaceForInterface into their callers.

(GetBaseIDLType):
Add support for IDLRecord. Remove call to GetIDLInterfaceName now that is simply the type name.

(GetNativeType):
Simplify sequence/FrozenArray support and add record support.

(GetNativeInnerType):
Generalize GetNativeVectorInnerType to work for record types as well.

(ShouldPassWrapperByReference):
Moved so native type accessors can be together.

(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add record support.

(GetNativeTypeForConversions): Deleted.
(GetNamespaceForInterface): Deleted.
(GetNativeVectorType): Deleted.
(GetIDLInterfaceName): Deleted.
(GetNativeVectorInnerType): Deleted.
Remove unneeded functions.

* bindings/scripts/IDLParser.pm:
(typeDescription):
Add helper useful for debugging, that constructs the string form of a type.

(typeByApplyingTypedefs):
Add missing call to typeByApplyingTypedefs (this is noted by a fix in JSTestCallbackFunctionWithTypedefs.h)

(parseNonAnyType):
Remove unused $subtypeName variables and add support for parsing record types.

* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add tests for records and update results.

* testing/TypeConversions.h:
(WebCore::TypeConversions::testLongRecord):
(WebCore::TypeConversions::setTestLongRecord):
(WebCore::TypeConversions::testNodeRecord):
(WebCore::TypeConversions::setTestNodeRecord):
(WebCore::TypeConversions::testSequenceRecord):
(WebCore::TypeConversions::setTestSequenceRecord):
* testing/TypeConversions.idl:
Add record types so it can be tested from layout tests.

LayoutTests:

* js/dom/webidl-type-mapping-expected.txt:
* js/dom/webidl-type-mapping.html:
Add tests for WebIDL record types.

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

4 years ago[CSS Parser] Support font-variation-settings
hyatt@apple.com [Fri, 18 Nov 2016 21:41:40 +0000 (21:41 +0000)]
[CSS Parser] Support font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=164947

Reviewed by Myles Maxfield.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariationTag):
(WebCore::consumeFontVariationSettings):
(WebCore::CSSPropertyParser::parseSingleValue):

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

4 years agoUpdate SubtleCrypto::encrypt to match the latest spec
jiewen_tan@apple.com [Fri, 18 Nov 2016 21:31:42 +0000 (21:31 +0000)]
Update SubtleCrypto::encrypt to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164738
<rdar://problem/29257812>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::encrypt method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-encrypt.
2. It implements encrypt operations of the following algorithms: AES-CBC,
   RSAES-PKCS1-V1_5, and RSA-OAEP.
3. It addes ASSERT(parameters) for every method that accepts a
   std::unique_ptr<CryptoAlgorithmParameters>&& type parameter.
4. It changes RefPtr<CryptoKey>&& to Ref<CryptoKey>&& for every method that
   accepts a CryptoKey.

Tests: crypto/subtle/aes-cbc-encrypt-malformed-parameters.html
       crypto/subtle/aes-cbc-import-key-encrypt.html
       crypto/subtle/encrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-import-key-encrypt-label.html
       crypto/subtle/rsa-oaep-import-key-encrypt.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html
       crypto/workers/subtle/aes-cbc-import-key-encrypt.html
       crypto/workers/subtle/rsa-oaep-import-key-encrypt.html
       crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/BufferSource.h:
(WebCore::BufferSource::BufferSource):
Add a default constructor for initializing an empty BufferSource object.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::JSSubtleCrypto::encrypt):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::exportKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoKey.h:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::workQueue):
* crypto/SubtleCrypto.idl:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
* crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
(WebCore::CryptoAlgorithmAES_CBC::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::importKey):
(WebCore::CryptoAlgorithmAES_KW::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
(WebCore::CryptoAlgorithmHMAC::exportKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::transformAES_CBC):
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::encryptRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::encryptRSA_OAEP):
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/parameters/AesCbcParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParams.h: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h: Added.
* crypto/parameters/RsaOaepParams.idl: Added.

LayoutTests:

* TestExpectations:
* crypto/subtle/aes-cbc-encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-cbc-encrypt-malformed-parameters.html: Added.
* crypto/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-encrypt.html: Added.
* crypto/subtle/encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/encrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-label-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-label.html: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.
* crypto/workers/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/aes-cbc-import-key-encrypt.html: Added.
* crypto/workers/subtle/resources/aes-cbc-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/rsa-oaep-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/rsaes-pkcs1-v1_5-import-key-encrypt.js: Added.
* crypto/workers/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/rsa-oaep-import-key-encrypt.html: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.

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

4 years agoAttempt to fix iOS build again.
ryanhaddad@apple.com [Fri, 18 Nov 2016 21:23:41 +0000 (21:23 +0000)]
Attempt to fix iOS build again.
<rdar://problem/29312689>

Unreviewed build fix.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack):

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

4 years ago[CSS Font Loading] FontFaceSet.load() promises don't always fire
mmaxfield@apple.com [Fri, 18 Nov 2016 20:56:36 +0000 (20:56 +0000)]
[CSS Font Loading] FontFaceSet.load() promises don't always fire
https://bugs.webkit.org/show_bug.cgi?id=164902

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/text/fontfaceset-rebuild-during-loading.html

We currently handle web fonts in two phases. The first phase is building up
StyleRuleFontFace objects which reflect the style on the page. The second is creating
CSSFontFace objects from those StyleRuleFontFace objects. When script modifies the
style on the page, we can often update the CSSFontFace objects, but there are some
modifications which we don't know how to model. For these operations, we destroy the
CSSFontFace objects and rebuild them from the newly modified StyleRuleFontFace objects.

Normally, this is fine. However, with the CSS font loading API, the CSSFontFaces back
Javascript objects which will persist across the rebuilding step mentioned above. This
means that the FontFace objects need to adopt the new CSSFontFace objects and forget
the old CSSFontFace objects.

There was one bit of state which I forgot to update during this rebuilding phase. The
FontFaceSet object contains an internal HashMap where a reference to a CSSFontFace
is used as a key. After the rebuilding phase, this reference wasn't updated to point
to the new CSSFontFace.

The solution is to instead use a reference to the higher-level FontFace as the key to
the HashMap. This object is persistent across the rebuilding phase (and it adopts
the new CSSFontFaces). There is not a lifetime problem because the FontFace holds a
strong reference to its backing CSSFontFace object.

This bug didn't cause a memory problem because the HashMap was keeping the old
CSSFontFace alive because the key was a strong reference.

This patch also adds a lengthy comment explaining how the migration works.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::initializeWrapper): This is another bit of state which didn't
survive the rebuilding phase. Moving it here causes it to survive.
(WebCore::CSSFontFace::wrapper):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load):
(WebCore::FontFaceSet::faceFinished):
* css/FontFaceSet.h:

LayoutTests:

* fast/text/fontfaceset-rebuild-during-loading-expected.txt: Added.
* fast/text/fontfaceset-rebuild-during-loading.html: Added.

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

4 years ago[SVG -> OTF Font Converter] Fonts advances are not internally consistent inside the...
mmaxfield@apple.com [Fri, 18 Nov 2016 20:27:50 +0000 (20:27 +0000)]
[SVG -> OTF Font Converter] Fonts advances are not internally consistent inside the generated font file
https://bugs.webkit.org/show_bug.cgi?id=164846
<rdar://problem/29031509>

Reviewed by Darin Adler.

Source/WebCore:

The fonts I'm generating in the SVG -> OTF converter have fractional FUnit values for their advances.
The CFF table can encode that, but hmtx can't, which means the font isn't internally consistent.

Covered by existing tests.

* svg/SVGToOTFFontConversion.cpp:

LayoutTests:

* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-01-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-04-t-expected.txt:
* platform/ios-simulator/svg/batik/text/textEffect-expected.txt:
* platform/ios-simulator/svg/batik/text/textEffect3-expected.txt:
* platform/ios-simulator/svg/batik/text/textPosition2-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-04-t-expected.txt:
* platform/mac/svg/batik/text/textEffect3-expected.txt:
* platform/mac/svg/batik/text/textPosition2-expected.txt:
* platform/mac/svg/custom/svg-fonts-fallback-expected.txt:
* platform/mac/svg/wicd/test-rightsizing-b-expected.txt:
* svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:

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

4 years agoAttempt to fix iOS build.
ryanhaddad@apple.com [Fri, 18 Nov 2016 20:01:49 +0000 (20:01 +0000)]
Attempt to fix iOS build.
<rdar://problem/29312689>

Unreviewed build fix.

* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):

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

4 years ago[CSS Parser] Hook up InspectorStyleSheet to the new CSS parser.
hyatt@apple.com [Fri, 18 Nov 2016 19:09:13 +0000 (19:09 +0000)]
[CSS Parser] Hook up InspectorStyleSheet to the new CSS parser.
https://bugs.webkit.org/show_bug.cgi?id=164886

Reviewed by Dean Jackson.

* css/CSSGrammar.y.in:
Get rid of the CSSRuleSourceData type enum, since StyleRule's type
enum is exactly the same.

* css/CSSPropertySourceData.cpp:
(WebCore::CSSPropertySourceData::CSSPropertySourceData):
* css/CSSPropertySourceData.h:
Add a concept of disabled to CSSPropertySourceData. This is used for
commented out properties.

(WebCore::CSSRuleSourceData::create):
(WebCore::CSSRuleSourceData::createUnknown):
(WebCore::CSSRuleSourceData::CSSRuleSourceData):
Get rid of the CSSRuleSourceData type enum, since StyleRule's type
enum is exactly the same.

* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseSheetForInspector):
(WebCore::CSSParser::parseDeclarationForInspector):
(WebCore::CSSParser::markSupportsRuleHeaderStart):
(WebCore::CSSParser::markRuleHeaderStart):
(WebCore::CSSParser::markPropertyEnd):
* css/parser/CSSParser.h:
Add functions that represent the new API for inspector sheet
and declaration parsing. Patch the old parse code to use StyleRule::Type
now that the CSSRuleSourceData type is gone.

* css/parser/CSSParserObserver.h:
Tweak the API for our memory management.

* inspector/InspectorStyleSheet.cpp:
(flattenSourceData):
(WebCore::parserContextForDocument):
(WebCore::StyleSheetHandler::StyleSheetHandler):
(WebCore::StyleSheetHandler::startRuleHeader):
(WebCore::StyleSheetHandler::setRuleHeaderEnd):
(WebCore::StyleSheetHandler::endRuleHeader):
(WebCore::StyleSheetHandler::observeSelector):
(WebCore::StyleSheetHandler::startRuleBody):
(WebCore::StyleSheetHandler::endRuleBody):
(WebCore::StyleSheetHandler::popRuleData):
(WebCore::fixUnparsedProperties):
(WebCore::StyleSheetHandler::fixUnparsedPropertyRanges):
(WebCore::StyleSheetHandler::observeProperty):
(WebCore::StyleSheetHandler::observeComment):
(WebCore::InspectorStyle::populateAllProperties):
(WebCore::isValidSelectorListString):
(WebCore::InspectorStyleSheet::ensureSourceData):
(WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady):
(WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
(WebCore::createCSSParser): Deleted.
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges): Deleted.
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorStyleProperty::setRawTextFromStyleDeclaration):
Add the new implementation. This involves duplicating most of the old
parser code for this into a new class, StyleSheetHandler, that implements
the observer interface and builds up the same data structures as the old
parser did in response to the callbacks.

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

4 years agoWeb Inspector: Generator functions should have a displayable name when shown in stack...
joepeck@webkit.org [Fri, 18 Nov 2016 18:57:17 +0000 (18:57 +0000)]
Web Inspector: Generator functions should have a displayable name when shown in stack traces
https://bugs.webkit.org/show_bug.cgi?id=164844
<rdar://problem/29300697>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/generator-function-name.js:
Add another test now that we name the inner generator function
that we do not break the lexical resolution of names.

Source/JavaScriptCore:

* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createGeneratorFunctionBody):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createGeneratorFunctionBody):
New way to create a generator function with an inferred name.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
* parser/Parser.h:
Pass on the name of the generator wrapper function so we can
use it on the inner generator function.

LayoutTests:

* inspector/debugger/js-stacktrace-expected.txt:
* inspector/debugger/js-stacktrace.html:
Add a test case for console.trace() / Error stack inside of generators.
Modernize the test to reduce redundency and get nicer output.

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

4 years agoTried to fix some non-macOS builds.
mitz@apple.com [Fri, 18 Nov 2016 15:17:36 +0000 (15:17 +0000)]
Tried to fix some non-macOS builds.
<rdar://problems/29331425&29331438&29331722>

* platform/mac/WebPlaybackControlsManager.h:

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

4 years ago[Win32] Start releasing memory earlier when memory is running low.
pvollan@apple.com [Fri, 18 Nov 2016 10:03:18 +0000 (10:03 +0000)]
[Win32] Start releasing memory earlier when memory is running low.
https://bugs.webkit.org/show_bug.cgi?id=164862

Reviewed by Brent Fulgham.

On Windows, 32-bit processes have 2GB of memory available, where some is used by the system.
Debugging has shown that allocations might fail and cause crashes when memory usage is > ~1GB.
We should start releasing memory before we reach 1GB.

* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::CheckMemoryTimer::fired):

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

4 years agoDownloads started by context menu actions should also have a web view associated
carlosgc@webkit.org [Fri, 18 Nov 2016 07:50:57 +0000 (07:50 +0000)]
Downloads started by context menu actions should also have a web view associated
https://bugs.webkit.org/show_bug.cgi?id=164364

Reviewed by Michael Catanzaro.

Source/WebKit2:

When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.

* UIProcess/API/gtk/WebKitDownload.cpp:
(webkitDownloadCreateForRequest): Deleted.
* UIProcess/API/gtk/WebKitDownloadPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
because the WebKitDownload could have already been created by the web view download handler at this point.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
the page client.

Tools:

Add a GTK+ unit tests to check that downloads started by the context menu have a web view associated.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(downloadLocalFileSuccessfully):
(testDownloadOverwriteDestinationDisallowed):
(testDownloadLocalFileError):
(testDownloadRemoteFile):
(testDownloadRemoteFileError):
(testDownloadMIMEType):
(contextMenuCallback):
(testContextMenuDownloadActions):
(beforeAll):

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

4 years agoREGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511
carlosgc@webkit.org [Fri, 18 Nov 2016 07:25:42 +0000 (07:25 +0000)]
REGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511
https://bugs.webkit.org/show_bug.cgi?id=164864

Reviewed by Simon Fraser.

This happens sometimes since r208511 because the same decoder is used by more than one thread at the same
time and the decoders are not thread-safe. Several methods in ImageDecoder need to decode partially the image,
so it's possible that one method calls frameBufferAtIndex at the same times as createFrameImageAtIndex that now
can be called from the image decoder thread. Use a Lock in ImageDecoder to protect calls to frameBufferAtIndex.

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ImageDecoder.h:

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

4 years agoREGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
achristensen@apple.com [Fri, 18 Nov 2016 07:21:37 +0000 (07:21 +0000)]
REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=164631

Reviewed by Carlos Garcia Campos.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):
I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
was not being set to nullptr before it was being checked in NetworkResourceLoader::abort

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

4 years agoFix CMake build after r208865
achristensen@apple.com [Fri, 18 Nov 2016 06:28:05 +0000 (06:28 +0000)]
Fix CMake build after r208865
https://bugs.webkit.org/show_bug.cgi?id=164894

* PlatformMac.cmake:
Add new files.

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