WebKit-https.git
4 years agoURLParser should ignore tabs in authority
achristensen@apple.com [Wed, 28 Sep 2016 21:16:22 +0000 (21:16 +0000)]
URLParser should ignore tabs in authority
https://bugs.webkit.org/show_bug.cgi?id=162694

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseAuthority):

Tools:

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

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

4 years agoURLParser should ignore extra slashes after scheme:// and handle a missing slash...
achristensen@apple.com [Wed, 28 Sep 2016 21:14:44 +0000 (21:14 +0000)]
URLParser should ignore extra slashes after scheme:// and handle a missing slash after the port
https://bugs.webkit.org/show_bug.cgi?id=162690

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

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

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

4 years agoURLParser should correctly canonicalize uppercase IPv6 addresses
achristensen@apple.com [Wed, 28 Sep 2016 21:12:04 +0000 (21:12 +0000)]
URLParser should correctly canonicalize uppercase IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162680

Reviewed by Tim Horton.

Source/WebCore:

Covered by a new API test.

* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv6Host):
If there is an uppercase character in the IPv6 address part, then it is a syntax violation
because the canonicalized IPv6 address differs from the input String.

Tools:

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

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

4 years agoUnreviewed, fix iOS build.
cdumez@apple.com [Wed, 28 Sep 2016 21:08:41 +0000 (21:08 +0000)]
Unreviewed, fix iOS build.

* bindings/js/ios/TouchConstructors.cpp:

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

4 years agoUpdate TestExpectations for more crashing fast/images tests.
ryanhaddad@apple.com [Wed, 28 Sep 2016 20:41:29 +0000 (20:41 +0000)]
Update TestExpectations for more crashing fast/images tests.
https://bugs.webkit.org/show_bug.cgi?id=162696

Unreviewed test gardening.

* TestExpectations:

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

4 years agoIt should be possible to dispatch events on template documents
cdumez@apple.com [Wed, 28 Sep 2016 20:36:46 +0000 (20:36 +0000)]
It should be possible to dispatch events on template documents
https://bugs.webkit.org/show_bug.cgi?id=162687

Reviewed by Ryosuke Niwa.

Source/WebCore:

It should be possible to dispatch events on template documents. Firefox
supports this. Chrome does not but this is likely not intentional as
Chrome generally supports dispatching events on frameless documents.

Test: fast/dom/template-document-dispatchEvent.html

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

LayoutTests:

Add layout test coverage.

* fast/dom/template-document-dispatchEvent-expected.txt: Added.
* fast/dom/template-document-dispatchEvent.html: Added.

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

4 years agoWKSharedAPICast should not warn about acceptable custom context menu tag values
commit-queue@webkit.org [Wed, 28 Sep 2016 20:35:52 +0000 (20:35 +0000)]
WKSharedAPICast should not warn about acceptable custom context menu tag values
https://bugs.webkit.org/show_bug.cgi?id=162597
<rdar://problem/28487627>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-28
Reviewed by Tim Horton.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):
Don't log an error when casting ContextMenu types if it is within
the Custom ContextMenu tag range.

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

4 years agoOptimize B3->Air lowering of Fence on ARM
fpizlo@apple.com [Wed, 28 Sep 2016 20:30:44 +0000 (20:30 +0000)]
Optimize B3->Air lowering of Fence on ARM
https://bugs.webkit.org/show_bug.cgi?id=162342

Reviewed by Geoffrey Garen.

This gives us comprehensive support for standalone fences on x86 and ARM. The changes are as
follows:

- Sets in stone the rule that the heaps of a B3::Fence tell you what the fence protects. If the
  fence reads, it protects motion of stores. If the fence writes, it protects motion of loads.
  This allows us to express for example load-load fences in a portable way: on x86 they will just
  block B3 optimizations and emit no code, while on ARM you will get some fence.

- Adds comprehensive support for WTF-style fences in the ARM assembler. I simplified it just a bit
  to match what B3, the main client, knows. There are three fences: MemoryFence, StoreFence, and
  LoadFence. On x86, MemoryFence is ortop while StoreFence and LoadFence emit no code. On ARM64,
  MemoryFence and LoadFence are dmb ish while StoreFence is dmb ishst.

- Tests! To test this, I needed to teach the disassembler how to disassemble dmb ish and dmb
  ishst. I think that the canonical way to do it would be to create a group for dmb and then teach
  that group how to decode the operands. But I don't actually know what are all of the ways of
  encoding dmb, so I'd rather that unrecognized encodings fall through to the ".long blah"
  bailout. So, this creates explicit matching rules for "dmb ish" and "dmb ishst", which is the
  most conservative thing we can do.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::dmbISH):
(JSC::ARM64Assembler::dmbISHST):
(JSC::ARM64Assembler::dmbSY): Deleted.
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::memoryFence):
(JSC::MacroAssemblerARM64::storeFence):
(JSC::MacroAssemblerARM64::loadFence):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::storeFence):
(JSC::MacroAssemblerX86Common::loadFence):
* b3/B3FenceValue.h:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testMemoryFence):
(JSC::B3::testStoreFence):
(JSC::B3::testLoadFence):
(JSC::B3::run):
(JSC::B3::testX86MFence): Deleted.
(JSC::B3::testX86CompilerFence): Deleted.
* disassembler/ARM64/A64DOpcode.cpp:
(JSC::ARM64Disassembler::A64DOpcodeDmbIsh::format):
(JSC::ARM64Disassembler::A64DOpcodeDmbIshSt::format):
* disassembler/ARM64/A64DOpcode.h:
(JSC::ARM64Disassembler::A64DOpcodeDmbIsh::opName):
(JSC::ARM64Disassembler::A64DOpcodeDmbIshSt::opName):

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

4 years agoUse Color references where possible
dino@apple.com [Wed, 28 Sep 2016 20:19:47 +0000 (20:19 +0000)]
Use Color references where possible
https://bugs.webkit.org/show_bug.cgi?id=162643
<rdar://problem/28506550>

Reviewed by Simon Fraser.

There were a bunch of places where we pass or use
Colors by value. As the Color class gets a bit more
complicated, it would be nice to avoid copying, so
use references where possible.

* css/CSSGradientValue.cpp:
(WebCore::interpolate):
* css/StyleColor.h:
(WebCore::StyleColor::getColor):
(WebCore::StyleColor::resolve):
* css/StyleResolver.h:
(WebCore::StyleResolver::State::backgroundColor):
* dom/Document.h:
(WebCore::Document::textColor):
* editing/FrameSelection.cpp:
(WebCore::disappearsIntoBackground):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasRenderingContext2D.h:
* html/track/TextTrackCueGeneric.h:
* page/PageOverlay.cpp:
(WebCore::PageOverlay::setBackgroundColor):
* page/PageOverlay.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperColor::PropertyWrapperColor):
(WebCore::PropertyWrapperMaybeInvalidColor::PropertyWrapperMaybeInvalidColor):
(WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::strokeColor):
(WebCore::GraphicsContext::fillColor):
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::foregroundColor):
(WebCore::GenericCueData::setForegroundColor):
(WebCore::GenericCueData::backgroundColor):
(WebCore::GenericCueData::setBackgroundColor):
(WebCore::GenericCueData::highlightColor):
(WebCore::GenericCueData::setHighlightColor):
* platform/graphics/ca/TileController.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawFocusRingPath::color):
(WebCore::DisplayList::DrawFocusRingRects::color):
(WebCore::DisplayList::FillRectWithColor::color):
(WebCore::DisplayList::FillCompositedRect::color):
(WebCore::DisplayList::FillRoundedRect::color):
(WebCore::DisplayList::FillRectWithRoundedHole::color):
* platform/graphics/filters/FEDiffuseLighting.cpp:
(WebCore::FEDiffuseLighting::lightingColor):
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FEDropShadow.h:
(WebCore::FEDropShadow::shadowColor):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::floodColor):
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/filters/FEFlood.h:
* platform/graphics/filters/FESpecularLighting.cpp:
(WebCore::FESpecularLighting::lightingColor):
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FilterOperation.h:
* rendering/BorderEdge.h:
(WebCore::BorderEdge::color):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection):
* rendering/InlineTextBox.h:
* rendering/RenderFrameSet.cpp:
(WebCore::borderStartEdgeColor):
(WebCore::borderEndEdgeColor):
(WebCore::borderFillColor):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutlineForLine):
* rendering/RenderInline.h:
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextWithShadows):
* rendering/style/BorderValue.h:
(WebCore::BorderValue::color):
* rendering/style/CollapsedBorderValue.h:
(WebCore::CollapsedBorderValue::color):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::color):
(WebCore::RenderStyle::visitedLinkColor):
(WebCore::RenderStyle::setColor):
(WebCore::RenderStyle::setVisitedLinkColor):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::borderLeftColor):
(WebCore::RenderStyle::borderRightColor):
(WebCore::RenderStyle::borderTopColor):
(WebCore::RenderStyle::borderBottomColor):
(WebCore::RenderStyle::backgroundColor):
(WebCore::RenderStyle::columnRuleColor):
(WebCore::RenderStyle::outlineColor):
(WebCore::RenderStyle::textEmphasisColor):
(WebCore::RenderStyle::textFillColor):
(WebCore::RenderStyle::textStrokeColor):
(WebCore::RenderStyle::visitedLinkBackgroundColor):
(WebCore::RenderStyle::visitedLinkBorderLeftColor):
(WebCore::RenderStyle::visitedLinkBorderRightColor):
(WebCore::RenderStyle::visitedLinkBorderBottomColor):
(WebCore::RenderStyle::visitedLinkBorderTopColor):
(WebCore::RenderStyle::visitedLinkOutlineColor):
(WebCore::RenderStyle::visitedLinkColumnRuleColor):
(WebCore::RenderStyle::textDecorationColor):
(WebCore::RenderStyle::visitedLinkTextDecorationColor):
(WebCore::RenderStyle::visitedLinkTextEmphasisColor):
(WebCore::RenderStyle::visitedLinkTextFillColor):
(WebCore::RenderStyle::visitedLinkTextStrokeColor):
(WebCore::RenderStyle::stopColor):
(WebCore::RenderStyle::floodColor):
(WebCore::RenderStyle::lightingColor):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::buildStops):

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

4 years agoUpdate TestExpectations for crashing fast/images tests.
ryanhaddad@apple.com [Wed, 28 Sep 2016 19:56:30 +0000 (19:56 +0000)]
Update TestExpectations for crashing fast/images tests.
https://bugs.webkit.org/show_bug.cgi?id=162696

Unreviewed test gardening.

* TestExpectations:

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

4 years agoMarking http/tests/cache/disk-cache/disk-cache-redirect.html as flaky.
ryanhaddad@apple.com [Wed, 28 Sep 2016 19:56:28 +0000 (19:56 +0000)]
Marking http/tests/cache/disk-cache/disk-cache-redirect.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=162524

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

4 years agoUnreviewed, woff2 upgrade introduces compiler warnings
annulen@yandex.ru [Wed, 28 Sep 2016 19:48:00 +0000 (19:48 +0000)]
Unreviewed, woff2 upgrade introduces compiler warnings
https://bugs.webkit.org/show_bug.cgi?id=162678

* woff2/CMakeLists.txt:

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

4 years agoassignedNodes should include fallback contents when flattened option is set
rniwa@webkit.org [Wed, 28 Sep 2016 19:37:14 +0000 (19:37 +0000)]
assignedNodes should include fallback contents when flattened option is set
https://bugs.webkit.org/show_bug.cgi?id=162656

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaselined the tests now that all the test cases are passing.

* web-platform-tests/shadow-dom/slots-expected.txt:
* web-platform-tests/shadow-dom/slots-fallback-expected.txt:

Source/WebCore:

Fixed the bug by traversing through fallback contents when there are no assigned nodes.

Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
       imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html

* html/HTMLSlotElement.cpp:
(WebCore::flattenAssignedNodes):
(WebCore::HTMLSlotElement::assignedNodes):

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

4 years agoAdopt #pragma once in some generated resources
commit-queue@webkit.org [Wed, 28 Sep 2016 19:34:27 +0000 (19:34 +0000)]
Adopt #pragma once in some generated resources
https://bugs.webkit.org/show_bug.cgi?id=162666

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-28
Reviewed by Alex Christensen.

* Scripts/builtins/builtins_generate_combined_header.py:
* Scripts/builtins/builtins_generate_internals_wrapper_header.py:
* Scripts/builtins/builtins_generate_internals_wrapper_implementation.py:
* Scripts/builtins/builtins_generate_separate_header.py:
* Scripts/builtins/builtins_generate_wrapper_header.py:
* Scripts/builtins/builtins_generate_wrapper_implementation.py:
Remove headerGuard attribute unused by templates.

* Scripts/tests/builtins/expected/JavaScriptCore-Operations.Promise-Combined.js-result: Removed.
No such test exists. It was likely renamed.

* generate-bytecode-files:
Simplify header guard output.

* inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py:
(ObjCBackendDispatcherHeaderGenerator.generate_output):
* replay/scripts/CodeGeneratorReplayInputs.py:
(Generator.generate_header):
* replay/scripts/CodeGeneratorReplayInputsTemplates.py:
Simplify header guard output.

* replay/scripts/tests/expected/generate-enum-encoding-helpers-with-guarded-values.json-TestReplayInputs.h:
* replay/scripts/tests/expected/generate-enum-encoding-helpers.json-TestReplayInputs.h:
* replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.h:
* replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h:
* replay/scripts/tests/expected/generate-input-with-guard.json-TestReplayInputs.h:
* replay/scripts/tests/expected/generate-input-with-vector-members.json-TestReplayInputs.h:
* replay/scripts/tests/expected/generate-inputs-with-flags.json-TestReplayInputs.h:
* replay/scripts/tests/expected/generate-memoized-type-modes.json-TestReplayInputs.h:
Rebaseline.

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

4 years agowoff2 upgrade introduces compiler warnings
mcatanzaro@igalia.com [Wed, 28 Sep 2016 19:32:36 +0000 (19:32 +0000)]
woff2 upgrade introduces compiler warnings
https://bugs.webkit.org/show_bug.cgi?id=162678

Reviewed by Alex Christensen.

* woff2/CMakeLists.txt:

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

4 years agoStore-load fences should be a lot cheaper on ARM
fpizlo@apple.com [Wed, 28 Sep 2016 19:11:49 +0000 (19:11 +0000)]
Store-load fences should be a lot cheaper on ARM
https://bugs.webkit.org/show_bug.cgi?id=162461

Rubber stamped by Keith Miller.

It turns out that they are already cheap enough, so this change just make us use them.

* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::visitChildren):

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

4 years agoAdopt MediaRemote SPI to achieve desired Now Playing behavior
wenson_hsieh@apple.com [Wed, 28 Sep 2016 18:17:49 +0000 (18:17 +0000)]
Adopt MediaRemote SPI to achieve desired Now Playing behavior
https://bugs.webkit.org/show_bug.cgi?id=162658
<rdar://problem/28499358>

Reviewed by Jer Noble.

Source/WebCore:

Restores the changes previously rolled out in r206444, and adopts new MediaRemote SPI to achieve the desired
behavior for media in background tabs without breaking other features.

Introduces 2 new unit tests in NowPlayingControlsTests.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::pageAllowsNowPlayingControls):
* page/Page.cpp:
(WebCore::Page::setViewState):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession):
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:
* platform/spi/mac/MediaRemoteSPI.h:

Source/WebKit2:

Plumbs Now Playing session information (for now, this is just a flag indicating whether or not there is an
active session) across from the web process to the UI process for testing in the form of asynchronous request/
handle-response messages on the WebPage and its proxy in the UI process.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActiveNowPlayingSessionInfo]):
(-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
(WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo):

Tools:

Introduces 2 unit tests in the new NowPlayingControlsTests test suite. Also provides some basic support for
mocking key window status for TestWKWebViews.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/NowPlayingControlsTests.mm: Added.
(-[NowPlayingTestWebView hasActiveNowPlayingSession]):
(-[NowPlayingTestWebView expectHasActiveNowPlayingSession:]):
(-[NowPlayingTestWebView _handleActiveNowPlayingSessionInfoResponse:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/large-video-test-now-playing.html: Added.
* TestWebKitAPI/mac/TestWKWebViewMac.mm:
(-[TestWKWebViewHostWindow isKeyWindow]):
(-[TestWKWebViewHostWindow makeKeyWindow]):
(-[TestWKWebViewHostWindow resignKeyWindow]):

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

4 years agoREGRESSION(r206481): ASSERTION FAILED: isDecoderAvailable()
commit-queue@webkit.org [Wed, 28 Sep 2016 17:33:41 +0000 (17:33 +0000)]
REGRESSION(r206481): ASSERTION FAILED: isDecoderAvailable()
https://bugs.webkit.org/show_bug.cgi?id=162665

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-09-28
Reviewed by Simon Fraser.

Remove a wrong assertion from ImageSource::destroyDecodedData(). Before
r206481, the original function BitmapImage::destroyDecodedData() did not
have this assertion. Destroying the decoded ImageFrames can happen after
releasing the ImageDecoder. And it can happen also if decoding the image
fails and BitmapImage::isNull() is true. See CachedImage::finishLoading().

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::destroyDecodedData):

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

4 years agoUnreviewed, rolling out r206522.
ryanhaddad@apple.com [Wed, 28 Sep 2016 17:08:17 +0000 (17:08 +0000)]
Unreviewed, rolling out r206522.

Roll r206506 back in since the build fix landed in r206521

Reverted changeset:

"Unreviewed, rolling out r206506."
https://bugs.webkit.org/show_bug.cgi?id=162682
http://trac.webkit.org/changeset/206522

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

4 years agoWebCore::ResourceErrorBase::setType is crashing
commit-queue@webkit.org [Wed, 28 Sep 2016 16:37:26 +0000 (16:37 +0000)]
WebCore::ResourceErrorBase::setType is crashing
https://bugs.webkit.org/show_bug.cgi?id=162484
<rdar://problem/28390828>

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-28
Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html

Behavior is slightly changed as we are no longer casting Timeout preflight errors as AccessControl errors.
This is more inline with fetch spec which prescribes to send back any error received by preflight as response error for fetch.

Ideally, we should not need to change errors received during preflight loads but the error type is important for some clients:
- EventSource may try to reconnect if error is not AccessControl
- XMLHttpRequest will send abort events in case of Cancellation errors and timeout events in case of Timeout errors

* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished): Setting error type to AccessControl except in case of Timeout.
(WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::preflightFailure): Removing ASSERT since Timeout errors may be returned.
* platform/network/ResourceErrorBase.h:
(WebCore::ResourceErrorBase::isGeneral): New getter.

LayoutTests:

* http/tests/xmlhttprequest/on-network-timeout-error-during-preflight-expected.txt: Added.
* http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html: Added.
* tests-options.json: Marking test as slow.

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

4 years agoCorrect 'safeCast' implementation
bfulgham@apple.com [Wed, 28 Sep 2016 16:34:06 +0000 (16:34 +0000)]
Correct 'safeCast' implementation
https://bugs.webkit.org/show_bug.cgi?id=162679
<rdar://problem/28518189>

Reviewed by Zalan Bujtas.

* wtf/StdLibExtras.h:
(WTF::safeCast): Use a RELEASE_ASSERT.

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

4 years agoUnreviewed, rolling out r206506.
commit-queue@webkit.org [Wed, 28 Sep 2016 16:33:16 +0000 (16:33 +0000)]
Unreviewed, rolling out r206506.
https://bugs.webkit.org/show_bug.cgi?id=162682

Broke the Windows and WinCairo builds. (Requested by
ryanhaddad on #webkit).

Reverted changeset:

"Adopt #pragma once in JavaScriptCore"
https://bugs.webkit.org/show_bug.cgi?id=162664
http://trac.webkit.org/changeset/206506

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

4 years ago[Win] Compile fix.
pvollan@apple.com [Wed, 28 Sep 2016 16:30:17 +0000 (16:30 +0000)]
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=162670

Reviewed by Brent Fulgham.

Make sure we include JavaScriptCore files from the forwarding headers folder.
Otherwise we might get multiple definitions if a JSC file is included both
from the forwarding headers folder and the JSC source folder, since
#pragma once is used in the header files.

* DumpRenderTree/TestRunner.cpp:

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

4 years agoPiP shows incorrect state of play button.
jer.noble@apple.com [Wed, 28 Sep 2016 16:26:44 +0000 (16:26 +0000)]
PiP shows incorrect state of play button.
https://bugs.webkit.org/show_bug.cgi?id=162652

Reviewed by Eric Carlson.

After getting a new WebPlaybackSessionModel, the first thing WebVideoFullscreenInterfaceMac
should do is query for it's playbackRate() and isPlaying() properties.

* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):

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

4 years ago[GTK] Add Chrome UA quirk
mcatanzaro@igalia.com [Wed, 28 Sep 2016 15:34:11 +0000 (15:34 +0000)]
[GTK] Add Chrome UA quirk
https://bugs.webkit.org/show_bug.cgi?id=162617

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Add Chrome UA quirk and use it on typekit.net, typekit.com, youtube.com, slack.com, and
any domain that begins with "google".

* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
(WebCore::urlRequiresChromeBrowser):
(WebCore::standardUserAgentForURL):

Tools:

Update test. This portion of the commit was actually unreviewed.

* TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

4 years ago[MSE][Mac] In SourceBufferPrivateAVFObjC::abort(), support reseting parser to the...
jer.noble@apple.com [Wed, 28 Sep 2016 14:52:48 +0000 (14:52 +0000)]
[MSE][Mac] In SourceBufferPrivateAVFObjC::abort(), support reseting parser to the last appended initialization segment.
https://bugs.webkit.org/show_bug.cgi?id=135164

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-abort-resets-parser.html

Use the -[AVStreamDataParser appendStreamData:withFlags:] to implement "resetting" the parser. In this case,
the parser isn't explicitly reset during resetParserState(), but rather a flag is set so that the next append
signals a data discontinuity, and the parser is reset at that point.

Because a previous append operation may be in-flight during this abort(), care must be taken to invalidate any
operations which may have already started on a background thread. So SourceBufferPrivateAVFObjC will use a
separate WeakPtrFactory for its append operations, will invalidate any outstanding WeakPtrs during an abort(),
and will block until the previous append() operation completes.

This will require the WebAVStreamDataParserListener object to occasionally have it's WeakPtr pointing back to the
SourceBufferPrivateAVFObjC to be reset after an abort(), so make that ivar an @property. Rather than passing a
RetainPtr to itself in all the callbacks it handles, the WebAVStreamDataParserListener can just pass in a copy
of its own WeakPtr (which may be invalidated during an abort()).

Break the distinct operations of "abort()" and "resetParserState()" into their own methods in SourceBufferPrivate
and all its subclasses.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::abortIfUpdating):
* platform/graphics/SourceBufferPrivate.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
(-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
(-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]):
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(-[WebAVStreamDataParserListener initWithParser:parent:]): Deleted.
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::resetParserState):
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::resetParserState):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
* platform/spi/mac/AVFoundationSPI.h:

LayoutTests:

* media/media-source/media-source-abort-resets-parser-expected.txt: Added.
* media/media-source/media-source-abort-resets-parser.html: Added.

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

4 years ago[GTK] User agent should always claim to be Intel
mcatanzaro@igalia.com [Wed, 28 Sep 2016 14:49:14 +0000 (14:49 +0000)]
[GTK] User agent should always claim to be Intel
https://bugs.webkit.org/show_bug.cgi?id=162610

Reviewed by Carlos Garcia Campos.

We should always claim to be running on Intel regardless of actual CPU type. See discussion
in bug #162548 for details. In particular, we can never advertise ARM because it causes dumb
websites to send mobile pages.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformVersionForUAString):
(WebCore::buildUserAgentString):
(WebCore::cpuDescriptionForUAString): Deleted.

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

4 years ago[GTK] Adjust OS X UA quirks list
mcatanzaro@igalia.com [Wed, 28 Sep 2016 14:45:26 +0000 (14:45 +0000)]
[GTK] Adjust OS X UA quirks list
https://bugs.webkit.org/show_bug.cgi?id=162616

"Reviewed" by Carlos Garcia Campos.

Update test. This portion of the commit was actually unreviewed.

* TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

4 years ago[GTK] Adjust OS X UA quirks list
mcatanzaro@igalia.com [Wed, 28 Sep 2016 14:40:31 +0000 (14:40 +0000)]
[GTK] Adjust OS X UA quirks list
https://bugs.webkit.org/show_bug.cgi?id=162616

Reviewed by Carlos Garcia Campos.

Remove the OS X quirk for yahoo.com as it's no longer needed. Add quirks for taobao.com and
whatsapp.com.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::standardUserAgentForURL):

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

4 years agoAdd WebIDL special operation support: serializer
commit-queue@webkit.org [Wed, 28 Sep 2016 13:18:37 +0000 (13:18 +0000)]
Add WebIDL special operation support: serializer
https://bugs.webkit.org/show_bug.cgi?id=156293

Patch by Alejandro G. Castro <alex@igalia.com> on 2016-09-28
Reviewed by Youenn Fablet.

Source/WebCore:

Added support for the serializer special operation for WebIDLs,
current implementation adds support for:
  - just the keyword: serializer; It will return all the
    attributes of in an object.
  - map of entries with the attributes: serializer = {attribute1,
    attribute2, ...}

It creates a toJSON method that returns the serialized value
converted into an ECMAScript value. For more information check the
definition of the operation:

http://heycam.github.io/webidl/#idl-serializers

We have created a new function in the API of the objects
that are marked as serializer.

Used the support to add new API for RTCIceCandidate and
RTCSessionDescription.

Updated the tests expectations of the bindings.

Tests: bindings/scripts/test/TestNode.idl
       bindings/scripts/test/TestObj.idl
       fast/mediastream/RTCIceCandidate.html
       fast/mediastream/RTCSessionDescription.html

* Modules/mediastream/RTCIceCandidate.idl: Added the serializer
operation.
* Modules/mediastream/RTCSessionDescription.idl: Added the
serializer operation.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Added the calls to the serializer
code generator.
(GenerateSerializerFunction): Added, generates the toJSON function
adding all the serializable->attributes value to an object as
defined in the spec.
* bindings/scripts/IDLParser.pm: Modified the serializer parser
that was unused to support the WebIDL spec parts. Added a new
domSerializable type to store the list of attributes in the
possible map.
(parseSerializer): Modified the function to follow the
semicolon rule in the spec, now the serializer line must have a
semicolon like any other line.
(parseSerializerRest): The function now has to get the attributes
list from the pattern parsing function and add them to the
domSerializable item.
(parseSerializationPattern): Now this function returns the list of
attributes in the serializable map or list if we have one.
(parseSerializationAttributes): Added, this function replaces the
Map and List functions, the currently supported parts are similar
for both situations.
(applyMemberList): Added the serializable item to the interface
variable and populate the serializable in case there is not a
defined map.
(parseSerializationPatternMap): Replaced with
parseSerializationAttributes.
(parseSerializationPatternList): Ditto.
* bindings/scripts/test/JS/JSTestNode.cpp: Modified the expected result.
(WebCore::jsTestNodePrototypeFunctionToJSON):
* bindings/scripts/test/JS/JSTestObj.cpp: Modified the expected result.
(WebCore::jsTestObjPrototypeFunctionToJSON):
* bindings/scripts/test/TestNode.idl: Added the serializer test.
* bindings/scripts/test/TestObj.idl: Added serializer map test.

LayoutTests:

Verify the new API of the objects and check what happens when user
modifies the values and types of the attributes, or adds a null value.

* fast/mediastream/RTCIceCandidate-expected.txt:
* fast/mediastream/RTCIceCandidate.html:
* fast/mediastream/RTCSessionDescription-expected.txt:
* fast/mediastream/RTCSessionDescription.html:

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

4 years ago[GTK] Simplify platformForUAString
mcatanzaro@igalia.com [Wed, 28 Sep 2016 12:54:50 +0000 (12:54 +0000)]
[GTK] Simplify platformForUAString
https://bugs.webkit.org/show_bug.cgi?id=162614

Reviewed by Carlos Garcia Campos.

Note in particular that the previous PLATFORM(MAC) check was wrong here, as that is never
true for GTK; this patch risks changing it to OS(MAC_OS_X), on the hope that advertising Mac
when running on Mac might not break anything. If it does, then we should remove it and just
always pretend to be on X11.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformForUAString):

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

4 years ago[GTK] Bump fake Safari version in UA
mcatanzaro@igalia.com [Wed, 28 Sep 2016 12:54:12 +0000 (12:54 +0000)]
[GTK] Bump fake Safari version in UA
https://bugs.webkit.org/show_bug.cgi?id=162615

Reviewed by Carlos Garcia Campos.

Pretend to be Safari 10.0 to fix sites that don't work when we pretend to be Safari 8.0.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):

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

4 years agoSource/ThirdParty:
fred.wang@free.fr [Wed, 28 Sep 2016 12:46:18 +0000 (12:46 +0000)]
Source/ThirdParty:
Update woff2 to latest revision
https://bugs.webkit.org/show_bug.cgi?id=162608

Patch by Khaled Hosny <khaledhosny@eglug.org> on 2016-09-28
Reviewed by Michael Catanzaro.

* woff2/CMakeLists.txt:
* woff2/README.webkit:
* woff2/src/file.h:
(woff2::GetFileContent):
(woff2::SetFileContents):
* woff2/src/font.cc:
* woff2/src/font.h:
* woff2/src/glyph.cc:
* woff2/src/store_bytes.h:
(woff2::Store16):
* woff2/src/transform.cc:
* woff2/src/woff2_common.cc:
* woff2/src/woff2_compress.cc:
* woff2/src/woff2_dec.cc:
* woff2/src/woff2_dec.h:
* woff2/src/woff2_decompress.cc:
* woff2/src/woff2_enc.cc:
* woff2/src/woff2_out.cc: Added.
* woff2/src/woff2_out.h: Added.
(woff2::WOFF2Out::~WOFF2Out):
(woff2::WOFF2StringOut::MaxSize):

Source/WebCore:
Use new woff2 API
https://bugs.webkit.org/show_bug.cgi?id=162608

Patch by Khaled Hosny <khaledhosny@eglug.org> on 2016-09-28
Reviewed by Michael Catanzaro.

Test: fast/text/woff2-totalsfntsize.html

* platform/graphics/WOFFFileFormat.cpp:
(WebCore::WOFF2VectorOut::WOFF2VectorOut):
(WebCore::WOFF2VectorOut::Write):
(WebCore::WOFF2VectorOut::Size):
(WebCore::convertWOFFToSfnt):

LayoutTests:
Use new woff2 API
https://bugs.webkit.org/show_bug.cgi?id=162608

Patch by Khaled Hosny <khaledhosny@eglug.org> on 2016-09-28
Reviewed by Michael Catanzaro.

* fast/text/resources/header-totalsfntsize-001.ttf: Added.
* fast/text/resources/header-totalsfntsize-001.woff2: Added.
* fast/text/woff2-totalsfntsize-expected.html: Added.
* fast/text/woff2-totalsfntsize.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

4 years ago[GTK] Add warning comment in UserAgentGtk.cpp
mcatanzaro@igalia.com [Wed, 28 Sep 2016 11:11:48 +0000 (11:11 +0000)]
[GTK] Add warning comment in UserAgentGtk.cpp
https://bugs.webkit.org/show_bug.cgi?id=162618

Reviewed by Carlos Garcia Campos.

* platform/gtk/UserAgentGtk.cpp:

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

4 years ago[cmake] Suppress Clang warnings in brotli and woff2
annulen@yandex.ru [Wed, 28 Sep 2016 10:00:59 +0000 (10:00 +0000)]
[cmake] Suppress Clang warnings in brotli and woff2
https://bugs.webkit.org/show_bug.cgi?id=162663

Reviewed by Michael Catanzaro.

* brotli/CMakeLists.txt:
* woff2/CMakeLists.txt:

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

4 years ago[Streams API] Align cancelReadableStream() with spec
commit-queue@webkit.org [Wed, 28 Sep 2016 09:17:57 +0000 (09:17 +0000)]
[Streams API] Align cancelReadableStream() with spec
https://bugs.webkit.org/show_bug.cgi?id=162556

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-09-28
Reviewed by Xabier Rodriguez-Calvar.

Aligned cancelReadableStream() with Streams API. In particular, private cancel() method
was added to ReadableStreamDefaultController and function name was replaced by readableStreamCancel().
Implementation of cancel() (as well as pull()) is actually made in ReadableStreamInternals.js to
avoid creating new function for each controller.

No change in behaviour.

* Modules/streams/ReadableStream.js:
(cancel): Updated with reference to readableStreamCancel().
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel): Updated with reference to readableStreamCancel().
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultController): Refer to external functions (cancel/pull) to avoid
creating new functions.
(teeReadableStreamBranch2CancelFunction): Updated with reference to readableStreamCancel().
(readableStreamCancel): New name for cancelReadableStream(), behaviour aligned with spec.
(readableStreamDefaultControllerCancel): Added to avoid creating new function for each controller.
(readableStreamDefaultControllerPull): Added to avoid creating new function for each controller.
(readFromReadableStreamDefaultReader): Updated call to pull method to pass controller.
* bindings/js/WebCoreBuiltinNames.h: Added "cancel".

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

4 years ago[GTK] Remove obsolete comment from OptionsGTK.cmake
mcatanzaro@igalia.com [Wed, 28 Sep 2016 08:17:55 +0000 (08:17 +0000)]
[GTK] Remove obsolete comment from OptionsGTK.cmake
https://bugs.webkit.org/show_bug.cgi?id=162622

Reviewed by Alex Christensen.

* Source/cmake/OptionsGTK.cmake:

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

4 years agoAdopt #pragma once in JavaScriptCore
commit-queue@webkit.org [Wed, 28 Sep 2016 08:10:35 +0000 (08:10 +0000)]
Adopt #pragma once in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=162664

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-28
Reviewed by Saam Barati.

* **/**.h:
Adopt pragma once in all but API headers and generated headers.
Include some namespace closing comments for consistency.

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

4 years ago[GTK] Switch to use GMenu internally in the context menu implementation
carlosgc@webkit.org [Wed, 28 Sep 2016 07:49:05 +0000 (07:49 +0000)]
[GTK] Switch to use GMenu internally in the context menu implementation
https://bugs.webkit.org/show_bug.cgi?id=162603

Reviewed by Michael Catanzaro.

Source/WebKit2:

Switch to use GAction instead of GtkAction internally, but still keeping a GtkAction associated to the GAction,
because our API depends on GtkAction.

* Shared/gtk/WebContextMenuItemGtk.cpp:
(WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk):
(WebKit::WebContextMenuItemGtk::createActionIfNeeded): Create the GAction and the associated GtkAction. Ensure a
unique name for the GAction, since the name now matters.
* Shared/gtk/WebContextMenuItemGtk.h:
(WebKit::WebContextMenuItemGtk::gtkAction):
(WebKit::WebContextMenuItemGtk::gAction):
(WebKit::WebContextMenuItemGtk::submenuItems): Deleted.
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::contextMenuItemActivatedCallback): Use the GAction.
(WebKit::WebContextMenuProxyGtk::append): Create a new GMenuItem for the GAction.
(WebKit::WebContextMenuProxyGtk::buildMenu): Build a GMenu for the given items.
(WebKit::WebContextMenuProxyGtk::populate): Create a GMenu and bind it ot the GtkMenu.
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): Create the GActionGroup for the menu.
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Remove the action group from the GtkMenu.
* UIProcess/gtk/WebContextMenuProxyGtk.h:

Tools:

Remove smart separators test, since that's now done automatically by GTK+.

* TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp:
(beforeAll):
(testContextMenuWebExtensionMenu): Deleted.

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

4 years agoUnreviewed, build fix for several CMake ports after r206440
utatane.tea@gmail.com [Wed, 28 Sep 2016 07:17:24 +0000 (07:17 +0000)]
Unreviewed, build fix for several CMake ports after r206440

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFeatures.cmake:

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

4 years ago[EFL] Fix debug build break since r206481. Unreviewed
jh718.park@samsung.com [Wed, 28 Sep 2016 06:45:17 +0000 (06:45 +0000)]
[EFL] Fix debug build break since r206481. Unreviewed
https://bugs.webkit.org/show_bug.cgi?id=162662

No new tests, no new behaviours.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):

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

4 years ago[CMake] Add HAVE_LOCALTIME_R definition
commit-queue@webkit.org [Wed, 28 Sep 2016 04:52:52 +0000 (04:52 +0000)]
[CMake] Add HAVE_LOCALTIME_R definition
https://bugs.webkit.org/show_bug.cgi?id=162636

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2016-09-27
Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsCommon.cmake:

Source/WTF:

* wtf/DateMath.cpp:
(WTF::getLocalTime):
* wtf/GregorianDateTime.cpp:
(WTF::GregorianDateTime::setToCurrentLocalTime):
* wtf/Platform.h:

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

4 years agoUpdate style guide for #pragma once
commit-queue@webkit.org [Wed, 28 Sep 2016 04:35:27 +0000 (04:35 +0000)]
Update style guide for #pragma once
https://bugs.webkit.org/show_bug.cgi?id=162633

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-27
Reviewed by Dan Bernstein.

* code-style.md:
Update style guide for #pragma once as discussed on webkit-dev.

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

4 years agoAX: CrashTracer: com.apple.WebKit.WebContent at WebCore::AXObjectCache::localCaretRec...
n_wang@apple.com [Wed, 28 Sep 2016 04:09:21 +0000 (04:09 +0000)]
AX: CrashTracer: com.apple.WebKit.WebContent at WebCore::AXObjectCache::localCaretRectForCharacterOffset(WebCore::RenderObject*&, WebCore::CharacterOffset const&) + 116
https://bugs.webkit.org/show_bug.cgi?id=162654

Reviewed by Chris Fleizach.

Source/WebCore:

rangeForUnorderedCharacterOffsets() can return a null Range but we failed to
do a null check in localCaretRectForCharacterOffset() before dereferencing it.

Test: accessibility/mac/bounds-for-range-crash.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::localCaretRectForCharacterOffset):

LayoutTests:

* accessibility/mac/bounds-for-range-crash-expected.txt: Added.
* accessibility/mac/bounds-for-range-crash.html: Added.

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

4 years agoToggling display: none on a parent element of a slot which shares style with its...
rniwa@webkit.org [Wed, 28 Sep 2016 03:03:40 +0000 (03:03 +0000)]
Toggling display: none on a parent element of a slot which shares style with its parent doesn't update the slot's visibility
https://bugs.webkit.org/show_bug.cgi?id=158421

Reviewed by Darin Adler.

Add a regression test now that the bug has been fixed by r206403.

* fast/shadow-dom/shadow-layout-after-toggling-display-slot-parent-expected.html: Added.
* fast/shadow-dom/shadow-layout-after-toggling-display-slot-parent.html: Added.

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

4 years ago[iOS] Fix several Touch-related layout tests
cdumez@apple.com [Wed, 28 Sep 2016 01:58:45 +0000 (01:58 +0000)]
[iOS] Fix several Touch-related layout tests
https://bugs.webkit.org/show_bug.cgi?id=162651

Reviewed by Darin Adler.

Fix several Touch-related layout tests. The first parameter to our Touch
constructor must be a Window but several of our tests were passing in a
Document.

* platform/ios-simulator/ios/touch/construct-Touch-expected.txt:
* platform/ios-simulator/ios/touch/resources/construct-Touch.js:
* platform/ios-simulator/ios/touch/resources/construct-TouchList.js:

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

4 years agoInline critical functions in URLParser
achristensen@apple.com [Wed, 28 Sep 2016 01:23:50 +0000 (01:23 +0000)]
Inline critical functions in URLParser
https://bugs.webkit.org/show_bug.cgi?id=162653

Reviewed by Myles C. Maxfield.

This gives me about a 15% speed improvement.

* platform/URLParser.cpp:
(WebCore::CodePointIterator::CodePointIterator):
(WebCore::CodePointIterator::operator==):
(WebCore::CodePointIterator::operator!=):
(WebCore::CodePointIterator::operator=):
(WebCore::CodePointIterator::atEnd):
(WebCore::CodePointIterator::codeUnitsSince):
(WebCore::CodePointIterator<LChar>::operator):
(WebCore::CodePointIterator<UChar>::operator):
(WebCore::appendCodePoint):
(WebCore::isC0Control):
(WebCore::isC0ControlOrSpace):
(WebCore::isTabOrNewline):
(WebCore::isInSimpleEncodeSet):
(WebCore::isInDefaultEncodeSet):
(WebCore::isInUserInfoEncodeSet):
(WebCore::isInvalidDomainCharacter):
(WebCore::isPercentOrNonASCII):
(WebCore::isSlashQuestionOrHash):
(WebCore::isValidSchemeCharacter):
(WebCore::URLParser::advance):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::percentEncodeByte):
(WebCore::URLParser::utf8PercentEncode):
(WebCore::URLParser::utf8QueryEncode):
(WebCore::isDefaultPort):
(WebCore::isSpecialScheme):
(WebCore::isPercentEncodedDot):
(WebCore::isSingleDotPathSegment):
(WebCore::isDoubleDotPathSegment):
(WebCore::consumeSingleDotPathSegment):
(WebCore::consumeDoubleDotPathSegment):
(WebCore::URLParser::popPath):
(WebCore::URLParser::parsedDataView):
(WebCore::URLParser::currentPosition):
(WebCore::zeroSequenceLength):
(WebCore::findLongestZeroSequence):
(WebCore::pow256):
(WebCore::percentDecode):
(WebCore::containsOnlyASCII):
(WebCore::domainToASCII):
(WebCore::hasInvalidDomainCharacter):
(WebCore::formURLDecode):
(WebCore::serializeURLEncodedForm):

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

4 years agoREGRESSION (r204552): Yelp carousel animation is not smooth.
zalan@apple.com [Wed, 28 Sep 2016 01:17:17 +0000 (01:17 +0000)]
REGRESSION (r204552): Yelp carousel animation is not smooth.
https://bugs.webkit.org/show_bug.cgi?id=162632

Reviewed by Simon Fraser.

Source/WebCore:

For composited state changes when the layers don't need rebuilding, the updateGeometry() traversal
is post-order (see webkit.org/162634), so we can't rely on the offsetfromRenderer() value when
computing the graphics layer position on the descendants. We need this workaround until after webkit.org/162634
gets fixed.

Tests: compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html
       compositing/hidpi-negative-composited-bounds-on-device-pixel.html

* rendering/RenderLayerBacking.cpp:
(WebCore::computeOffsetFromAncestorGraphicsLayer):
(WebCore::ComputedOffsets::ComputedOffsets):
(WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):

LayoutTests:

* compositing/hidpi-composited-container-and-graphics-layer-gap-changes-expected.html: Added.
* compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html: Added.
* compositing/hidpi-negative-composited-bounds-on-device-pixel-expected.html: Added.
* compositing/hidpi-negative-composited-bounds-on-device-pixel.html: Added.

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

4 years agoMissing Atomics.h include in MarkedBlock.h
jfbastien@apple.com [Wed, 28 Sep 2016 01:11:07 +0000 (01:11 +0000)]
Missing Atomics.h include in MarkedBlock.h
https://bugs.webkit.org/show_bug.cgi?id=162648

Missing include from my previous patch.

Reviewed by Yusuke Suzuki.

* heap/MarkedBlock.h:

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

4 years agoMove caching the ImageFrame from BitmapImage to ImageSource
commit-queue@webkit.org [Wed, 28 Sep 2016 01:06:57 +0000 (01:06 +0000)]
Move caching the ImageFrame from BitmapImage to ImageSource
https://bugs.webkit.org/show_bug.cgi?id=155498

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-09-27
Reviewed by Simon Fraser.

BitmapImage has two modes of operation regarding its image decoding state.
The first mode happens when a remote image is loaded as encoded data and
which requires an ImageDecoder to generate the image metadata and the
the ImageFrames. The second mode happens when a BitmapImage is created
with a NativeImagePtr. In this case, no ImageDecoder is needed.

To remove this burden from the BitmapImage the member 'm_frames' is removed
from BitmapImage. A new member named 'm_frameCache' of type ImageFrameCache
is added to ImageSource. This class handles caching and recaching the image
metadata and the ImageFrames if the image needs decoding. When the BitmapImage
is initialized with a memory image, the ImageFrameCache initializes its
metadata and ImageFrames directly from the NativeImagePtr.

The plan for ImageFrameCache is to be extended for the asynchronous image
decoding and also to be used by the non CG image decoders which cache
other copies of the ImageFrames. This double caching should be removed.

When the BitmapImage is replying to the ImageFrame queries, it will ask the
ImageSource which will pass the query the ImageFrameCache. ImageFrameCache
will ensure the requested ImageFrame is cached and is valid for the requested
SubSamplingLevel before accessing the data members of this ImageFrame.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add and ImageFrameCache.cpp to the WebCore project.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::BitmapImage): Move initializing the image metadata to
ImageSource. Add initializers for the remaining members in the class declaration.

(WebCore::BitmapImage::destroyDecodedData): Move most of the logic of this
function to ImageFrameCache::destroyDecodedData(). The only part which can't
be moved is the call invalidatePlatformData().

(WebCore::BitmapImage::destroyDecodedDataIfNecessary): Move the logic of this
function to ImageFrameCache::destroyDecodedDataIfNecessary().

(WebCore::BitmapImage::dataChanged): Move the logic of this function to
ImageSource::dataChanged().

(WebCore::BitmapImage::frameImageAtIndex): Move most of the logic of this
function to ImageFrameCache::frameImageAtIndex(). The only part which can't
be moved is the call invalidatePlatformData() if the required subsampling
level is different from the subsampling level for the cached frame image.

(WebCore::BitmapImage::draw): Replace the BitmapImage  cached metadata with
the corresponding ImageSource cached metadata.
(WebCore::BitmapImage::drawPattern): Ditto.
(WebCore::BitmapImage::shouldAnimate): Ditto.
(WebCore::BitmapImage::startAnimation): Ditto.
(WebCore::BitmapImage::internalAdvanceAnimation): Ditto.

(WebCore::BitmapImage::dump): Call ImageSource::dump() to dump the image
cached metadata.

(WebCore::BitmapImage::haveFrameImageAtIndex): Deleted.
(WebCore::BitmapImage::destroyMetadataAndNotify): Deleted.
(WebCore::BitmapImage::cacheFrame): Deleted.
(WebCore::BitmapImage::didDecodeProperties): Deleted.
(WebCore::BitmapImage::updateSize): Deleted.
(WebCore::BitmapImage::size): Deleted.
(WebCore::BitmapImage::sizeRespectingOrientation): Deleted.
(WebCore::BitmapImage::hotSpot): Deleted.
(WebCore::BitmapImage::frameCount): Deleted.
(WebCore::BitmapImage::isSizeAvailable): Deleted.
(WebCore::BitmapImage::ensureFrameAtIndexIsCached): Deleted.
(WebCore::BitmapImage::frameIsCompleteAtIndex): Deleted.
(WebCore::BitmapImage::frameDurationAtIndex): Deleted.
(WebCore::BitmapImage::frameHasAlphaAtIndex): Deleted.
(WebCore::BitmapImage::currentFrameKnownToBeOpaque): Deleted.
(WebCore::BitmapImage::frameOrientationAtIndex): Deleted.
(WebCore::BitmapImage::singlePixelSolidColor): Deleted.
(WebCore::BitmapImage::repetitionCount): Deleted.
* platform/graphics/BitmapImage.h:
Managing the ImageFrames caching is moved to ImageFrameCache. Caching the
image metadata is now moved to the ImageSource.

* platform/graphics/GeneratedImage.h:
* platform/graphics/Image.h:
(WebCore::Image::orientationForCurrentFrame):
(WebCore::Image::singlePixelSolidColor):
Change currentFrameKnownToBeOpaque(), orientationForCurrentFrame() and
singlePixelSolidColor() to be const.

* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::defaultFrame): Returns an empty ImageFrame to get the default ImageFrame metadata.
(WebCore::ImageFrame::fillMetadata): Deleted. Moved to ImageFrameCache.
(WebCore::ImageFrame::initialize): Deleted. Ditto.

* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::setDuration): Change the type of the argument to float instead of unsigned.
(WebCore::ImageFrame::hasAlpha): Protect the unset m_hasAlpha by checking hasMetadata() first.

* platform/graphics/ImageFrameCache.cpp: Added.
(WebCore::ImageFrameCache::ImageFrameCache): Two constructors similar to what we do for ImageSource and BitmapImage.
(WebCore::ImageFrameCache::destroyDecodedData): Moved from BitmapImage.cpp.
(WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Ditto.
(WebCore::ImageFrameCache::destroyIncompleteDecodedData): Ditto.
(WebCore::ImageFrameCache::decodedSizeChanged): Ditto.
(WebCore::ImageFrameCache::decodedSizeIncremented): Ditto.
(WebCore::ImageFrameCache::decodedSizeDecremented): Ditto.
(WebCore::ImageFrameCache::decodedSizeReset): Ditto.
(WebCore::ImageFrameCache::didDecodeProperties): Ditto.
(WebCore::ImageFrameCache::growFrames): Grows the size of m_frames if necessary.
(WebCore::ImageFrameCache::setNativeImage): Initializes the ImageFrame metadata directly from the NativeImagePtr.
(WebCore::ImageFrameCache::setFrameNativeImage): Initializes the ImageFrame image and the metadata.
(WebCore::ImageFrameCache::setFrameMetadata): Initializes the ImageFrame metadata from the ImageDecoder.
(WebCore::ImageFrameCache::frameAtIndex): Returns an ImageFrame given its index. Cache or recache the requested ImageFrame if necessary.
(WebCore::ImageFrameCache::clearMetadata): Invalidates the cached image metadata.
(WebCore::ImageFrameCache::metadata): A template function which returns an image metadata property.
(WebCore::ImageFrameCache::frameMetadataAtIndex): A template function which returns an ImageFrame metadata property.
(WebCore::ImageFrameCache::isSizeAvailable): An image metadata property.
(WebCore::ImageFrameCache::frameCount): Ditto.
(WebCore::ImageFrameCache::repetitionCount): Ditto.
(WebCore::ImageFrameCache::filenameExtension): Ditto.
(WebCore::ImageFrameCache::hotSpot): Ditto.
(WebCore::ImageFrameCache::size): An image metadata property but we get it from the first ImageFrame.
(WebCore::ImageFrameCache::sizeRespectingOrientation): Ditto.
(WebCore::ImageFrameCache::singlePixelSolidColor): Ditto.
(WebCore::ImageFrameCache::frameIsCompleteAtIndex): An ImageFrame metadata property.
(WebCore::ImageFrameCache::frameHasAlphaAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameSubsamplingLevelAtIndex): Ditto.
(WebCore::ImageFrameCache::frameSizeAtIndex): Ditto.
(WebCore::ImageFrameCache::frameBytesAtIndex): Ditto.
(WebCore::ImageFrameCache::frameDurationAtIndex): Ditto.
(WebCore::ImageFrameCache::frameOrientationAtIndex): Ditto.
(WebCore::ImageFrameCache::frameImageAtIndex): Ditto.

* platform/graphics/ImageFrameCache.h: Added.
(WebCore::ImageFrameCache::setDecoder): Sets the current ImageDecoder which is owned by the ImageSource.
(WebCore::ImageFrameCache::decodedSize): Returns the size of the cached NativeImages.
(WebCore::ImageFrameCache::isDecoderAvailable): Returns whether an ImageDecoder is available.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource): Initializes the ImageFrameCache based on the image decoding state.
(WebCore::ImageSource::clearFrameBufferCache): Replace initialized() with isDecoderAvailable().
(WebCore::ImageSource::clear): Clears the ImageDecoder of the ImageFrameCache.
(WebCore::ImageSource::destroyDecodedData): Moved from BitmapImage.cpp.
(WebCore::ImageSource::destroyDecodedDataIfNecessary): Ditto.
(WebCore::ImageSource::ensureDecoderAvailable): Creates an ImageDecoder if necessary and sets it in ImageFrameCache.
(WebCore::ImageSource::setData):
(WebCore::ImageSource::dataChanged): Moved from BitmapImage.cpp.
(WebCore::ImageSource::isAllDataReceived):
(WebCore::ImageSource::maximumSubsamplingLevel): Rename calculateMaximumSubsamplingLevel() to maximumSubsamplingLevel().
(WebCore::ImageSource::subsamplingLevelForScale):
(WebCore::ImageSource::createFrameImageAtIndex):
(WebCore::ImageSource::dump):
(WebCore::ImageSource::calculateMaximumSubsamplingLevel): Deleted. Renamed to maximumSubsamplingLevel().
(WebCore::ImageSource::updateMetadata): Deleted. Not needed. Caching the image metadata is the responsibility of ImageFrameCache.
(WebCore::ImageSource::bytesDecodedToDetermineProperties): Deleted. Not needed.
(WebCore::ImageSource::isSizeAvailable): Deleted. Moved to ImageSource.h.
(WebCore::ImageSource::size): Deleted. Ditto.
(WebCore::ImageSource::sizeRespectingOrientation): Deleted. Ditto.
(WebCore::ImageSource::frameCount): Deleted. Ditto.
(WebCore::ImageSource::repetitionCount): Deleted. Ditto.
(WebCore::ImageSource::filenameExtension): Deleted. Ditto.
(WebCore::ImageSource::hotSpot): Deleted. Ditto.
(WebCore::ImageSource::frameIsCompleteAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameHasAlphaAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameAllowSubsamplingAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameSizeAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameBytesAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameDurationAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameOrientationAtIndex): Deleted. Ditto.

* platform/graphics/ImageSource.h:
(WebCore::ImageSource::isDecoderAvailable): initialized() was renamed to isDecoderAvailable().
(WebCore::ImageSource::decodedSize): Send the query to ImageFrameCache.
(WebCore::ImageSource::isSizeAvailable): Ditto.
(WebCore::ImageSource::frameCount): Ditto.
(WebCore::ImageSource::repetitionCount): Ditto.
(WebCore::ImageSource::filenameExtension): Ditto.
(WebCore::ImageSource::hotSpot): Ditto.
(WebCore::ImageSource::size): Ditto.
(WebCore::ImageSource::sizeRespectingOrientation): Ditto.
(WebCore::ImageSource::singlePixelSolidColor): Ditto.
(WebCore::ImageSource::frameIsCompleteAtIndex): Ditto.
(WebCore::ImageSource::frameHasAlphaAtIndex): Ditto.
(WebCore::ImageSource::frameHasImageAtIndex): Ditto.
(WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Ditto.
(WebCore::ImageSource::frameSubsamplingLevelAtIndex): Ditto.
(WebCore::ImageSource::frameSizeAtIndex): Ditto.
(WebCore::ImageSource::frameBytesAtIndex): Ditto.
(WebCore::ImageSource::frameDurationAtIndex): Ditto.
(WebCore::ImageSource::frameOrientationAtIndex): Ditto.
(WebCore::ImageSource::frameImageAtIndex): Ditto.
(WebCore::ImageSource::decoder): Deleted. Not needed.
(WebCore::ImageSource::initialized): Deleted. Was renamed to isDecoderAvailable().
(WebCore::ImageSource::setNeedsUpdateMetadata): Deleted. Not needed.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): Ditto.

* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::ImageDecoder): Make the constructor of ImageDecoder be the same for all ports.
(WebCore::ImageDecoder::setData): Removed unused overloaded function.
(WebCore::ImageDecoder::size): Deleted.  Removed unused function.

* platform/graphics/cg/ImageDecoderCG.h:
(WebCore::ImageDecoder::create): Make the constructor of CG ImageDecoder be like the other ports.
(WebCore::ImageDecoder::isAllDataReceived): Make this property owned by ImageDecoder.

* platform/graphics/cg/PDFDocumentImage.h: Change currentFrameKnownToBeOpaque() to be const.

* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.

* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::invalidatePlatformData): m_frames is owned by ImageFrameCache. ImageFrameCache::frameCount() has to
be equal to ImageFrame::m_frames.size().

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::create): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::ImageDecoder): Ditto.
(WebCore::ImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::BMPImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::GIFImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
(WebCore::GIFImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/gif/GIFImageReader.cpp:
* platform/image-decoders/gif/GIFImageReader.h:
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::ICOImageDecoder):
(WebCore::ICOImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
(WebCore::ICOImageDecoder::decode): Move resizing the m_frameBufferCache from ICOImageDecoder::frameCount() to ICOImageDecoder::decode().
(WebCore::ICOImageDecoder::decodeAtIndex): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::JPEGImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::PNGImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/png/PNGImageDecoder.h:
(WebCore::PNGImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::WEBPImageDecoder):
* platform/image-decoders/webp/WEBPImageDecoder.h:

* svg/graphics/SVGImage.h: Make currentFrameKnownToBeOpaque() be const.
* svg/graphics/SVGImageForContainer.h: Ditto.

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

4 years agoCorrectly parse URLs with the first tab in the fragment
achristensen@apple.com [Wed, 28 Sep 2016 01:02:00 +0000 (01:02 +0000)]
Correctly parse URLs with the first tab in the fragment
https://bugs.webkit.org/show_bug.cgi?id=162650

Reviewed by Saam Barati.

Source/WebCore:

Covered by a new API test.

* platform/URLParser.cpp:
(WebCore::URLParser::fragmentSyntaxViolation):

Tools:

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

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

4 years agoNetworkLoad and PingLoad should use private inheritance
dbates@webkit.org [Wed, 28 Sep 2016 01:01:29 +0000 (01:01 +0000)]
NetworkLoad and PingLoad should use private inheritance
https://bugs.webkit.org/show_bug.cgi?id=162649

Reviewed by Alex Christensen.

Make NetworkLoad privately inherit from NetworkDataTaskClient and ResourceHandleClient,
and make the client callbacks from these interfaces private as this class implements
these interfaces.

Similarly, make PingLoad privately inherit from ResourceHandleClient.

* NetworkProcess/NetworkLoad.h:
* NetworkProcess/PingLoad.h:

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

4 years ago<a download> does not honor the same-origin requirement
cdumez@apple.com [Wed, 28 Sep 2016 00:37:01 +0000 (00:37 +0000)]
<a download> does not honor the same-origin requirement
https://bugs.webkit.org/show_bug.cgi?id=156100

Reviewed by Alex Christensen.

Source/WebCore:

We now completely ignore the "download" attribute on anchors if the
href URL is cross-origin. We therefore navigate to the URL instead
of forcefully downloading it in this case and leave it up to the server
to give us the right headers if it should be downloaded. This is
conservative and matches Firefox.

Chrome and the HTML specification ignore only the suggested filename
if the URL is cross-origin but still download the file.

No new tests, updated existing test.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):

LayoutTests:

Update existing cross origin test as it expected the suggested filename to
be ignored but the file to still be downloaded (Chrome behavior) instead
of the download attribute to be completely ignored and therefore navigate
(Firefox behavior).

* TestExpectations:
* http/tests/resources/pass-notify-done.html: Added.
* http/tests/security/anchor-download-block-crossorigin-expected.txt:
* http/tests/security/anchor-download-block-crossorigin.html:

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

4 years agoURLParser: Handle windows drive letters after two slashes in relative URLs according...
achristensen@apple.com [Wed, 28 Sep 2016 00:31:44 +0000 (00:31 +0000)]
URLParser: Handle windows drive letters after two slashes in relative URLs according to spec
https://bugs.webkit.org/show_bug.cgi?id=162646

Reviewed by Saam Barati.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::CodePointIterator::codeUnitsSince):
(WebCore::URLParser::appendWindowsDriveLetter):
(WebCore::URLParser::parse):
(WebCore::isWindowsDriveLetter): Deleted.
(WebCore::URLParser::checkWindowsDriveLetter): Deleted.
* platform/URLParser.h:

Tools:

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

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

4 years agocreateError() and JSObject::calculatedClassName() should not throw any exceptions.
mark.lam@apple.com [Wed, 28 Sep 2016 00:26:15 +0000 (00:26 +0000)]
createError() and JSObject::calculatedClassName() should not throw any exceptions.
https://bugs.webkit.org/show_bug.cgi?id=162637

Reviewed by Geoffrey Garen.

* runtime/ExceptionHelpers.cpp:
(JSC::createError):
- assert that errorDescriptionForValue() did not throw an exception.

* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):
- the code already ensures that we always return a non-null String.  Just need to
  make sure that it catches its own exceptions.

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

4 years agoURLs with @ in the user should only search for the last @ until the end of the author...
achristensen@apple.com [Wed, 28 Sep 2016 00:25:51 +0000 (00:25 +0000)]
URLs with @ in the user should only search for the last @ until the end of the authority and host
https://bugs.webkit.org/show_bug.cgi?id=162635

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

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

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

4 years agoMarking http/tests/xmlhttprequest/onabort-response-getters.html as failing on Sierra.
ryanhaddad@apple.com [Wed, 28 Sep 2016 00:19:57 +0000 (00:19 +0000)]
Marking http/tests/xmlhttprequest/onabort-response-getters.html as failing on Sierra.
https://bugs.webkit.org/show_bug.cgi?id=162647

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoMarking imported/w3c/web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow...
ryanhaddad@apple.com [Wed, 28 Sep 2016 00:15:14 +0000 (00:15 +0000)]
Marking imported/w3c/web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html as failing on ios-simulator-wk2.
https://bugs.webkit.org/show_bug.cgi?id=162645

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoB3::lowerMacros forgets to before->updatePredecessorsAfter() when lowering ChillMod...
fpizlo@apple.com [Tue, 27 Sep 2016 23:54:28 +0000 (23:54 +0000)]
B3::lowerMacros forgets to before->updatePredecessorsAfter() when lowering ChillMod on ARM64
https://bugs.webkit.org/show_bug.cgi?id=162644

Reviewed by Keith Miller.

JSTests:

* stress/chill-mod-chill-mod.js: Added.
(foo):

Source/JavaScriptCore:

If you forget to update the predecessors of your successors, then bad things will happen if you
do something that requires accurate predecessors for correctness. lowerMacros() uses
BlockInsertionSet, which relies on accurate predecessors.

* b3/B3LowerMacros.cpp:

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

4 years agoSpeed up Heap::isMarkedConcurrently
jfbastien@apple.com [Tue, 27 Sep 2016 23:41:34 +0000 (23:41 +0000)]
Speed up Heap::isMarkedConcurrently
https://bugs.webkit.org/show_bug.cgi?id=162095

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Speed up isMarkedConcurrently by using WTF::consumeLoad.

* heap/MarkedBlock.h:
(JSC::MarkedBlock::areMarksStale):
(JSC::MarkedBlock::areMarksStaleWithDependency):
(JSC::MarkedBlock::isMarkedConcurrently): do away with the load-load fence

Source/WTF:

Heap::isMarkedConcurrently had a load-load fence which is expensive on weak memory ISAs such as ARM.

This patch is fairly perf-neutral overall, but the GC's instrumentation reports:
  GC:Eden is 93% average runtime after change
  GC:Full is 76% average runtime after change

The fence was there because:
 1. If the read of m_markingVersion in MarkedBlock::areMarksStale isn't what's expected then;
 2. The read of m_marks in MarkedBlock::isMarked needs to observe the value that was stored *before* m_markingVersion was stored.

This ordering isn't guaranteed on ARM, which has a weak memory model.

There are 3 ways to guarantee this ordering:
 A. Use a barrier instruction.
 B. Use a load-acquire (new in ARMv8).
 C. use ARM's address dependency rule, which C++ calls memory_order_consume.

In general:
 A. is slow but orders all of memory in an intuitive manner.
 B. is faster-ish and has the same property-ish.
 C. should be faster still, but *only orders dependent loads*. This last part is critical! Consume isn't an all-out replacement for acquire (acquire is rather a superset of consume).

ARM explains the address dependency rule in their document "barrier litmus tests and cookbook":

> *Resolving by the use of barriers and address dependency*
>
> There is a rule within the ARM architecture that:
> Where the value returned by a read is used to compute the virtual address of a subsequent read or write (this is known as an address dependency), then these two memory accesses will be observed in program order. An address dependency exists even if the value read by the first read has no effect in changing the virtual address (as might be the case if the value returned is masked off before it is used, or if it had no effect on changing a predicted address value).
> This restriction applies only when the data value returned from one read is used as a data value to calculate the address of a subsequent read or write. This does not apply if the data value returned from one read is used to determine the condition code flags, and the values of the flags are used for condition code evaluation to determine the address of a subsequent reads, either through conditional execution or the evaluation of a branch. This is known as a control dependency.
> Where both a control and address dependency exist, the ordering behaviour is consistent with the address dependency.

C++'s memory_order_consume is unfortunately unimplemented by C++ compilers, and maybe unimplementable as spec'd. I'm working with interested folks in the committee to fix this situation: http://wg21.link/p0190r2

* wtf/Atomics.h:
(WTF::zeroWithConsumeDependency): a 0 which carries a dependency
(WTF::consumeLoad): pixie magic

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/Consume.cpp: Added.
(testConsume):
(TestWebKitAPI::TEST):

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

4 years agoIt should be possible to dispatch events on documents created using DOMParser
cdumez@apple.com [Tue, 27 Sep 2016 23:33:08 +0000 (23:33 +0000)]
It should be possible to dispatch events on documents created using DOMParser
https://bugs.webkit.org/show_bug.cgi?id=26147

Reviewed by Ryosuke Niwa.

Source/WebCore:

It should be possible to dispatch events on documents created using
DOMParser. It did not work because we were not setting the context
document on the newly created document in DOMParser::parseFromString().

Firefox and Chrome both already support this.

Test: fast/dom/parsed-document-dispatchEvent.html

* xml/DOMParser.cpp:
(WebCore::DOMParser::DOMParser):
(WebCore::DOMParser::parseFromString):
* xml/DOMParser.h:
(WebCore::DOMParser::create):
* xml/DOMParser.idl:

LayoutTests:

Add layout test coverage.

* fast/dom/parsed-document-dispatchEvent-expected.txt: Added.
* fast/dom/parsed-document-dispatchEvent.html: Added.

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

4 years agoAtomics.h on Windows: remove seq_cst hack
jfbastien@apple.com [Tue, 27 Sep 2016 23:20:56 +0000 (23:20 +0000)]
Atomics.h on Windows: remove seq_cst hack
https://bugs.webkit.org/show_bug.cgi?id=162022

Reviewed by Mark Lam.

No need to force access to seq_cst, always inlining fixes the MSVC warning.

* wtf/Atomics.h:
(WTF::Atomic::compareExchangeWeak): remove seq_cst hack
(WTF::Atomic::compareExchangeStrong): remove seq_cst hack
(WTF::Atomic::exchangeAndAdd): remove seq_cst hack
(WTF::Atomic::exchange): remove seq_cst hack

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

4 years agoMarking fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update...
ryanhaddad@apple.com [Tue, 27 Sep 2016 22:17:45 +0000 (22:17 +0000)]
Marking fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement.html as flaky on Sierra.
https://bugs.webkit.org/show_bug.cgi?id=162638

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years ago[Cocoa] Improve performance of complex text codepath
mmaxfield@apple.com [Tue, 27 Sep 2016 21:58:56 +0000 (21:58 +0000)]
[Cocoa] Improve performance of complex text codepath
https://bugs.webkit.org/show_bug.cgi?id=161936

Reviewed by Simon Fraser.

CoreText exposes a bit on the CTRunStatus which represents whether
the run actually uses the glyph origins concept introduced in
r205396. If this bit is not set, we can use the (slightly faster)
call to CTRunGetAdvances() instead of
CTRunGetBaseAdvancesAndOrigins(). In addition, if none of the runs
have this bit set, we don't need to allocate storage for the vector
of origins at all, thereby using less memory.

No new tests because there is no behavior change.

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::advance):
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
(WebCore::ComplexTextController::glyphOrigin):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
* platform/spi/cocoa/CoreTextSPI.h:

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

4 years agoExtend perf dashboard to support multiple summary pages.
dewei_zhu@apple.com [Tue, 27 Sep 2016 21:54:38 +0000 (21:54 +0000)]
Extend perf dashboard to support multiple summary pages.
https://bugs.webkit.org/show_bug.cgi?id=162594

Reviewed by Ryosuke Niwa.

Start support multiple summary pages instead of one.
Specify 'summaryPages' as key that map to a list of summaries which follows
current 'summary' format in 'config.json' but with 2 more properties:
   'name': specifying the name shows on perf dashboard,
   'route': specifying the path to this page.

* public/include/manifest.php:
* public/v3/main.js:
(main):
(main.): Deleted.
* public/v3/models/manifest.js:
(Manifest._didFetchManifest):
(Manifest):
* public/v3/pages/summary-page.js:
(SummaryPage):
(SummaryPage.prototype.routeName):

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

4 years agoWeb Inspector: Refreshing while in Timelines-tab causes negative timestamps in Networ...
mattbaker@apple.com [Tue, 27 Sep 2016 21:05:50 +0000 (21:05 +0000)]
Web Inspector: Refreshing while in Timelines-tab causes negative timestamps in Network-tab
https://bugs.webkit.org/show_bug.cgi?id=160051
<rdar://problem/27480122>

Reviewed by Brian Burg.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView.prototype.get startTime):
(WebInspector.NetworkGridContentView.prototype.get zeroTime):
Use the cached start time for graph data source properties instead of
relying on the ruler, which requires a layout in order to be updated
for the first time.

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

4 years agoImport w3c shadow DOM tests and fix one assertion
rniwa@webkit.org [Tue, 27 Sep 2016 21:04:15 +0000 (21:04 +0000)]
Import w3c shadow DOM tests and fix one assertion
https://bugs.webkit.org/show_bug.cgi?id=162629

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Import shadow DOM tests in web-platform-tests as of 7163d6eeed81e9e020545fbe0c4b11fc2c5963cd
except untriaged tests for v0 API, which we obviously don't implement.

Most of these tests are the ones we upstreamed from fast/shadow-dom/.

* web-platform-tests/shadow-dom/Document-prototype-adoptNode-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-adoptNode-expected.txt.
* web-platform-tests/shadow-dom/Document-prototype-adoptNode.html: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-adoptNode.html.
* web-platform-tests/shadow-dom/Document-prototype-currentScript-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-currentScript-expected.txt.
* web-platform-tests/shadow-dom/Document-prototype-currentScript.html: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-currentScript.html.
* web-platform-tests/shadow-dom/Document-prototype-importNode-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-importNode-expected.txt.
* web-platform-tests/shadow-dom/Document-prototype-importNode.html: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-importNode.html.
* web-platform-tests/shadow-dom/Element-interface-attachShadow-expected.txt: Added.
* web-platform-tests/shadow-dom/Element-interface-attachShadow.html: Renamed from LayoutTests/fast/shadow-dom/Element-interface-attachShadow.html.
* web-platform-tests/shadow-dom/Element-interface-shadowRoot-attribute-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Element-interface-shadowRoot-attribute-expected.txt.
* web-platform-tests/shadow-dom/Element-interface-shadowRoot-attribute.html: Renamed from LayoutTests/fast/shadow-dom/Element-interface-shadowRoot-attribute.html.
* web-platform-tests/shadow-dom/Extensions-to-Event-Interface-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Extensions-to-Event-Interface-expected.txt.
* web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html: Renamed from LayoutTests/fast/shadow-dom/Extensions-to-Event-Interface.html.
* web-platform-tests/shadow-dom/HTMLSlotElement-interface-expected.txt: Renamed from LayoutTests/fast/shadow-dom/HTMLSlotElement-interface-expected.txt.
* web-platform-tests/shadow-dom/HTMLSlotElement-interface.html: Renamed from LayoutTests/fast/shadow-dom/HTMLSlotElement-interface.html.
* web-platform-tests/shadow-dom/MouseEvent-prototype-offsetX-offsetY-expected.txt: Renamed from LayoutTests/fast/shadow-dom/MouseEvent-prototype-offsetX-offsetY-expected.txt.
* web-platform-tests/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html: Renamed from LayoutTests/fast/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html.
* web-platform-tests/shadow-dom/Node-prototype-cloneNode-expected.txt: Added.
* web-platform-tests/shadow-dom/Node-prototype-cloneNode.html: Renamed from LayoutTests/fast/shadow-dom/Node-prototype-cloneNode.html.
* web-platform-tests/shadow-dom/OWNERS: Added.
* web-platform-tests/shadow-dom/ShadowRoot-interface-expected.txt: Renamed from LayoutTests/fast/shadow-dom/ShadowRoot-interface-expected.txt.
* web-platform-tests/shadow-dom/ShadowRoot-interface.html: Renamed from LayoutTests/fast/shadow-dom/ShadowRoot-interface.html.
* web-platform-tests/shadow-dom/Slotable-interface-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt.
* web-platform-tests/shadow-dom/Slotable-interface.html: Renamed from LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot.html.
* web-platform-tests/shadow-dom/event-composed-expected.txt: Added.
* web-platform-tests/shadow-dom/event-composed-path-expected.txt: Added.
* web-platform-tests/shadow-dom/event-composed-path-with-related-target-expected.txt: Added.
* web-platform-tests/shadow-dom/event-composed-path-with-related-target.html: Added.
* web-platform-tests/shadow-dom/event-composed-path.html: Added.
* web-platform-tests/shadow-dom/event-composed.html: Added.
* web-platform-tests/shadow-dom/event-inside-shadow-tree-expected.txt: Renamed from LayoutTests/fast/shadow-dom/event-inside-shadow-tree-expected.txt.
* web-platform-tests/shadow-dom/event-inside-shadow-tree.html: Renamed from LayoutTests/fast/shadow-dom/event-inside-shadow-tree.html.
* web-platform-tests/shadow-dom/event-inside-slotted-node-expected.txt: Renamed from LayoutTests/fast/shadow-dom/event-inside-slotted-node-expected.txt.
* web-platform-tests/shadow-dom/event-inside-slotted-node.html: Renamed from LayoutTests/fast/shadow-dom/event-inside-slotted-node.html.
* web-platform-tests/shadow-dom/event-with-related-target-expected.txt: Renamed from LayoutTests/fast/shadow-dom/event-with-related-target-expected.txt.
* web-platform-tests/shadow-dom/event-with-related-target.html: Renamed from LayoutTests/fast/shadow-dom/event-with-related-target.html.
* web-platform-tests/shadow-dom/leaktests/get-elements-expected.txt: Added.
* web-platform-tests/shadow-dom/leaktests/get-elements.html: Added.
* web-platform-tests/shadow-dom/leaktests/html-collection-expected.txt: Added.
* web-platform-tests/shadow-dom/leaktests/html-collection.html: Added.
* web-platform-tests/shadow-dom/leaktests/w3c-import.log: Added.
* web-platform-tests/shadow-dom/leaktests/window-frames-expected.txt: Added.
* web-platform-tests/shadow-dom/leaktests/window-frames.html: Added.
* web-platform-tests/shadow-dom/resources/Document-prototype-currentScript-helper.js: Renamed from LayoutTests/fast/shadow-dom/resources/Document-prototype-currentScript-helper.js.
* web-platform-tests/shadow-dom/resources/event-path-test-helpers.js: Added.
* web-platform-tests/shadow-dom/resources/shadow-dom-utils.js: Added.
* web-platform-tests/shadow-dom/resources/shadow-dom.js: Added.
* web-platform-tests/shadow-dom/resources/w3c-import.log: Added.
* web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree-expected.txt: Added.
* web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html: Added.
* web-platform-tests/shadow-dom/slotchange-event-expected.txt: Renamed from LayoutTests/fast/shadow-dom/slotchange-event-expected.txt.
* web-platform-tests/shadow-dom/slotchange-event.html: Renamed from LayoutTests/fast/shadow-dom/slotchange-event.html.
* web-platform-tests/shadow-dom/slotchange-expected.txt: Added.
* web-platform-tests/shadow-dom/slotchange.html: Added.
* web-platform-tests/shadow-dom/slots-expected.txt: Added.
* web-platform-tests/shadow-dom/slots-fallback-expected.txt: Added.
* web-platform-tests/shadow-dom/slots-fallback.html: Added.
* web-platform-tests/shadow-dom/slots.html: Added.
* web-platform-tests/shadow-dom/w3c-import.log: Added.

Source/WebCore:

The assertion failure was caused by RelatedNodeRetargeter's constructor mixing up the ancestor tree scopes
for the target and the related target. Fixed the bug by reversing the two.

Tests: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-with-related-target.html

* dom/EventPath.cpp:
(WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): i and m_ancestorTreeScopes are for the related target
and j and targetTreeScopeAncestors are for the target.

LayoutTests:

Deleted the duplicated copies of tests in fast/shadow/ since this patch re-imports them via web-platform-tests.

* fast/shadow-dom/Element-interface-attachShadow-expected.txt: Removed.
* fast/shadow-dom/Node-prototype-cloneNode-expected.txt: Removed.

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

4 years agoIt should be possible to dispatch events on documents that do not have a browsing...
cdumez@apple.com [Tue, 27 Sep 2016 20:55:20 +0000 (20:55 +0000)]
It should be possible to dispatch events on documents that do not have a browsing context
https://bugs.webkit.org/show_bug.cgi?id=162620

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/dom/events/Event-dispatch-bubbles-false-expected.txt:
* web-platform-tests/dom/events/Event-dispatch-bubbles-true-expected.txt:
Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/dom/events/Event-dispatch-other-document-expected.txt: Added.
* web-platform-tests/dom/events/Event-dispatch-other-document.html: Added.
* web-platform-tests/dom/events/w3c-import.log:
Import more test coverage from W3C.

Source/WebCore:

It should be possible to dispatch events on documents that do not have a browsing
context (e.g. Documents created using DOMImplementation.createHTMLDocument()).
Gecko and Blink both allow this but WebKit did not.

The approach chosen to support this is similar to the one in Blink. When constructing
a new document (e.g. using DOMImplementation.createHTMLDocument()) we now keep track
of the context document. When requesting the scriptExecutionContext(), we now return
the context document if the document has one instead of the document itself.

Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-other-document.html

* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::visitAdditionalChildren):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementation::createHTMLDocument):
* dom/Document.cpp:
(WebCore::Document::create):
(WebCore::Document::cloneDataFromDocument):
(WebCore::Document::contextDocument):
(WebCore::Document::takeDOMWindowFrom): Deleted.
* dom/Document.h:
(WebCore::Document::setContextDocument):
(WebCore::Node::scriptExecutionContext):
(WebCore::Node::isDocumentNode): Deleted.
* dom/Document.idl:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseXML):

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

4 years agoMarking imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html...
ryanhaddad@apple.com [Tue, 27 Sep 2016 20:47:27 +0000 (20:47 +0000)]
Marking imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html as flaky on mac.
https://bugs.webkit.org/show_bug.cgi?id=162626

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoUse override specifiers in PluginView
annulen@yandex.ru [Tue, 27 Sep 2016 20:45:43 +0000 (20:45 +0000)]
Use override specifiers in PluginView
https://bugs.webkit.org/show_bug.cgi?id=162628

Reviewed by Alex Christensen.

* Plugins/PluginView.h:

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

4 years agoAdd some needed CatchScopes in code that should not throw.
mark.lam@apple.com [Tue, 27 Sep 2016 20:32:13 +0000 (20:32 +0000)]
Add some needed CatchScopes in code that should not throw.
https://bugs.webkit.org/show_bug.cgi?id=162584

Reviewed by Keith Miller.

Re-landing minus the jsc.cpp and ExceptionHelpers.cpp changes.  I'll address
those in a subsequent patch if the need manifests again in my testing.

* API/JSObjectRef.cpp:
(JSObjectSetProperty):
- This function already handles exceptions in its own way.  We're honoring this
  contract and catching exceptions and passing it to the handler.

* interpreter/Interpreter.cpp:
(JSC::notifyDebuggerOfUnwinding):
- The debugger should not be throwing any exceptions.

* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::save):
- If an exception was thrown while saving the database, there's nothing we can
  really do about it anyway.  Just fail nicely and return false.  This is in line
  with existing error checking code in Database::save() that returns false if
  it's not able to open the file to save to.

* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::finishCreation):
- The existing code already RELEASE_ASSERT that no exception was thrown.
  Hence, it's appropriate to use a CatchScope here.

* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::StackFrame::nameFromCallee):
- The sampling profiler is doing a VMInquiry get here.  It should never throw an
  exception.  Hence, we'll just use a CatchScope and assert accordingly.

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

4 years ago[CMake] Use CMake to determine HAVE_* defines
commit-queue@webkit.org [Tue, 27 Sep 2016 20:30:09 +0000 (20:30 +0000)]
[CMake] Use CMake to determine HAVE_* defines
https://bugs.webkit.org/show_bug.cgi?id=162368

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2016-09-27
Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsCommon.cmake:

Source/WTF:

* wtf/Platform.h:

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

4 years agoImplement URLParser::syntaxViolation
achristensen@apple.com [Tue, 27 Sep 2016 20:07:15 +0000 (20:07 +0000)]
Implement URLParser::syntaxViolation
https://bugs.webkit.org/show_bug.cgi?id=162593

Reviewed by Geoffrey Garen.

Source/WebCore:

Most of the time when parsing URLs, we just look at the URL, find offsets of the host, path, query, etc.,
and the String can be used untouched.  When this happens, we do not want to allocate and copy the String.
We want to just add a reference to an existing String.

Sometimes we need to canonicalize the String because there has been a syntaxViolation,
defined as any String that is different than its canonicalized URL String.  In such cases we need to
allocate a new String and fill it with the canonicalized URL String.  When a syntaxViolation happens for the
first time, we know that everything in the input String up to that point is equal to what it would have been
if we had canonicalized the beginning of the URL, copy it into a buffer, and continue parsing in a mode where
instead of just looking at the input URL String, we canonicalize each code point into the buffer.

Changes to behavior involve additional spec compliance with tabs and newlines in different places in URLs,
as well as additional spec compliance when parsing empty and null URLs relative to other URLs.
Both are covered by new API tests. Existing behavior covered by existing API tests.

This is about a 15% speed improvement on my URL parsing benchmark.

* platform/URL.cpp:
(WebCore::assertProtocolIsGood):
(WebCore::URL::protocolIs):
(WebCore::protocolIs):
* platform/URL.h:
* platform/URLParser.cpp:
(WebCore::isTabOrNewline):
(WebCore::URLParser::incrementIteratorSkippingTabsAndNewlines):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::URLParser::checkWindowsDriveLetter):
(WebCore::URLParser::shouldCopyFileURL):
(WebCore::URLParser::utf8PercentEncode):
(WebCore::URLParser::utf8QueryEncode):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::syntaxViolation):
(WebCore::URLParser::fragmentSyntaxViolation):
(WebCore::URLParser::parsedDataView):
(WebCore::URLParser::currentPosition):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
(WebCore::URLParser::parseAuthority):
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::parsePort):
(WebCore::URLParser::parseHostAndPort):
(WebCore::serializeURLEncodedForm):
(WebCore::URLParser::allValuesEqual):
(WebCore::URLParser::internalValuesConsistent):
(WebCore::URLParser::incrementIteratorSkippingTabAndNewLine): Deleted.
(WebCore::URLParser::syntaxError): Deleted.
(WebCore::parseIPv4Number): Deleted.
* platform/URLParser.h:
(WebCore::URLParser::incrementIteratorSkippingTabsAndNewlines):

Tools:

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

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

4 years agoRelated videos on YouTube (and YouTube playlists) cause media controls to disappear
wenson_hsieh@apple.com [Tue, 27 Sep 2016 19:39:45 +0000 (19:39 +0000)]
Related videos on YouTube (and YouTube playlists) cause media controls to disappear
https://bugs.webkit.org/show_bug.cgi?id=162621
<rdar://problem/28484193>

Reviewed by Jer Noble.

Tweaks the main content media heuristic for better Now Playing behavior on YouTube by making the following
changes:
- Remove the strict requirement for audio to be actively playing for the session to be able to show
  controls for the purpose of Now Playing, making it the same as our policy for the controls manager.
- Make playback requirement restrictions apply only for the controls manager. Videos that do not
  autoplay will still have the correct behavior with respect to Now Playing, since we will bail in the
  hasEverNotifiedAboutPlaying() check.
- Only consider the main content heuristic as preventing media controls from showing up for the purposes
  of the controls manager. Now Playing should instead account for this by preferring elements large
  enough for main content after collecting all of the candidate sessions.

* html/HTMLMediaElement.cpp:
(WebCore::mediaElementSessionInfoForSession):
(WebCore::preferMediaControlsForCandidateSessionOverOtherCandidateSession):
(WebCore::HTMLMediaElement::updatePlayState):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::sessionWillBeginPlayback):

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

4 years agoSecond parameter to MutationObserver.observe() should be optional
cdumez@apple.com [Tue, 27 Sep 2016 19:35:49 +0000 (19:35 +0000)]
Second parameter to MutationObserver.observe() should be optional
https://bugs.webkit.org/show_bug.cgi?id=162627

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

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

Source/WebCore:

Second parameter to MutationObserver.observe() should be optional:
- https://dom.spec.whatwg.org/#interface-mutationobserver

Firefox agrees with the specification. There is no real behavior change
except that MutationObserver.prototype.observe.length is now 1 instead
of 2. Passing only one parameter will still throw a TypeError because
the Dictionary is empty. However, this parameter needs to be marked as
optional because Web IDL requires the last parameter to be optional if
it is a Dictionary.

No new tests, rebaselined existing test.

* dom/MutationObserver.idl:

LayoutTests:

Rebaseline existing test now that the exception messages are slightly
different.

* fast/dom/MutationObserver/observe-exceptions-expected.txt:

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

4 years agoTurns out OptionSet.cpp wasn't added to the right target. Add it and fix the build...
andersca@apple.com [Tue, 27 Sep 2016 19:32:28 +0000 (19:32 +0000)]
Turns out OptionSet.cpp wasn't added to the right target. Add it and fix the build for real.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/OptionSet.cpp:
(TestWebKitAPI::TEST):

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

4 years agoTry to fix the GTK+ build.
andersca@apple.com [Tue, 27 Sep 2016 19:26:13 +0000 (19:26 +0000)]
Try to fix the GTK+ build.

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

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

4 years agoPlatformEvent::m_modifiers should be an OptionSet
andersca@apple.com [Tue, 27 Sep 2016 19:08:34 +0000 (19:08 +0000)]
PlatformEvent::m_modifiers should be an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=162326

Reviewed by Daniel Bates.

Source/WebCore:

* page/EventHandler.cpp:
(WebCore::EventHandler::handleAccessKey):
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::accessKeyModifiers):
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::shiftKey):
(WebCore::PlatformEvent::ctrlKey):
(WebCore::PlatformEvent::altKey):
(WebCore::PlatformEvent::metaKey):
(WebCore::PlatformEvent::modifiers):
(WebCore::PlatformEvent::PlatformEvent):
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::modifiersForEvent):
(WebCore::typeForEvent):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
* replay/WebInputs.json:

Source/WebKit2:

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):

Source/WTF:

* wtf/OptionSet.h:
(WTF::OptionSet::operator!=):
(WTF::OptionSet::operator-):

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

4 years ago[iOS] REGRESSION (r182126): Selection highlight and handles aren’t visible with WKSel...
mitz@apple.com [Tue, 27 Sep 2016 18:31:32 +0000 (18:31 +0000)]
[iOS] REGRESSION (r182126): Selection highlight and handles aren’t visible with WKSelectionGranularityCharacter
https://bugs.webkit.org/show_bug.cgi?id=162577
<rdar://problem/28481984>

Reviewed by Simon Fraser.

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _uiTextSelectionRectViews]): Added this method in the WKTesting category, which
  uses UIKit internals to get the views used for the selection highlight.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _selectionClipRect]): When selection is not confined to a form control or
  content-editable element, return the null rect to indicate no clipping, rather than
  clipping to the empty rect at the origin.

Tools:

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::selectionRangeViewRects): Returns null.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: Declared new
  selectionRangeViewRects attribute.

* TestRunnerShared/UIScriptContext/UIScriptContext.h:
(WTR::UIScriptContext::jsContext): Added this public accessor.

* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::selectionRangeViewRects): Generic implementation that returns null.
* TestRunnerShared/UIScriptContext/UIScriptController.h:

* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader): Parse the new useCharacterSelectionGranularity
  option.

* WebKitTestRunner/TestOptions.h: Added new useCharacterSelectionGranularity option.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView): Set the configuration’s selectionGranularity
  property based on the new option.

* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::viewSupportsOptions): Compare selection granularity option values.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::selectionRangeViewRects): iOS-specific implementation that calls
  the new -[WKWebView _uiTextSelectionRectViews] and returns an array of view frame
  dictionaries.

LayoutTests:

* TestExpectations:
* editing/selection/character-granularity-rect-expected.txt: Added.
* editing/selection/character-granularity-rect.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

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

4 years ago[GTK] Handle Wayland & X11 correctly for GST_GL
gns@gnome.org [Tue, 27 Sep 2016 18:03:59 +0000 (18:03 +0000)]
[GTK] Handle Wayland & X11 correctly for GST_GL
https://bugs.webkit.org/show_bug.cgi?id=162619

Reviewed by Carlos Garcia Campos.

The checks for GST_GL consider X11 and Wayland are exclusive alternatives, but it
turns out we can enable both! We need to check them independently and also include
a runtime check.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): fix checks for X11 and
Wayland to handle the case where both are enabled. Includes a runtime check.

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

4 years ago[MediaStream] Restructure MediaConstraints classes
eric.carlson@apple.com [Tue, 27 Sep 2016 17:58:44 +0000 (17:58 +0000)]
[MediaStream] Restructure MediaConstraints classes
https://bugs.webkit.org/show_bug.cgi?id=162571

Reviewed by Jer Noble.

No new tests, no functional changes.

* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::initialize): Deleted, no longer used.
* Modules/mediastream/MediaConstraintsImpl.h:

* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::createStringConstraint): Return Optional<> instead of RefPtr<>.
(WebCore::createBooleanConstraint): Ditto.
(WebCore::createDoubleConstraint): Ditto.
(WebCore::createIntConstraint): Ditto.
(WebCore::parseMediaTrackConstraintSetForKey): Deal with above change.

* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::verifyConstraintsForMediaType): Use constraints.mandatoryConstraints.filter
  instead of direct enumeration.
(CaptureDeviceManager::sessionSupportsConstraint): Use downcast<>.
(CaptureDeviceManager::isSupportedFrameRate): Ditto.

* platform/mediastream/MediaConstraints.cpp:
(WebCore::StringConstraint::find): Lose the ConstraintType parameter.
(WebCore::StringConstraint::merge): Use downcast<>.
(WebCore::FlattenedConstraint::set): Use ConstraintHolder.
(WebCore::FlattenedConstraint::merge): Ditto.
(WebCore::MediaTrackConstraintSetMap::forEach): New.
(WebCore::MediaTrackConstraintSetMap::filter): Ditto.
(WebCore::MediaTrackConstraintSetMap::isEmpty): Ditto.
(WebCore::MediaTrackConstraintSetMap::set): Ditto.
(WebCore::MediaConstraint::copy): Deleted.
(WebCore::IntConstraint::copy): Deleted.
(WebCore::DoubleConstraint::copy): Deleted.
(WebCore::BooleanConstraint::copy): Deleted.
(WebCore::StringConstraint::copy): Deleted.
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::MediaConstraint):
(WebCore::MediaConstraint::isEmpty):
(WebCore::MediaConstraint::isMandatory):
(WebCore::MediaConstraint::merge):
(WebCore::MediaConstraint::isInt):
(WebCore::MediaConstraint::isDouble):
(WebCore::MediaConstraint::isBoolean):
(WebCore::MediaConstraint::isString):
(WebCore::MediaConstraint::dataType):
(WebCore::MediaConstraint::constraintType):
(WebCore::NumericConstraint::getMin):
(WebCore::NumericConstraint::getMax):
(WebCore::NumericConstraint::getExact):
(WebCore::NumericConstraint::getIdeal):
(WebCore::NumericConstraint::fitnessDistance):
(WebCore::NumericConstraint::validForRange):
(WebCore::NumericConstraint::find):
(WebCore::NumericConstraint::NumericConstraint):
(WebCore::NumericConstraint::innerMerge):
(WebCore::FlattenedConstraint::isEmpty):
(WebCore::FlattenedConstraint::iterator::iterator):
(WebCore::FlattenedConstraint::iterator::operator*):
(WebCore::FlattenedConstraint::iterator::operator++):
(WebCore::FlattenedConstraint::iterator::operator==):
(WebCore::FlattenedConstraint::iterator::operator!=):
(WebCore::FlattenedConstraint::begin):
(WebCore::FlattenedConstraint::end):
(WebCore::FlattenedConstraint::ConstraintHolder::create):
(WebCore::FlattenedConstraint::ConstraintHolder::~ConstraintHolder):
(WebCore::FlattenedConstraint::ConstraintHolder::constraint):
(WebCore::FlattenedConstraint::ConstraintHolder::dataType):
(WebCore::FlattenedConstraint::ConstraintHolder::constraintType):
(WebCore::FlattenedConstraint::ConstraintHolder::ConstraintHolder):
(WebCore::MediaConstraint::getMin): Deleted.
(WebCore::MediaConstraint::getMax): Deleted.
(WebCore::MediaConstraint::getExact): Deleted.
(WebCore::MediaConstraint::getIdeal): Deleted.
(WebCore::MediaConstraint::validForRange): Deleted.
(WebCore::MediaConstraint::find): Deleted.
(WebCore::MediaConstraint::fitnessDistance): Deleted.
(WebCore::MediaConstraint::type): Deleted.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance): Use downcast<>.
(WebCore::applyNumericConstraint):
(WebCore::RealtimeMediaSource::applyConstraint): Ditto.
(WebCore::RealtimeMediaSource::selectSettings): Ditto. Use constraints.mandatoryConstraints.filter
  instead of direct enumeration.
(WebCore::RealtimeMediaSource::applyConstraints):
(WebCore::RealtimeMediaSource::setSampleRate): Sample rate is an int, not a double.
(WebCore::RealtimeMediaSource::setSampleSize): Sample size is also an int.
* platform/mediastream/RealtimeMediaSource.h:

* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Use downcast<>.

* platform/mock/MediaConstraintsMock.cpp:
(WebCore::isIntMediaConstraintSatisfiable): Use downcast<>.
(WebCore::isDoubleMediaConstraintSatisfiable): Ditto.
(WebCore::isBooleanMediaConstraintSatisfiable): Ditto.
(WebCore::isStringMediaConstraintSatisfiable):
(WebCore::isSatisfiable):
(WebCore::MediaConstraintsMock::verifyConstraints): Use constraints.mandatoryConstraints.filter
  instead of direct enumeration.
* platform/mock/MediaConstraintsMock.h:

* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):

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

4 years agoSome Now Playing behavior is broken after r206315
wenson_hsieh@apple.com [Tue, 27 Sep 2016 17:54:49 +0000 (17:54 +0000)]
Some Now Playing behavior is broken after r206315
https://bugs.webkit.org/show_bug.cgi?id=162625
<rdar://problem/28496755>

Reviewed by Jer Noble.

Reverts the part of our heuristic that disables Now Playing in active tabs in the main window.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::pageAllowsNowPlayingControls):
* page/Page.cpp:
(WebCore::Page::setViewState):

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

4 years agoRemove an unneeded assert in InspectorOverlay.cpp
ryanhaddad@apple.com [Tue, 27 Sep 2016 17:33:21 +0000 (17:33 +0000)]
Remove an unneeded assert in InspectorOverlay.cpp
https://bugs.webkit.org/show_bug.cgi?id=162581

Reviewed by Alexey Proskuryakov.

This assertion was added to catch unknown issues, but it is firing frequently enough on certain Inspector
tests that it is causing more harm than good.

* inspector/InspectorOverlay.cpp:
(WebCore::buildQuadObjectForCSSRegionContentClip):
(WebCore::evaluateCommandInOverlay):

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

4 years agoWeb Inspector: Unfocusing / Focusing inspector window should not change ContentView
mattbaker@apple.com [Tue, 27 Sep 2016 17:25:38 +0000 (17:25 +0000)]
Web Inspector: Unfocusing / Focusing inspector window should not change ContentView
https://bugs.webkit.org/show_bug.cgi?id=162572
<rdar://problem/28479562>

Reviewed by Brian Burg.

Improve NavigationSidebarPanel logic for coordinating selection between trees.
When tree selection changes, the most recent selection should be restored
the next time the tree is focused.

The sidebar should also handle focusing a tree for the first time, in
which no previous selection exists, and focusing a tree that has had its
previous selection filtered out (hidden).

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineDidFocus):
(WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
Restoring the last deselected element, instead of the last selected element
only works when the selection is moving from one tree to another. When
the elements belong to the same tree the newly selected element won't
be saved until the next selection change. If the window loses and regains
the focus before then, the tree will restore the previous selection,
effectively reverting the last selection change.

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

4 years agoCannot run dump-class-layout; dies with "global name 'lldb' is not defined"
dbates@webkit.org [Tue, 27 Sep 2016 17:18:55 +0000 (17:18 +0000)]
Cannot run dump-class-layout; dies with "global name 'lldb' is not defined"
https://bugs.webkit.org/show_bug.cgi?id=162585

Reviewed by Simon Fraser.

Import the lldb module into the global namespace.

Currently dump-class-layout imports the lldb Python module using the import statement
from the helper function import_lldb. The import statement imports the names of the
specified module into the scope of import_lldb(); => the names imported from this
module cannot be accessed outside the scope of import_lldb(). Other functions in
this script assume that the lldb module was imported into the global scope. We should
import the module lldb into the global scope, if it exists, so that these functions
can find it. Otherwise, we should emit a human readable error message that explains
that we failed to import the lldb module.

Also remove some unnecessary semicolon characters.

* Scripts/dump-class-layout:
(import_lldb):

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

4 years agoRemove deprecated ENCRYPTED_MEDIA implementation.
jer.noble@apple.com [Tue, 27 Sep 2016 17:14:32 +0000 (17:14 +0000)]
Remove deprecated ENCRYPTED_MEDIA implementation.
https://bugs.webkit.org/show_bug.cgi?id=161010

Source/JavaScriptCore:

Reviewed by Eric Carlson.

Remove ENABLE_ENCRYPTED_MEDIA.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Reviewed by Eric Carlson.

Remove all references to the deprecated ENABLE_ENCRYPTED_MEDIA (leaving in place
the soon-to-be deprecated ENABLE_ENCRYPTED_MEDIA_V2).

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/DOMHTMLMediaElement.h:
* bindings/objc/DOMHTMLMediaElement.mm:
(-[DOMHTMLMediaElement canPlayType:]):
(-[DOMHTMLMediaElement canPlayType:keySystem:]): Deleted.
* bindings/js/JSDictionary.cpp:
* bindings/js/JSDictionary.h:
* dom/Element.idl:
* dom/EventNames.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::exceptionCodeForMediaKeyException): Deleted.
(WebCore::HTMLMediaElement::canPlayType): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyAdded): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyError): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyMessage): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaError.h:
* html/MediaError.idl:
* html/MediaKeyError.h:
* html/MediaKeyError.idl:
* html/MediaKeyEvent.cpp: Removed.
(WebCore::MediaKeyEvent::MediaKeyEvent): Deleted.
(WebCore::MediaKeyEvent::~MediaKeyEvent): Deleted.
(WebCore::MediaKeyEvent::eventInterface): Deleted.
* html/MediaKeyEvent.h: Removed.
* html/MediaKeyEvent.idl: Removed.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::nextBestMediaEngine):
(WebCore::MediaPlayer::generateKeyRequest): Deleted.
(WebCore::MediaPlayer::addKey): Deleted.
(WebCore::MediaPlayer::cancelKeyRequest): Deleted.
(WebCore::MediaPlayer::keyAdded): Deleted.
(WebCore::MediaPlayer::keyError): Deleted.
(WebCore::MediaPlayer::keyMessage): Deleted.
(WebCore::MediaPlayer::keyNeeded): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerKeyAdded): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyError): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyMessage): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyNeeded): Deleted.
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::addKey): Deleted.
(WebCore::MediaPlayerPrivateInterface::generateKeyRequest): Deleted.
(WebCore::MediaPlayerPrivateInterface::cancelKeyRequest): Deleted.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::generateKeyRequest): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::addKey): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelKeyRequest): Deleted.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::supportsType): Deleted.
* testing/MockCDM.h:

Source/WebKit/mac:

Remove ENABLE_ENCRYPTED_MEDIA.

Reviewed by Eric Carlson.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Reviewed by Eric Carlson.

Remove ENABLE_ENCRYPTED_MEDIA.

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

Reviewed by Eric Carlson.

Remove ENABLE_ENCRYPTED_MEDIA.

* wtf/FeatureDefines.h:

Tools:

Reviewed by Eric Carlson.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

Reviewed by Eric Carlson.

* fast/events/constructors/media-key-event-constructor-expected.txt: Removed.
* fast/events/constructors/media-key-event-constructor.html: Removed.
* media/encrypted-media/encrypted-media-can-play-type-expected.txt: Removed.
* media/encrypted-media/encrypted-media-can-play-type-webm-expected.txt: Removed.
* media/encrypted-media/encrypted-media-can-play-type-webm.html: Removed.
* media/encrypted-media/encrypted-media-can-play-type.html: Removed.
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/fast/events/constructors/media-key-event-constructor-expected.txt: Removed.
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

4 years ago[WK2] Navigating to a Blob URL does not trigger a download
cdumez@apple.com [Tue, 27 Sep 2016 16:58:41 +0000 (16:58 +0000)]
[WK2] Navigating to a Blob URL does not trigger a download
https://bugs.webkit.org/show_bug.cgi?id=162574

Reviewed by Darin Adler.

Source/WebKit2:

Add support for converting Blob URL loads into downloads.

* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::didReceiveResponseAsync):
Make sure we return a valid suggested filename because the client side (Safari)
does not deal with empty suggested filenames. Use "unknown" by default to
match the default suggested filename of non-Blob downloads.

* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::startWithHandle):
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::convertHandleToDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/ios/DownloadIOS.mm:
(WebKit::Download::startNetworkLoadWithHandle):
* NetworkProcess/Downloads/mac/DownloadMac.mm:
(WebKit::Download::startNetworkLoadWithHandle):
* NetworkProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::Download::startNetworkLoadWithHandle):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
* NetworkProcess/NetworkLoad.h:
(WebKit::NetworkLoad::handle):

Tools:

Add API that tests navigating to a Blob URL and checks that that the load
properly gets converted into a download.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm:
(-[BlobDownloadDelegate _downloadDidStart:]):
(-[BlobDownloadDelegate _download:didReceiveResponse:]):
(-[BlobDownloadDelegate _download:didReceiveData:]):
(-[BlobDownloadDelegate _download:decideDestinationWithSuggestedFilename:allowOverwrite:]):
(-[BlobDownloadDelegate _downloadDidFinish:]):
(-[DownloadBlobURLNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/DownloadRequestBlobURL.html: Added.

LayoutTests:

Rebaseline now that the suggested download name is "unknown" by default
for blob downloads as well.

* fast/dom/HTMLAnchorElement/anchor-download-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-nodownload-set-expected.txt:

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

4 years ago[Fetch API] Use Ref<const T> in FetchBody::m_data variant
commit-queue@webkit.org [Tue, 27 Sep 2016 16:47:49 +0000 (16:47 +0000)]
[Fetch API] Use Ref<const T> in FetchBody::m_data variant
https://bugs.webkit.org/show_bug.cgi?id=162599

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-27
Reviewed by Alex Christensen.

Source/WebCore:

Covered by existing tests.

Using Ref<const T> for all variants of m_data except for FormData since FetchBody is actually creating it and may modifiy it.
Updating blob loading code path to use a const Blob& instead of a Blob&.

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::extract):
(WebCore::FetchBody::clone):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::blobBody):
(WebCore::FetchBody::arrayBufferBody):
(WebCore::FetchBody::arrayBufferViewBody):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::loadBlob):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/fetch/FetchLoader.h:

Source/WTF:

Enabling to use DeferrableRefCounted<const T> by making m_refCount mutable.

* wtf/DeferrableRefCounted.h:
(WTF::DeferrableRefCountedBase::ref):
(WTF::DeferrableRefCountedBase::derefBase):
(WTF::DeferrableRefCounted::deref):

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

4 years ago[cmake] Simplify Clang checks and prepare for compiler ID split
annulen@yandex.ru [Tue, 27 Sep 2016 16:02:10 +0000 (16:02 +0000)]
[cmake] Simplify Clang checks and prepare for compiler ID split
https://bugs.webkit.org/show_bug.cgi?id=162609

Reviewed by Michael Catanzaro.

CMake 3.x introduces separate compiler id for AppleClang, making condition
(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") inappropriate as check for
any clang version. Introduce COMPILER_IS_CLANG instead, which is also
shorter that CMAKE_CXX_COMPILER_ID comparison.

* CMakeLists.txt:
* Source/cmake/OptionsCommon.cmake:
* Source/cmake/WebKitHelpers.cmake:
* Source/cmake/OptionsEfl.cmake: Use CMAKE_COMPILER_IS_GNUCXX instead of
!Clang check because this is what was really meant here.

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

4 years agoUnreviewed typo fix
mcatanzaro@igalia.com [Tue, 27 Sep 2016 15:42:33 +0000 (15:42 +0000)]
Unreviewed typo fix

* platform/gtk/UserAgentGtk.cpp:
(WebCore::standardUserAgent):

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

4 years agoClean-up CachedImage constructor
commit-queue@webkit.org [Tue, 27 Sep 2016 14:32:02 +0000 (14:32 +0000)]
Clean-up CachedImage constructor
https://bugs.webkit.org/show_bug.cgi?id=162601

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-27
Reviewed by Sam Weinig.

No change of behavior.
Removing an unused constructor.
Specializing one constructor for manually cached images.
Cleaning initialization of some CachedImage fields.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):

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

4 years ago[GTK] Install binaries to pkglibexecdir rather than bindir
mcatanzaro@igalia.com [Tue, 27 Sep 2016 13:50:42 +0000 (13:50 +0000)]
[GTK] Install binaries to pkglibexecdir rather than bindir
https://bugs.webkit.org/show_bug.cgi?id=162602

Reviewed by Carlos Garcia Campos.

Source/JavaScriptCore:

Install jsc shell to LIBEXEC_INSTALL_DIR rather than EXEC_INSTALL_DIR.

Note these locations are the same on non-GTK ports.

* shell/CMakeLists.txt:

Tools:

Install MiniBrowser to LIBEXEC_INSTALL_DIR rather than EXEC_INSTALL_DIR.

* MiniBrowser/gtk/CMakeLists.txt:

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

4 years ago[FreeType] Add comment further justifying use of FT_LOAD_FORCE_AUTOHINT
mcatanzaro@igalia.com [Tue, 27 Sep 2016 13:40:46 +0000 (13:40 +0000)]
[FreeType] Add comment further justifying use of FT_LOAD_FORCE_AUTOHINT
https://bugs.webkit.org/show_bug.cgi?id=162607

Reviewed by Martin Robinson.

* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData):

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

4 years agoBuild fails for X11+EGL due to missing gst_gl_display_x11_new_with_display()
commit-queue@webkit.org [Tue, 27 Sep 2016 13:20:16 +0000 (13:20 +0000)]
Build fails for X11+EGL due to missing gst_gl_display_x11_new_with_display()
https://bugs.webkit.org/show_bug.cgi?id=162606

Patch by Mario Sanchez Prada <mario@endlessm.com> on 2016-09-27
Reviewed by Gustavo Noronha Silva.

Use the right check to retrieve the right instance of GstGLDisplay
depending on whether we're using GLX or EGL, not X11 or Wayland.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):

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

4 years ago[GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is...
commit-queue@webkit.org [Tue, 27 Sep 2016 13:11:13 +0000 (13:11 +0000)]
[GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is failing
https://bugs.webkit.org/show_bug.cgi?id=162547

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-27
Reviewed by Michael Catanzaro.

Covered by existing tests.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::createTestingSession): Setting the underlying soupSession.

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

4 years ago[cmake] Added COMPILER_IS_GCC_OR_CLANG variable to simplify conditions.
annulen@yandex.ru [Tue, 27 Sep 2016 12:31:58 +0000 (12:31 +0000)]
[cmake] Added COMPILER_IS_GCC_OR_CLANG variable to simplify conditions.
https://bugs.webkit.org/show_bug.cgi?id=162605

Reviewed by Michael Catanzaro.

* CMakeLists.txt:
* Source/cmake/OptionsCommon.cmake:
* Source/cmake/WebKitHelpers.cmake:

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

4 years ago[EFL] Locate color picker popup to center of window
gyuyoung.kim@webkit.org [Tue, 27 Sep 2016 11:46:41 +0000 (11:46 +0000)]
[EFL] Locate color picker popup to center of window
https://bugs.webkit.org/show_bug.cgi?id=162540

Reviewed by Michael Catanzaro.

Color picker popup hasn't located in a center of main window, because
elm_win_center() function doesn't work correctly. It looks a bug.

To fix the problem, this patch uses evas_object_geometry_set() instead.

* MiniBrowser/efl/main.c:
(_color_picker_request_cb):

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

4 years ago[GTK] Disable ACCELERATED_2D_CANVAS when using build-webkit
mcatanzaro@igalia.com [Tue, 27 Sep 2016 11:24:46 +0000 (11:24 +0000)]
[GTK] Disable ACCELERATED_2D_CANVAS when using build-webkit
https://bugs.webkit.org/show_bug.cgi?id=162600

Reviewed by Carlos Garcia Campos.

* Scripts/webkitperl/FeatureList.pm:

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

4 years ago[GTK] Unreviewed typo fix
mcatanzaro@igalia.com [Tue, 27 Sep 2016 10:49:05 +0000 (10:49 +0000)]
[GTK] Unreviewed typo fix

* UIProcess/API/gtk/WebKitWebInspector.cpp:
(webkit_web_inspector_class_init):

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

4 years ago[GTK] Mac defaults are used for key shortcuts on Linux
commit-queue@webkit.org [Tue, 27 Sep 2016 09:27:28 +0000 (09:27 +0000)]
[GTK] Mac defaults are used for key shortcuts on Linux
https://bugs.webkit.org/show_bug.cgi?id=162564

Don't set Mac's default keymap as a fallthrough for CodeMirror when we
are not on Mac.

Patch by Tomas Popela <tpopela@redhat.com> on 2016-09-27
Reviewed by Carlos Garcia Campos.

* UserInterface/Test.html: Include Platform.js for the
WebInspector.Platform definition.
* UserInterface/Views/CodeMirrorAdditions.js:

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