WebKit-https.git
2 years agoUse AtomicString in RuleSet and RuleFeature
antti@apple.com [Wed, 22 Mar 2017 17:19:28 +0000 (17:19 +0000)]
Use AtomicString in RuleSet and RuleFeature
https://bugs.webkit.org/show_bug.cgi?id=119310
<rdar://problem/28214658>

Reviewed by Andreas Kling.

..instead of the plain AtomicStringImpl*. This introduces some ref churn but not too much.

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::ancestorClassRules):
(WebCore::DocumentRuleSets::ancestorAttributeRulesForHTML):
* css/DocumentRuleSets.h:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
(WebCore::makeAttributeSelectorKey):
(WebCore::RuleFeatureSet::collectFeatures):
* css/RuleFeature.h:
* css/RuleSet.cpp:
(WebCore::RuleSet::addToRuleSet):
(WebCore::rulesCountForName):
(WebCore::RuleSet::addRule):
* css/RuleSet.h:
(WebCore::RuleSet::idRules):
(WebCore::RuleSet::classRules):
(WebCore::RuleSet::shadowPseudoElementRules):
(WebCore::RuleSet::tagRules):
* css/StyleResolver.h:
(WebCore::StyleResolver::hasSelectorForAttribute):
(WebCore::StyleResolver::hasSelectorForClass):
(WebCore::StyleResolver::hasSelectorForId):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByAttributeChange):
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):
(WebCore::Style::SharingResolver::classNamesAffectedByRules):

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

2 years agoSafari sends empty "Access-Control-Request-Headers" in preflight request
commit-queue@webkit.org [Wed, 22 Mar 2017 17:18:27 +0000 (17:18 +0000)]
Safari sends empty "Access-Control-Request-Headers" in preflight request
https://bugs.webkit.org/show_bug.cgi?id=169851

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-22
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/cors/cors-preflight-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight.js:

Source/WebCore:

Covered by updated test.

* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest): Not adding "Access-Control-Request-Headers" to
request header if value is empty.

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

2 years ago[DFG] Don't use ArraySlice intrinsic on MIPS
commit-queue@webkit.org [Wed, 22 Mar 2017 17:15:17 +0000 (17:15 +0000)]
[DFG] Don't use ArraySlice intrinsic on MIPS
https://bugs.webkit.org/show_bug.cgi?id=169721

Patch by Guillaume Emont <guijemont@igalia.com> on 2017-03-22
Reviewed by Yusuke Suzuki.

Like on x86, we don't have enough registers available for this.

* assembler/CPU.h:
(JSC::isMIPS): Added.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
Don't use the ArraySlice intrinsic on MIPS.

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

2 years agoXMLHttpRequest: getAllResponseHeaders() should lowercase header names before sorting
commit-queue@webkit.org [Wed, 22 Mar 2017 17:14:36 +0000 (17:14 +0000)]
XMLHttpRequest: getAllResponseHeaders() should lowercase header names before sorting
https://bugs.webkit.org/show_bug.cgi?id=169286

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-22
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/getallresponseheaders-cl-expected.txt:
* web-platform-tests/XMLHttpRequest/getallresponseheaders-expected.txt:

Source/WebCore:

Covered by rebased tests.

https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method now mandates to lowercase the header names and
sort them before appending them. This ensures that differences in the way headers are processed by browsers are
not visible to web pages. This also moves towards lowercased/case-insensitive header processing which should be
the norm.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::getAllResponseHeaders): Lower-casing, then sorting, then serializing headers.
* xml/XMLHttpRequest.h: Storing getAllResponseHeaders result if case needed again.

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

2 years agoImplement the "noopener" feature for window.open()
cdumez@apple.com [Wed, 22 Mar 2017 16:15:16 +0000 (16:15 +0000)]
Implement the "noopener" feature for window.open()
https://bugs.webkit.org/show_bug.cgi?id=163960
<rdar://problem/28941679>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Import test coverage from WPT upstream.

* resources/import-expectations.json:
* web-platform-tests/common/PrefixedLocalStorage.js: Added.
(PrefixedLocalStorage):
(PrefixedLocalStorage.prototype.clear):
(PrefixedLocalStorage.prototype.url):
(PrefixedLocalStorage.prototype.prefixedKey):
(PrefixedLocalStorage.prototype.setItem):
(PrefixedLocalStorage.prototype.onSet):
(PrefixedLocalStorageTest):
(PrefixedLocalStorageTest.prototype.cleanup):
(PrefixedLocalStorageResource):
* web-platform-tests/common/w3c-import.log:
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/message-window-opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/no-opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/w3c-import.log.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/w3c-import.log:

Source/WebCore:

Implement the "noopener" feature for window.open(). If 'noopener' is passed to window.open()
then the new Window's opener property will be null.

Tests: imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html
       imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html
       imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html
       imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html
       imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/WindowFeatures.cpp:
(WebCore::parseWindowFeatures):
(WebCore::setWindowFeature):
* page/WindowFeatures.h:

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

2 years ago[Linux] determineArchitecture is not cross-compile aware
clopez@igalia.com [Wed, 22 Mar 2017 14:36:32 +0000 (14:36 +0000)]
[Linux] determineArchitecture is not cross-compile aware
https://bugs.webkit.org/show_bug.cgi?id=169886

Reviewed by Michael Catanzaro.

Try to detect the target architecture name from the GCC triplet
when cross-building.

The aarch64 architecture is renamed to arm64 (this is coherent with
the rest of the perl tooling that consults the architecture determined
in determineArchitecture(), the check for this arch is always done
with the arm64 name).

* Scripts/webkitdirs.pm: Remove the isARM() function: its dead code
and not cross-build aware.
(determineArchitecture): When crossbuilding, try to detect the target
architecture name from the GCC triplet.
Remove also the fallback option to run the arch command, because this
command doesn't print the expected on Mac/BSD, and on Linux is the
same than uname -m. See https://bugs.webkit.org/show_bug.cgi?id=152958#c6
(isCrossCompilation): Some cross-compilers (buildroot one for example)
don't define the --host option. Add another option to detect that
we are cross-building by building a dummy program and checking if
we can run it.

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

2 years agoUnreviewed GTK+ gardening. Rebaseline fast/text/hyphenate-limit-lines.html.
carlosgc@webkit.org [Wed, 22 Mar 2017 11:59:33 +0000 (11:59 +0000)]
Unreviewed GTK+ gardening. Rebaseline fast/text/hyphenate-limit-lines.html.

* platform/gtk/fast/text/hyphenate-limit-lines-expected.txt:

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

2 years agoUnreviewed GTK+ gardening. Remove platform expectation after r214246.
carlosgc@webkit.org [Wed, 22 Mar 2017 11:55:27 +0000 (11:55 +0000)]
Unreviewed GTK+ gardening. Remove platform expectation after r214246.

* platform/gtk/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt: Removed.

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

2 years agoUnreviewed GTK+ gardening. Rebaseline several tests after r214244.
carlosgc@webkit.org [Wed, 22 Mar 2017 11:50:54 +0000 (11:50 +0000)]
Unreviewed GTK+ gardening. Rebaseline several tests after r214244.

* platform/gtk/accessibility/file-upload-button-stringvalue-expected.txt:
* platform/gtk/fast/forms/box-shadow-override-expected.png:
* platform/gtk/fast/forms/box-shadow-override-expected.txt:
* platform/gtk/fast/forms/file/file-input-direction-expected.png:
* platform/gtk/fast/forms/file/file-input-direction-expected.txt:
* platform/gtk/fast/forms/file/file-input-disabled-expected.png:
* platform/gtk/fast/forms/file/file-input-disabled-expected.txt:
* platform/gtk/fast/forms/form-element-geometry-expected.png:
* platform/gtk/fast/forms/form-element-geometry-expected.txt:
* platform/gtk/fast/forms/input-appearance-height-expected.png:
* platform/gtk/fast/forms/input-appearance-height-expected.txt:
* platform/gtk/fast/forms/input-value-expected.txt:
* platform/gtk/media/video-controls-captions-trackmenu-localized-expected.txt:
* platform/gtk/media/video-controls-captions-trackmenu-sorted-expected.txt:

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

2 years ago[Soup] "Only from websites I visit" cookie policy is broken
svillar@igalia.com [Wed, 22 Mar 2017 10:09:23 +0000 (10:09 +0000)]
[Soup] "Only from websites I visit" cookie policy is broken
https://bugs.webkit.org/show_bug.cgi?id=168912

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Do not reset the first party for cookies on redirects. That's properly done for the main
resource in DocumentLoader::willSendRequest and, in the case of subresources, is absolutely
wrong (which is what we were doing since r143931).

The most notable effect was that subresources loaded via redirects were effectively
bypassing the "no third party" policy for cookies.

Test: http/tests/security/cookies/third-party-cookie-blocking-redirect.html

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::doRedirect):

Source/WebKit2:

Do not reset the first party for cookies on redirects. That's properly done for the main
resource in DocumentLoader::willSendRequest and, in the case of subresources, is absolutely
wrong (which is what we were doing since r143931).

The most notable effect was that subresources loaded via redirects were effectively
bypassing the "no third party" policy for cookies.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):

LayoutTests:

* http/tests/security/cookies/third-party-cookie-blocking-redirect-expected.txt: Added.
* http/tests/security/cookies/third-party-cookie-blocking-redirect.html: Added.

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

2 years agoAll http/ tests with PHP fail in Debian unstable with php7
svillar@igalia.com [Wed, 22 Mar 2017 10:07:14 +0000 (10:07 +0000)]
All http/ tests with PHP fail in Debian unstable with php7
https://bugs.webkit.org/show_bug.cgi?id=169913

Reviewed by Michael Catanzaro.

The problem is that the configuration file was still checking for php5 instead of php7.

* http/conf/debian-httpd-2.4-php7.conf:

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

2 years agoMake it possible to use WEB_UI_STRING macros to mark translatable strings in glib...
carlosgc@webkit.org [Wed, 22 Mar 2017 09:55:34 +0000 (09:55 +0000)]
Make it possible to use WEB_UI_STRING macros to mark translatable strings in glib based ports
https://bugs.webkit.org/show_bug.cgi?id=169672

Reviewed by Michael Catanzaro.

Source/WebCore:

WEB_UI_STRING macros are currently used by Cocoa based ports and Windows port. For other ports it simply returns
the given string, but it's not translated. In the GTK+ port we have all translatable strings from
LocalizedStrings.cpp copied in LocalizedStringsGtk.cpp to use the glib macros to mark them as translatable. In
most of the cases the strings are exactly in the same, in some others (the context menu ones) the string only
differs in the mnemonics used by GTK, and only in a few cases the strings are different. We could remove most of
that duplication if strings used by WEB_UI_STRING were marked as translatable in glib based ports too.

This patch makes that possible with the following changes:

  - Add WEB_UI_STRING_WITH_MNEMONIC() to handle the cases where the strings only differ in the mnemonics. It
    receives the string with mnemonics that is ignored in all ports except GTK+.
  - All platform specific strings have been moved to the platform files, to ensure scanners don't include
    strings from other ports.
  - For the same reason a new macro WEB_UI_CFSTRING has been also added, just to make sure that CF strings are
    only used by CF based ports. The implementation is the same as WEB_UI_STRING, it only changes the name to
    not confuse the scanners.
  - And again for the same reason, for non-CF and non-Glib cases WEB_UI_STRING is not used, since in those cases
    strings are not really translated and String::fromUTF8() is actually used. So, now we use String::fromUTF8()
    directly instead of WEB_UI_STRING to not confuse the scanners.

* CMakeLists.txt: Add LocalizedStrings.cpp to the compilation.
* PlatformGTK.cmake: Move LocalizedStringsGtk.cpp to the list of sources not depending on GTK+, since it no
longer uses GTK+.
* extract-localizable-strings.pl: Update it to handle the new macros.
* platform/LocalizedStrings.cpp:
(WebCore::formatLocalizedString):
(WebCore::contextMenuItemTagOpenLinkInNewWindow):
(WebCore::contextMenuItemTagDownloadLinkToDisk):
(WebCore::contextMenuItemTagOpenImageInNewWindow):
(WebCore::contextMenuItemTagCopyImageToClipboard):
(WebCore::contextMenuItemTagOpenFrameInNewWindow):
(WebCore::contextMenuItemTagCopy):
(WebCore::contextMenuItemTagGoBack):
(WebCore::contextMenuItemTagGoForward):
(WebCore::contextMenuItemTagStop):
(WebCore::contextMenuItemTagReload):
(WebCore::contextMenuItemTagCut):
(WebCore::contextMenuItemTagPaste):
(WebCore::contextMenuItemTagIgnoreSpelling):
(WebCore::contextMenuItemTagLearnSpelling):
(WebCore::contextMenuItemTagLookUpInDictionary):
(WebCore::contextMenuItemTagOpenLink):
(WebCore::contextMenuItemTagIgnoreGrammar):
(WebCore::contextMenuItemTagSpellingMenu):
(WebCore::contextMenuItemTagShowSpellingPanel):
(WebCore::contextMenuItemTagCheckSpelling):
(WebCore::contextMenuItemTagCheckSpellingWhileTyping):
(WebCore::contextMenuItemTagCheckGrammarWithSpelling):
(WebCore::contextMenuItemTagFontMenu):
(WebCore::contextMenuItemTagBold):
(WebCore::contextMenuItemTagItalic):
(WebCore::contextMenuItemTagUnderline):
(WebCore::contextMenuItemTagOutline):
(WebCore::contextMenuItemTagOpenVideoInNewWindow):
(WebCore::contextMenuItemTagOpenAudioInNewWindow):
(WebCore::contextMenuItemTagDownloadVideoToDisk):
(WebCore::contextMenuItemTagDownloadAudioToDisk):
(WebCore::contextMenuItemTagExitVideoFullscreen):
(WebCore::contextMenuItemTagMediaPlay):
(WebCore::contextMenuItemTagMediaPause):
(WebCore::contextMenuItemTagMediaMute):
(WebCore::contextMenuItemTagInspectElement):
(WebCore::AXAutoFillContactsLabel):
(WebCore::imageTitle):
(WebCore::validationMessageRangeUnderflowText):
(WebCore::validationMessageRangeOverflowText):
(WebCore::textTrackCountryAndLanguageMenuItemText):
(WebCore::textTrackLanguageMenuItemText):
(WebCore::closedCaptionTrackMenuItemText):
(WebCore::sdhTrackMenuItemText):
(WebCore::easyReaderTrackMenuItemText):
(WebCore::forcedTrackMenuItemText):
(WebCore::audioDescriptionTrackSuffixText):
(WebCore::webCryptoMasterKeyKeychainLabel):
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::copyImageUnknownFileLabel):
(WebCore::contextMenuItemTagSearchInSpotlight):
(WebCore::contextMenuItemTagSearchWeb):
(WebCore::contextMenuItemTagShowFonts):
(WebCore::contextMenuItemTagStyles):
(WebCore::contextMenuItemTagShowColors):
(WebCore::contextMenuItemTagSpeechMenu):
(WebCore::contextMenuItemTagStartSpeaking):
(WebCore::contextMenuItemTagStopSpeaking):
(WebCore::contextMenuItemTagCorrectSpellingAutomatically):
(WebCore::contextMenuItemTagSubstitutionsMenu):
(WebCore::contextMenuItemTagShowSubstitutions):
(WebCore::contextMenuItemTagSmartCopyPaste):
(WebCore::contextMenuItemTagSmartQuotes):
(WebCore::contextMenuItemTagSmartDashes):
(WebCore::contextMenuItemTagSmartLinks):
(WebCore::contextMenuItemTagTextReplacement):
(WebCore::contextMenuItemTagTransformationsMenu):
(WebCore::contextMenuItemTagMakeUpperCase):
(WebCore::contextMenuItemTagMakeLowerCase):
(WebCore::contextMenuItemTagCapitalize):
(WebCore::contextMenuItemTagChangeBack):
(WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen):
(WebCore::contextMenuItemTagExitVideoEnhancedFullscreen):
(WebCore::AXARIAContentGroupText):
(WebCore::AXHorizontalRuleDescriptionText):
(WebCore::AXMarkText):
(WebCore::AXMeterGaugeRegionOptimumText):
(WebCore::AXMeterGaugeRegionSuboptimalText):
(WebCore::AXMeterGaugeRegionLessGoodText):
(WebCore::builtInPDFPluginName):
(WebCore::pdfDocumentTypeDescription):
(WebCore::postScriptDocumentTypeDescription):
(WebCore::keygenMenuItem2048):
(WebCore::keygenKeychainItemName):
(WebCore::htmlSelectMultipleItems):
(WebCore::fileButtonChooseMediaFileLabel):
(WebCore::fileButtonChooseMultipleMediaFilesLabel):
(WebCore::fileButtonNoMediaFileSelectedLabel):
(WebCore::fileButtonNoMediaFilesSelectedLabel):
(WebCore::insertListTypeNone):
(WebCore::insertListTypeBulleted):
(WebCore::insertListTypeBulletedAccessibilityTitle):
(WebCore::insertListTypeNumbered):
(WebCore::insertListTypeNumberedAccessibilityTitle):
(WebCore::exitFullScreenButtonAccessibilityTitle):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::contextMenuItemTagDelete):
(WebCore::contextMenuItemTagSelectAll):
* platform/win/LocalizedStringsWin.cpp:
(WebCore::contextMenuItemTagSearchWeb):
(WebCore::uploadFileText):
(WebCore::allFilesText):

Source/WebCore/platform/gtk/po:

* CMakeLists.txt: Add keyword parameters for WEB_UI_STRING macros.
* POTFILES.in: Add LocalizedStrings.cpp to the list.

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

2 years ago[GTK] Several WPT tests are failing since they were added in the last update in r213882
carlosgc@webkit.org [Wed, 22 Mar 2017 08:41:44 +0000 (08:41 +0000)]
[GTK] Several WPT tests are failing since they were added in the last update in r213882
https://bugs.webkit.org/show_bug.cgi?id=169915

Reviewed by Michael Catanzaro.

Tools:

Add libsoup patch to not fail loads when there's no empty line after the headers in responses with no body.

* gtk/jhbuild.modules:
* gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch: Added.

LayoutTests:

They fail because libsoup fails to load the requests because the response doesn't include the empty line after the
headers while other browsers allow that. Even with libsoup patched we still need platform specific expectations
for imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders.htm, because libsoup caches all header
names, so the first time foo-test header is cached and then always used no matter what case is used. The results
are still valid in any case.

* platform/gtk/imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-expected.txt: Added.

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

2 years ago[iOS] Migrate off of CTFontCreateForCSS
mmaxfield@apple.com [Wed, 22 Mar 2017 07:15:16 +0000 (07:15 +0000)]
[iOS] Migrate off of CTFontCreateForCSS
https://bugs.webkit.org/show_bug.cgi?id=168894

Reviewed by Antti Koivisto.

Source/WebCore:

Use the new font selection algorithm introduced in r213163 on iOS.

Test: fast/text/font-weights.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
* platform/graphics/cocoa/FontCocoa.mm: On iOS only, CTFontCreateForCSS()
will return a 0-sized font if the passed size parameter is 0. However, all
other CT APIs will create a 12-px-sized font if the passed size parameter is
0. Most of our code knows and understands this (because this is how it works
on the Mac). However, this one place needs to be updated to understand this.

LayoutTests:

* platform/ios-simulator/fast/text/font-weights-expected.txt:

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

2 years agoMake non-decoded image flashing less intrusive
simon.fraser@apple.com [Wed, 22 Mar 2017 03:49:50 +0000 (03:49 +0000)]
Make non-decoded image flashing less intrusive
https://bugs.webkit.org/show_bug.cgi?id=169942

Reviewed by Said Abou-Hallawa.

When compositing borders are enabled, we paint yellow for images that paint but don't yet have a decoded
frame. Give this yellow 50% alpha to make it less intrusive

Also log to the images log channel when we destroy decoded data.

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

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

2 years agoThe DFG Integer Check Combining phase should force an OSR exit for CheckInBounds...
mark.lam@apple.com [Wed, 22 Mar 2017 01:55:00 +0000 (01:55 +0000)]
The DFG Integer Check Combining phase should force an OSR exit for CheckInBounds on a negative constant min bound.
https://bugs.webkit.org/show_bug.cgi?id=169933
<rdar://problem/31105125>

Reviewed by Filip Pizlo and Geoffrey Garen.

Also fixed the bit-rotted RangeKey::dump() function.

* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::handleBlock):

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

2 years agoLoosen audio playback restrictions when the volume is 0.
mrajca@apple.com [Wed, 22 Mar 2017 01:44:21 +0000 (01:44 +0000)]
Loosen audio playback restrictions when the volume is 0.
https://bugs.webkit.org/show_bug.cgi?id=169897

Reviewed by Eric Carlson.

Source/WebCore:

Added API tests.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/autoplay-zero-volume-check.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(TEST):

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

2 years agoEWS fails to parse_bug_id_from_attachment_page after bugzilla upgrade
aakash_jain@apple.com [Wed, 22 Mar 2017 00:45:15 +0000 (00:45 +0000)]
EWS fails to parse_bug_id_from_attachment_page after bugzilla upgrade
https://bugs.webkit.org/show_bug.cgi?id=169937
<rdar://problem/31181859>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla._parse_bug_id_from_attachment_page): Since rel tag is no longer present, parsing the bug id from bug_title.
* Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py: Fixed unit test.

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

2 years agoDisable all virtual tables.
beidson@apple.com [Wed, 22 Mar 2017 00:08:40 +0000 (00:08 +0000)]
Disable all virtual tables.
<rdar://problem/31081972> and https://bugs.webkit.org/show_bug.cgi?id=169928
Source/WebCore:

Reviewed by Jer Noble.

No new tests (Covered by changes to existing test).

* Modules/webdatabase/DatabaseAuthorizer.cpp:
(WebCore::DatabaseAuthorizer::createVTable):
(WebCore::DatabaseAuthorizer::dropVTable):

LayoutTests:

Reviewed by Jer Noble.

* storage/websql/test-authorizer-expected.txt:
* storage/websql/test-authorizer.js:
(createStatementsCallback):

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

2 years agoRemove bogus availability annotations from DOM SPI headers.
andersca@apple.com [Tue, 21 Mar 2017 23:40:26 +0000 (23:40 +0000)]
Remove bogus availability annotations from DOM SPI headers.
rdar://problem/31015675

Rubber-stamped by Dan Bernstein.

Source/WebCore:

* platform/cocoa/WebKitAvailability.h:
Remove __NSi_9876_5 #define.

Source/WebKit/mac:

* DOM/DOMHTMLMediaElement.h:
* DOM/DOMHTMLVideoElement.h:
* DOM/DOMMediaError.h:
* DOM/DOMTextEvent.h:
* DOM/DOMTimeRanges.h:
* DOM/DOMTokenList.h:

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

2 years agoews should indicate in logs when it fails to parse_bug_id_from_attachment_page
aakash_jain@apple.com [Tue, 21 Mar 2017 22:33:30 +0000 (22:33 +0000)]
ews should indicate in logs when it fails to parse_bug_id_from_attachment_page
https://bugs.webkit.org/show_bug.cgi?id=169927

Reviewed by  Alexey Proskuryakov.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla._parse_bug_id_from_attachment_page): Added log statement.

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

2 years ago2017-03-21 Zalan Bujtas <zalan@apple.com>
zalan@apple.com [Tue, 21 Mar 2017 21:39:01 +0000 (21:39 +0000)]
2017-03-21  Zalan Bujtas  <zalan@apple.com>

        Tear down descendant renderers when <slot>'s display value is set to no "contents".
        https://bugs.webkit.org/show_bug.cgi?id=169921
        <rdar://problem/30336417>

        Reviewed by Antti Koivisto.

        Since "display: contents" does not generate a renderer, when an element's display value is
        changed to something other than "contents", we not only create a renderer but also reparent its descendant
        subtree (e.g from slot's parent to the newly constructed slot renderer). During this reparenting, we
        need to tear down the descendant subtree tree and build it up again to reflect the new rendering context.

        Test: fast/shadow-dom/slot-with-continuation-descendants.html

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateElementRenderer):

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

2 years agoTeach TextIndicator to estimate the background color of the given Range
wenson_hsieh@apple.com [Tue, 21 Mar 2017 21:25:47 +0000 (21:25 +0000)]
Teach TextIndicator to estimate the background color of the given Range
https://bugs.webkit.org/show_bug.cgi?id=169869
<rdar://problem/31127272>

Reviewed by Anders Carlsson and Simon Fraser.

Source/WebCore:

Introduces a simple heuristic to compute a background color that is appropriate to use as a border surrounding
the snapshot of the given Range. This work is only carried out if TextIndicatorOptionComputeEstimatedBackgroundColor
is specified. The details of how this background color is estimated (as well as when to fall back) can be improved
in several ways (one idea is to sample colors along the edge of the snapshot). For the time being, this patch
naively walks up the render tree in search of enclosing parent renderers that have background colors. If any
renderers have a style that is deemed too complex to capture in a single background color, then fall back to the
base document background color; otherwise, the estimated background color is the result of blending these
background colors together.

* page/TextIndicator.cpp:
(WebCore::styleContainsComplexBackground):

Bail out of the background color codepath if the renderer has backdrop filters, has a background image, or uses
a non-normal blend mode.

(WebCore::fallbackBackgroundColorForTextSelection):
(WebCore::estimatedBackgroundColorForRange):
(WebCore::initializeIndicator):
* page/TextIndicator.h:

Source/WebKit/mac:

Plumb the estimated background color for WebKit1 clients through a new property in WebUITextIndicatorData.

* WebView/WebView.mm:
(-[WebUITextIndicatorData initWithImage:textIndicatorData:scale:]):
(-[WebUITextIndicatorData dealloc]):
* WebView/WebViewPrivate.h:

Source/WebKit2:

Send the estimated background color over XPC, and adopt TextIndicatorOptionComputeEstimatedBackgroundColor when
snapshotting after performing an edit data interaction.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeEditDataInteraction):

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

2 years ago[WK2] Call processDidCrash() right away when terminating a process that exceeded...
cdumez@apple.com [Tue, 21 Mar 2017 21:08:21 +0000 (21:08 +0000)]
[WK2] Call processDidCrash() right away when terminating a process that exceeded background CPU limit
https://bugs.webkit.org/show_bug.cgi?id=169573
<rdar://problem/30960968>

Reviewed by Andreas Kling.

Call processDidCrash() right away when terminating a process that exceeded background CPU limit
and let the client decide when to reload the content.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::terminateProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didExceedBackgroundCPULimit):

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

2 years ago[GTK][Wayland] Enable WebGL, 3D and compositing layout tests
clopez@igalia.com [Tue, 21 Mar 2017 20:52:51 +0000 (20:52 +0000)]
[GTK][Wayland] Enable WebGL, 3D and compositing layout tests
https://bugs.webkit.org/show_bug.cgi?id=71849

Unreviewed test gardening.

* platform/gtk-wayland/TestExpectations: Add the diff of native Wayland compared to Xvfb.
* platform/gtk/TestExpectations: This two tests seem flaky.

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

2 years agoCrash in WebCore: WebCore::CARingBuffer::getCurrentFrameBounds + 28
jer.noble@apple.com [Tue, 21 Mar 2017 19:45:38 +0000 (19:45 +0000)]
Crash in WebCore: WebCore::CARingBuffer::getCurrentFrameBounds + 28
https://bugs.webkit.org/show_bug.cgi?id=169887
<rdar://problem/23648082>

Reviewed by Eric Carlson.

Because AudioSourceProviderAVFObjC::prepareCallback() can concievably be called after the AudioSourceProviderAVFObjC
it refers to has been destroyed, add an extra layer of indirection between the tap and the provider, and invalidate
that level of indirection before the AudioSourceProviderAVFObjC is destroyed.

* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::initCallback):
(WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
(WebCore::AudioSourceProviderAVFObjC::prepareCallback):
(WebCore::AudioSourceProviderAVFObjC::unprepareCallback):
(WebCore::AudioSourceProviderAVFObjC::processCallback):

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

2 years agoRemove logging left in by mistake.
simon.fraser@apple.com [Tue, 21 Mar 2017 18:18:35 +0000 (18:18 +0000)]
Remove logging left in by mistake.

* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::willBeDestroyed):

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

2 years agoCommit local changes for Bugzilla 5.0.3
ddkilzer@apple.com [Tue, 21 Mar 2017 16:54:04 +0000 (16:54 +0000)]
Commit local changes for Bugzilla 5.0.3

* images/favicon.ico: Update favicon from Dec 11, 2015.
* data/params.json: Deleted.

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

2 years agoUpgrade to Bugzilla 5.0.3.
ddkilzer@apple.com [Tue, 21 Mar 2017 16:27:49 +0000 (16:27 +0000)]
Upgrade to Bugzilla 5.0.3.

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

2 years ago[GTK] Enable WebGL, 3D and compositing layout tests
clopez@igalia.com [Tue, 21 Mar 2017 15:52:28 +0000 (15:52 +0000)]
[GTK] Enable WebGL, 3D and compositing layout tests
https://bugs.webkit.org/show_bug.cgi?id=71849

Unreviewed test gardeninng.

* http/tests/webgl/1.0.2/origin-clean-conformance-expected.txt: Rebaseline after r208049.
* platform/gtk/TestExpectations: Mark new expected failures.
* platform/gtk/compositing/animation/state-at-end-event-transform-layer-expected.png: Added. Rebaselined.
* platform/gtk/compositing/animation/state-at-end-event-transform-layer-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/backing/backface-visibility-in-3dtransformed-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/backing/child-layer-no-backing-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/backing/inline-block-no-backing-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/backing/no-backing-for-clip-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/backing/no-backing-for-clip-overhang-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/backing/no-backing-for-clip-overlap-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/backing/replaced-child-no-backing-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/color-matching/image-color-matching-expected.png: Added. Rebaselined.
* platform/gtk/compositing/color-matching/image-color-matching-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/color-matching/pdf-image-match-expected.png: Added. Rebaselined.
* platform/gtk/compositing/color-matching/pdf-image-match-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/compositing-visible-descendant-expected.png: Added. Rebaselined.
* platform/gtk/compositing/compositing-visible-descendant-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/direct-image-compositing-expected.png: Added. Rebaselined.
* platform/gtk/compositing/direct-image-compositing-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/generated-content-expected.png: Added. Rebaselined.
* platform/gtk/compositing/generated-content-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/abs-position-inside-opacity-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/abs-position-inside-opacity-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/clipping-foreground-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/clipping-foreground-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/composited-html-size-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/composited-html-size-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/composited-in-columns-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/composited-in-columns-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/fixed-in-composited-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/fixed-in-composited-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/fixed-position-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/fixed-position-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/horizontal-scroll-composited-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/horizontal-scroll-composited-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/layer-due-to-layer-children-deep-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/layer-due-to-layer-children-deep-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/layer-due-to-layer-children-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/layer-due-to-layer-children-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/outline-change-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/outline-change-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/partial-layout-update-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/partial-layout-update-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/root-layer-update-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/root-layer-update-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/transfrom-origin-on-zero-size-layer-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/transfrom-origin-on-zero-size-layer-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/vertical-scroll-composited-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/vertical-scroll-composited-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/video-fixed-scrolling-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/video-fixed-scrolling-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/geometry/video-opacity-overlay-expected.png: Added. Rebaselined.
* platform/gtk/compositing/geometry/video-opacity-overlay-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/iframes/composited-iframe-alignment-expected.png: Added. Rebaselined.
* platform/gtk/compositing/iframes/composited-iframe-alignment-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/iframes/iframe-copy-on-scroll-expected.png: Added. Rebaselined.
* platform/gtk/compositing/iframes/iframe-copy-on-scroll-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/iframes/iframe-in-composited-layer-expected.png: Added. Rebaselined.
* platform/gtk/compositing/iframes/iframe-in-composited-layer-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/iframes/invisible-nested-iframe-show-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/iframes/resizer-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/images/direct-image-background-color-expected.png: Added. Rebaselined.
* platform/gtk/compositing/images/direct-image-background-color-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/layer-creation/fixed-position-scroll-expected.png: Added. Rebaselined.
* platform/gtk/compositing/layer-creation/fixed-position-scroll-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/layer-creation/overlap-animation-container-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/layer-creation/overlap-animation-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/layer-creation/will-change-layer-creation-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/layer-creation/will-change-on-normal-flow-content-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/layers-inside-overflow-scroll-expected.png: Added. Rebaselined.
* platform/gtk/compositing/layers-inside-overflow-scroll-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/masks/direct-image-mask-expected.png: Added. Rebaselined.
* platform/gtk/compositing/masks/direct-image-mask-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/masks/masked-ancestor-expected.png: Added. Rebaselined.
* platform/gtk/compositing/masks/masked-ancestor-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/masks/multiple-masks-expected.png: Added. Rebaselined.
* platform/gtk/compositing/masks/multiple-masks-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/masks/simple-composited-mask-expected.png: Added. Rebaselined.
* platform/gtk/compositing/masks/simple-composited-mask-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/media-controls-bar-appearance-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/composited-scrolling-creates-a-stacking-container-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/composited-scrolling-paint-phases-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/fixed-position-ancestor-clip-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/fixed-position-ancestor-clip-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/nested-scrolling-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/nested-scrolling-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/overflow-compositing-descendant-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/overflow-compositing-descendant-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/overflow-positioning-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/overflow-positioning-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/overflow-scroll-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/overflow-scroll-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/parent-overflow-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/parent-overflow-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/remove-overflow-crash2-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/remove-overflow-crash2-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/scroll-ancestor-update-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/scroll-ancestor-update-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/scrollbar-painting-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/scrollbar-painting-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/overflow/theme-affects-visual-overflow-expected.png: Added. Rebaselined.
* platform/gtk/compositing/overflow/theme-affects-visual-overflow-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/reflections/reflection-in-composited-expected.png: Added. Rebaselined.
* platform/gtk/compositing/reflections/reflection-in-composited-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/become-overlay-composited-layer-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/become-overlay-composited-layer-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/composited-document-element-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/composited-document-element-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/content-into-overflow-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/content-into-overflow-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/layer-repaint-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/layer-repaint-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/layer-repaint-rects-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/layer-repaint-rects-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/newly-composited-on-scroll-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/newly-composited-on-scroll-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/opacity-between-absolute-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/opacity-between-absolute-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/opacity-between-absolute2-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/opacity-between-absolute2-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/repaint/overflow-into-content-expected.png: Added. Rebaselined.
* platform/gtk/compositing/repaint/overflow-into-content-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/rtl/rtl-iframe-absolute-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/rtl/rtl-iframe-relative-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/rtl/rtl-overflow-scrolling-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/self-painting-layers-expected.png: Added. Rebaselined.
* platform/gtk/compositing/self-painting-layers-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/shadows/shadow-drawing-expected.png: Added. Rebaselined.
* platform/gtk/compositing/shadows/shadow-drawing-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/sibling-positioning-expected.png: Added. Rebaselined.
* platform/gtk/compositing/sibling-positioning-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/text-on-large-layer-expected.png: Added. Rebaselined.
* platform/gtk/compositing/text-on-large-layer-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/tiling/huge-layer-add-remove-child-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/tiling/visiblerect-accumulated-offset-expected.png: Added. Rebaselined.
* platform/gtk/compositing/tiling/visiblerect-accumulated-offset-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/visibility/layer-visible-content-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/webgl/webgl-background-color-expected.png: Added. Rebaselined.
* platform/gtk/compositing/webgl/webgl-background-color-expected.txt: Added. Rebaselined.
* platform/gtk/compositing/webgl/webgl-nonpremultiplied-blend-expected.png: Added. Rebaselined.
* platform/gtk/compositing/webgl/webgl-nonpremultiplied-blend-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-default-value-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-default-value-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-different-image-formats-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-different-image-formats-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-gif-color-2-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-gif-color-2-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-gif-color-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-gif-color-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-image-color-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-image-color-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-image-image-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-image-image-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-single-layer-no-blending-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/background-blend-mode-single-layer-no-blending-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/blend-mode-background-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/blend-mode-background-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/blend-mode-isolation-flags-remove-non-stacking-context-blending-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/blend-mode-isolation-flags-remove-non-stacking-context-blending-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/blend-mode-isolation-flags-remove-stacking-context-blending-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/blend-mode-isolation-flags-remove-stacking-context-blending-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-blend-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-blend-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-filter-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-filter-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-mask-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-mask-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-opacity-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-opacity-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-shadow-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-layer-shadow-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-multiply-alpha-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-multiply-alpha-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-normal-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-normal-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-plus-darker-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-plus-darker-expected.txt: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-plus-lighter-expected.png: Added. Rebaselined.
* platform/gtk/css3/blending/svg-blend-plus-lighter-expected.txt: Added. Rebaselined.
* platform/gtk/fast/canvas/webgl/css-webkit-canvas-expected.png: Added. Rebaselined.
* platform/gtk/fast/canvas/webgl/css-webkit-canvas-expected.txt: Added. Rebaselined.
* platform/gtk/fast/canvas/webgl/css-webkit-canvas-repaint-expected.png: Added. Rebaselined.
* platform/gtk/fast/canvas/webgl/css-webkit-canvas-repaint-expected.txt: Added. Rebaselined.

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

2 years ago[Planet WebKit] Use HTTPS instead of HTTP for Igalia blog
rego@igalia.com [Tue, 21 Mar 2017 14:34:36 +0000 (14:34 +0000)]
[Planet WebKit] Use HTTPS instead of HTTP for Igalia blog

Unreviewed patch just updating the Igalia WebKit blog configuration.

* config.ini:

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

2 years agoUnreviewed GTK+ gardening. Remove expectations for imported/w3c/web-platform-tests...
carlosgc@webkit.org [Tue, 21 Mar 2017 14:12:09 +0000 (14:12 +0000)]
Unreviewed GTK+ gardening. Remove expectations for imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm.

It no longer works with current version of wptserve and it's already skipped globally.

* platform/gtk/TestExpectations:

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

2 years ago[ARM] Add missing MacroAssembler functions after r214187
ossy@webkit.org [Tue, 21 Mar 2017 11:42:36 +0000 (11:42 +0000)]
[ARM] Add missing MacroAssembler functions after r214187
https://bugs.webkit.org/show_bug.cgi?id=169912

Reviewed by Yusuke Suzuki.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::loadFloat):
(JSC::MacroAssemblerARM::storeFloat):

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

2 years ago[JSC] Optimize Number.prototype.toString on Int32 / Int52 / Double
utatane.tea@gmail.com [Tue, 21 Mar 2017 11:31:43 +0000 (11:31 +0000)]
[JSC] Optimize Number.prototype.toString on Int32 / Int52 / Double
https://bugs.webkit.org/show_bug.cgi?id=167454

Reviewed by Saam Barati.

JSTests:

* stress/number-to-string-abstract-operation.js: Added.
(shouldBe):
(int32ToString):
(shouldBe.int32ToString.new.Number.int52ToString):
(shouldBe.int32ToString.new.Number):
(shouldBe.doubleToString):
* stress/number-to-string-radix.js: Added.
(shouldBe):
(int32ToString):
(shouldBe.int32ToString.new.Number.int52ToString):
(shouldBe.int32ToString.new.Number):
(shouldBe.doubleToString):
* stress/number-to-string.js: Added.
(shouldBe):
(int32ToString):
(shouldBe.int32ToString.new.Number.int52ToString):
(shouldBe.int32ToString.new.Number):
(shouldBe.doubleToString):

Source/JavaScriptCore:

This patch improves Number.toString(radix) performance
by introducing NumberToStringWithRadix DFG node. It directly
calls the operation and it always returns String.

                                               baseline                  patched

    stanford-crypto-sha256-iterative        45.130+-0.928             44.032+-1.184           might be 1.0250x faster

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

2 years ago[JSC] Add JSPromiseDeferred::reject(ExecState*, Exception*) interface
utatane.tea@gmail.com [Tue, 21 Mar 2017 11:16:47 +0000 (11:16 +0000)]
[JSC] Add JSPromiseDeferred::reject(ExecState*, Exception*) interface
https://bugs.webkit.org/show_bug.cgi?id=169908

Reviewed by Sam Weinig.

To avoid calling reject(ExecState*, JSValue) with Exception* accidentally,
we add a new interface reject(ExecState*, Exception*).
Such an interface is already added in DOMPromise in WebCore.

* runtime/JSInternalPromiseDeferred.cpp:
(JSC::JSInternalPromiseDeferred::reject):
* runtime/JSInternalPromiseDeferred.h:
* runtime/JSPromiseDeferred.cpp:
(JSC::JSPromiseDeferred::reject):
* runtime/JSPromiseDeferred.h:

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

2 years agoUnreviewed GTK+ gardening. Remove duplicated entry.
carlosgc@webkit.org [Tue, 21 Mar 2017 09:43:14 +0000 (09:43 +0000)]
Unreviewed GTK+ gardening. Remove duplicated entry.

* platform/gtk/TestExpectations:

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

2 years agoUnreviewed GTK+ gardening. Mark more tests that are failing.
carlosgc@webkit.org [Tue, 21 Mar 2017 09:12:45 +0000 (09:12 +0000)]
Unreviewed GTK+ gardening. Mark more tests that are failing.

* platform/gtk/TestExpectations:

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

2 years ago[GTK] Add function webkit_dom_element_get_bounding_client_rect
commit-queue@webkit.org [Tue, 21 Mar 2017 09:11:05 +0000 (09:11 +0000)]
[GTK] Add function webkit_dom_element_get_bounding_client_rect
https://bugs.webkit.org/show_bug.cgi?id=163892

Patch by Aidan Holm <aidanholm+webkit@gmail.com> on 2017-03-21
Reviewed by Carlos Garcia Campos.

Wrap WebCore::ClientRect as WebKitDOMClientRect.
Wrap WebCore::ClientRectList as WebKitDOMClientRectList.
Implement webkit_dom_element_get_bounding_client_rect().
Implement webkit_dom_element_get_client_rects().

* PlatformGTK.cmake:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: Added.
(WebKit::kit):
(WebKit::core):
(WebKit::wrapClientRect):
(webkit_dom_client_rect_finalize):
(webkit_dom_client_rect_get_property):
(webkit_dom_client_rect_constructed):
(webkit_dom_client_rect_class_init):
(webkit_dom_client_rect_init):
(webkit_dom_client_rect_get_top):
(webkit_dom_client_rect_get_right):
(webkit_dom_client_rect_get_bottom):
(webkit_dom_client_rect_get_left):
(webkit_dom_client_rect_get_width):
(webkit_dom_client_rect_get_height):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_get_property):
(webkit_dom_element_class_init):
(webkit_dom_element_get_scroll_height):
(webkit_dom_element_get_bounding_client_rect):
(webkit_dom_element_get_client_rects):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h:

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

2 years agoUnreviewed GTK+ gardening. Mark several tests as failing and skip others.
carlosgc@webkit.org [Tue, 21 Mar 2017 08:59:27 +0000 (08:59 +0000)]
Unreviewed GTK+ gardening. Mark several tests as failing and skip others.

* platform/gtk/TestExpectations:

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

2 years ago[jsc] MacroAssemblerMIPS: implement the branchPtr(RelationalCondition, BaseIndex...
commit-queue@webkit.org [Tue, 21 Mar 2017 08:34:50 +0000 (08:34 +0000)]
[jsc] MacroAssemblerMIPS: implement the branchPtr(RelationalCondition, BaseIndex, RegisterID) overload.
https://bugs.webkit.org/show_bug.cgi?id=169717

Patch by Zan Dobersek <zdobersek@igalia.com> on 2017-03-21
Reviewed by Yusuke Suzuki.

* assembler/MacroAssembler.h: Expose branchPtr() on MIPS as well.
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchPtr): Added.

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

2 years agoClean up RTCSdpType, RTC enums and headers
jonlee@apple.com [Tue, 21 Mar 2017 07:50:04 +0000 (07:50 +0000)]
Clean up RTCSdpType, RTC enums and headers
https://bugs.webkit.org/show_bug.cgi?id=169741

Reviewed by Youenn Fablet.

Convert to RTCSdpType.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/MediaEndpointSessionDescription.cpp:
* Modules/mediastream/MediaEndpointSessionDescription.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

Convert SDP argument to lvalue.
* Modules/mediastream/RTCSessionDescription.cpp:
* Modules/mediastream/RTCSessionDescription.h:
* Modules/mediastream/RTCSessionDescription.idl:

Keep RTC enum IDLs above platform. Move the C++ enum headers into platform.
* Modules/mediastream/RTCEnums.h: Removed.
* Modules/mediastream/RTCIceConnectionState.h: Removed.
* Modules/mediastream/RTCIceGatheringState.h: Removed.
* Modules/mediastream/RTCIceTransportState.h: Removed.
* Modules/mediastream/RTCSignalingState.h: Removed.
* platform/mediastream/PeerConnectionStates.h: Remove from .xcodeproj. Move enums to separate headers.
* platform/mediastream/RTCBundlePolicy.h:
* platform/mediastream/RTCIceConnectionState.h:
* platform/mediastream/RTCIceGatheringState.h:
* platform/mediastream/RTCIceTransportPolicy.h:
* platform/mediastream/RTCIceTransportState.h:
* platform/mediastream/RTCRtpTransceiverDirection.h: Renamed from Source/WebCore/Modules/mediastream/RTCRtpTransceiverDirection.h.
* platform/mediastream/RTCSdpType.h:
* platform/mediastream/RTCSignalingState.h:

Move RtpTransceiverDirection out to a separate IDL.
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpTransceiver.cpp:
* Modules/mediastream/RTCRtpTransceiver.h:
* WebCore.xcodeproj/project.pbxproj:

Replace RTCEnums include with specific headers per enum.
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCIceTransport.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::completeAddTransceiver): Remove unneeded static_cast.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.h:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaEndpointConfiguration.h:
* platform/mock/MockMediaEndpoint.h:

Clean up license.
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

Modernize header to use #pragma once.
* platform/mediastream/RTCDTMFSenderHandler.h:
* platform/mediastream/RTCDTMFSenderHandlerClient.h:
* platform/mediastream/RTCIceCandidateDescriptor.h:
* platform/mediastream/RTCPeerConnectionHandlerClient.h:
* platform/mediastream/RTCSessionDescriptionDescriptor.h:
* platform/mediastream/RTCSessionDescriptionRequest.h:
* platform/mediastream/RTCVoidRequest.h:
* platform/mock/RTCNotifiersMock.h:

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

2 years agoUpdate progression in wpt test for WebRTC.
jonlee@apple.com [Tue, 21 Mar 2017 06:07:14 +0000 (06:07 +0000)]
Update progression in wpt test for WebRTC.

* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:

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

2 years agoWeb Inspector: RTL: minor layout issues in Breakpoint Editor popover
webkit@devinrousso.com [Tue, 21 Mar 2017 03:27:48 +0000 (03:27 +0000)]
Web Inspector: RTL: minor layout issues in Breakpoint Editor popover
https://bugs.webkit.org/show_bug.cgi?id=169765

Reviewed by Brian Burg.

* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
Fix typo.

* UserInterface/Views/BreakpointActionView.css:
(body[dir=ltr] .breakpoint-action-button-container):
(body[dir=rtl] .breakpoint-action-button-container):
(:matches(.breakpoint-action-append-button, .breakpoint-action-remove-button)):
(body[dir=ltr] :matches(.breakpoint-action-append-button, .breakpoint-action-remove-button)):
(body[dir=rtl] :matches(.breakpoint-action-append-button, .breakpoint-action-remove-button)):
(.breakpoint-action-block-body > .description):
(body[dir=ltr] .breakpoint-action-block-body > .description):
(body[dir=rtl] .breakpoint-action-block-body > .description):
(.breakpoint-action-block-body > input):
(.breakpoint-action-button-container): Deleted.
(.breakpoint-action-append-button, .breakpoint-action-remove-button): Deleted.

* UserInterface/Views/BreakpointActionView.js:
(WebInspector.BreakpointActionView.prototype._updateBody):
Manually apply `dir="ltr"` to the description element to force proper rendering.

* UserInterface/Views/BreakpointPopoverController.css:
(.popover .edit-breakpoint-popover-content):
(.popover .edit-breakpoint-popover-content > table > tr > th):
(#edit-breakpoint-popover-ignore):
(body[dir=ltr] :matches(#edit-breakpoint-popover-ignore, #edit-breakpoint-popover-auto-continue)):
(body[dir=rtl] :matches(#edit-breakpoint-popover-ignore, #edit-breakpoint-popover-auto-continue)):
(#edit-breakpoint-popoover-auto-continue): Deleted.

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

2 years agoAdd iceCandidatePoolSize to RTCConfiguration
jonlee@apple.com [Tue, 21 Mar 2017 03:16:57 +0000 (03:16 +0000)]
Add iceCandidatePoolSize to RTCConfiguration
https://bugs.webkit.org/show_bug.cgi?id=169866

Reviewed by Youenn Fablet.

Source/WebCore:

Test: webrtc/rtcconfiguration-icecandidatepoolsize.html

* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCConfiguration.idl: Add iceCandidatePoolSize.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration): Set the size in libwebrtc.
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:

LayoutTests:

* webrtc/rtcconfiguration-icecandidatepoolsize-expected.txt: Added.
* webrtc/rtcconfiguration-icecandidatepoolsize.html: Added.

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

2 years agoWeb Inspector: Icon next to "An error occurred..." message changes size when Inspecto...
nvasilyev@apple.com [Tue, 21 Mar 2017 02:55:36 +0000 (02:55 +0000)]
Web Inspector: Icon next to "An error occurred..." message changes size when Inspector window is resized
https://bugs.webkit.org/show_bug.cgi?id=169901

Reviewed by Brian Burg.

* UserInterface/Views/Main.css:
(.message-text-view.error::before):

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

2 years agoFollow-up on comments for bug 169664
jonlee@apple.com [Tue, 21 Mar 2017 02:51:00 +0000 (02:51 +0000)]
Follow-up on comments for bug 169664
https://bugs.webkit.org/show_bug.cgi?id=169709

Reviewed by Youenn Fablet.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::deriveAggregatedIceConnectionState): Update deriveAggregatedIceConnectionState.
(WebCore::MediaEndpointPeerConnection::iceTransportStateChanged): Set a capacity and used
uncheckedAppend.

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

2 years agoDelete another function that was supposed to be removed in the previous commit.
rniwa@webkit.org [Tue, 21 Mar 2017 02:15:59 +0000 (02:15 +0000)]
Delete another function that was supposed to be removed in the previous commit.

* public/v3/models/build-request.js:
(BuildRequest.cachedRequestsForTriggerableID): Deleted.

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

2 years agoModernize BuildRequestQueuePage
rniwa@webkit.org [Tue, 21 Mar 2017 02:13:00 +0000 (02:13 +0000)]
Modernize BuildRequestQueuePage
https://bugs.webkit.org/show_bug.cgi?id=169903

Reviewed by Antti Koivisto.

Modernized the code for /v3/#/analysis/queue.

* public/v3/models/build-request.js:
(BuildRequest.fetchTriggerables): Deleted since the manifest JSON now contains all the triggerables.

* public/v3/pages/build-request-queue-page.js:
(BuildRequestQueuePage): Deleted this._triggerables. Added this._buildRequestsByTriggerable.
(BuildRequestQueuePage.prototype.open): Modernized the code.
(BuildRequestQueuePage.prototype.render): Ditto.
(BuildRequestQueuePage.prototype._constructBuildRequestTable): Ditto.

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

2 years agoAdd a system trace point for memory warning handling
simon.fraser@apple.com [Tue, 21 Mar 2017 02:04:59 +0000 (02:04 +0000)]
Add a system trace point for memory warning handling
https://bugs.webkit.org/show_bug.cgi?id=169893

Reviewed by Zalan Bujtas.

Source/WebCore:

Add a TraceScope for low memory handling, which logs 'critical' and 'synchronous'.

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

Source/WTF:

Make it possible to pass data to the Begin trace point.

* wtf/SystemTracing.h:
(WTF::TraceScope::TraceScope):

Tools:

Describe the new trace points.

* Tracing/SystemTracePoints.plist:

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

2 years agoOptimize packing of Document and superclass data members
simon.fraser@apple.com [Tue, 21 Mar 2017 02:04:55 +0000 (02:04 +0000)]
Optimize packing of Document and superclass data members
https://bugs.webkit.org/show_bug.cgi?id=169880

Reviewed by Antti Koivisto.

Move data members around to optimize packing in SecurityContext, SuspendableTimer and Document.
This saves as few hundred bytes on Document.

Padding detected via Tools/Scripts/dump-class-layout

* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::SecurityContext):
* dom/SecurityContext.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::SuspendableTimer):
* page/SuspendableTimer.h:

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

2 years agoCharts page show an inconsistent list of revisions for Git and Subversion
rniwa@webkit.org [Tue, 21 Mar 2017 01:19:39 +0000 (01:19 +0000)]
Charts page show an inconsistent list of revisions for Git and Subversion
https://bugs.webkit.org/show_bug.cgi?id=169888

Reviewed by Andreas Kling.

With Git, CommitLogViewer was showing the list of revisions including the starting hash,
which was the last data point's revision instead of all revisions after the last data point.

Fixed the bug by always specifying the revision at the last data point in both Subversion
and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision.
For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and
"lastRevision" respectively.

We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g.
when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250"
instead of "r1235-r1250".

* browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer
specifies from/to revisions.
* browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer.
* browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css.

* public/api/commits.php:
(main): Renamed "from" and "to" query parameters.

* public/include/commit-log-fetcher.php:
(CommitLogFetcher::fetch_between): Added a check that commit time should either be specified
in both rows or not specified in either. Also reject when before_first_revision is identical
or after last_revision instead of re-ordering them since it no longer makes sense to do so with
new query parameter names.

* public/v3/components/base.js:
(ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient
againt realm (global object) differences.

* public/v3/components/chart-pane-base.js:
(ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since
CommitLogViewer does that on its own now.
(ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer
to remember which repository is current. This was the only use of currentRepository.

* public/v3/components/commit-log-viewer.js:
(CommitLogViewer):
(CommitLogViewer.prototype.currentRepository): Deleted.
(CommitLogViewer.prototype.view):
(CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy.
Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision
since the generic JSON API no longer supports being called with the identical revisions.
(CommitLogViewer.prototype.render): Modernized & simplified the code.
(CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy.
(CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable.
(CommitLogViewer.cssTemplate):

* public/v3/models/commit-log.js:
(CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding
1 to a Subversion-like starting revision for creating the label. See above. But we still do this
for forming URLs due to the way tools like Trac work with Subversion revisions.
(CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for
what this function is supposed to be doing.
(CommitLog._cachedCommitLogs): Deleted.
(CommitLog.fetchForSingleRevision): Added.
(CommitLog._constructFromRawData): Added.

* public/v3/models/data-model.js:
(DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them.

* public/v3/remote.js:
(BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo.

* server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to
use new query parameters and added more test cases.

* unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer
includes from/to values. They're computed in ChartRevisionRange instead.

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

2 years agoWebPageProxy DecidePolicyForNavigationAction and DecidePolicyForResponseSync should...
achristensen@apple.com [Tue, 21 Mar 2017 01:13:50 +0000 (01:13 +0000)]
WebPageProxy DecidePolicyForNavigationAction and DecidePolicyForResponseSync should be Delayed reply messages
https://bugs.webkit.org/show_bug.cgi?id=167183
<rdar://problem/30203539>

Reviewed by Andy Estes.

Source/WebKit2:

Before this patch, the WKNavigationDelegate's decidePolicyForNavigationAction must synchronously call the decisionHandler.
If it stores the decisionHandler and calls it after decidePolicyForNavigationAction returns, we can get incorrect behavior.
This can be seen when the _WKWebsitePolicies given to the decisionHandler had no effect.
Now, we will have the WebProcess waiting on the UIProcess to respond to the Delayed reply before continuing.
This will not be a regression because currently everybody is either calling the decisionHandler immediately or getting incorrect behavior,
and the behavior will be the same if the decisionHandler is called immediately. It is possible that we could make the WebProcess
not wait on the response, but we would need to make WebCore's loading truly asynchronous first
(getting rid of ResourceHandleClient's synchronous methods).

Covered by making an API test asynchronously call the decisionHandler.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponseSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(-[WebsitePoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):

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

2 years agoWeb Inspector: Clicking on Clear Network Items icon throws an exception if timing...
nvasilyev@apple.com [Tue, 21 Mar 2017 01:01:22 +0000 (01:01 +0000)]
Web Inspector: Clicking on Clear Network Items icon throws an exception if timing popover is visible
https://bugs.webkit.org/show_bug.cgi?id=169852
<rdar://problem/31132652>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar):
(WebInspector.ResourceTimelineDataGridNode):

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

2 years agoREGRESSION (r187873): Web Inspector: When resizing, prevent DataGrid columns from...
nvasilyev@apple.com [Tue, 21 Mar 2017 00:46:11 +0000 (00:46 +0000)]
REGRESSION (r187873): Web Inspector: When resizing, prevent DataGrid columns from collapsing entirely
https://bugs.webkit.org/show_bug.cgi?id=169899

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype.resizerDragging):
leftMinimum and rightMaximum variables were always NaN because this.ColumnResizePadding is undefined.

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

2 years agoFix GTK build after r214190
achristensen@apple.com [Tue, 21 Mar 2017 00:19:53 +0000 (00:19 +0000)]
Fix GTK build after r214190
https://bugs.webkit.org/show_bug.cgi?id=169885

* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
(WebKit::WebSocketServerConnection::sendWebSocketMessage):
(WebKit::WebSocketServerConnection::sendHTTPResponseHeader):
(WebKit::WebSocketServerConnection::sendRawData):
Finish renaming send to sendData.

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

2 years agoWeb Inspector: Pseudo-class markers overlap DOM breakpoints and disclosure triangle
mattbaker@apple.com [Tue, 21 Mar 2017 00:14:38 +0000 (00:14 +0000)]
Web Inspector: Pseudo-class markers overlap DOM breakpoints and disclosure triangle
https://bugs.webkit.org/show_bug.cgi?id=169850
<rdar://problem/31132335>

Reviewed by Joseph Pecoraro.

DOMTreeContentView should always have at least 7px of gutter space to
accomodate pseudo-class markers. When DOM breakpoints are visible the
gutter size is increased so breakpoints and markers do not overlap.

* UserInterface/Views/DOMTreeContentView.css:
(.content-view.dom-tree .tree-outline.dom):
(.content-view.dom-tree.show-gutter .tree-outline.dom):
(body[dir=ltr] .content-view.dom-tree .tree-outline.dom):
(body[dir=rtl] .content-view.dom-tree .tree-outline.dom):
(body[dir=ltr] .content-view.dom-tree.show-gutter .tree-outline.dom): Deleted.
(body[dir=rtl] .content-view.dom-tree.show-gutter .tree-outline.dom): Deleted.

* UserInterface/Views/DOMTreeOutline.css:
(.content-view.dom-tree.show-gutter .tree-outline.dom):
Change pseudo-class marker indent when showing DOM breakpoint gutter.
(body[dir=ltr] .tree-outline.dom li.pseudo-class-enabled > .selection-area::before):
Drive-by fix: copy paste error.

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

2 years agoSuspend media playback in background tabs
cdumez@apple.com [Mon, 20 Mar 2017 23:47:35 +0000 (23:47 +0000)]
Suspend media playback in background tabs
https://bugs.webkit.org/show_bug.cgi?id=169883
<rdar://problem/28056151>

Reviewed by Eric Carlson.

Source/WebCore:

Suspend media playback in background tabs to save battery
except in cases where we cannot (e.g. PiP, AirPlay).

Test: media/media-playback-page-visibility.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::visibilityStateChanged):
When page visibility state changes, begin / end media session
interruption with reason PlatformMediaSession::EnteringBackground.
This reason was already used on iOS when the application enters
or exist background. HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction()
takes care of preventing interruption in case of AirPlay or PiP.

LayoutTests:

Add layout test coverage.

* media/media-playback-page-visibility-expected.txt: Added.
* media/media-playback-page-visibility.html: Added.

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

2 years agoPrevent new navigations from onbeforeunload handler
dbates@webkit.org [Mon, 20 Mar 2017 23:07:50 +0000 (23:07 +0000)]
Prevent new navigations from onbeforeunload handler
https://bugs.webkit.org/show_bug.cgi?id=169891
<rdar://problem/31155736>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Ensure that all navigations initiated from an onbeforeunload handler are disallowed
regardless of how they were scheduled. Such navigations go against the expectation
of a user.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isNavigationAllowed): Added.
(WebCore::FrameLoader::loadURL): Modified code to call FrameLoader::isNavigationAllowed().
(WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
(WebCore::FrameLoader::stopAllLoaders): Ditto.
* loader/FrameLoader.h:

LayoutTests:

Update test to ensure that we disallow navigation initiated via a DOM click event from
an onbeforeunload handler.

* fast/events/before-unload-forbidden-navigation.html:

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

2 years agoFix os-build-fetcher.js and subprocess.js to make them work
rniwa@webkit.org [Mon, 20 Mar 2017 22:36:40 +0000 (22:36 +0000)]
Fix os-build-fetcher.js and subprocess.js to make them work
https://bugs.webkit.org/show_bug.cgi?id=169844

Reviewed by Antti Koivisto.

The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel.
Some commands to poll the lsit of system components is not desirable to be ran in parallel.

* server-tests/resources/mock-subprocess.js:
(MockSubprocess): Use const declaration.
(MockSubprocess.resetAndWaitForInvocation): Added.
(MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb.
See https://webkit.org/code-style-guidelines/#names-verb
(MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array
regardless of whether reset is called or when it's called.

* server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now
expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting
them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve,
its subcommand to run, and then move onto the second top-level command. Also use a local reference
to MockSubprocess.invocations instead of using the fully qualified name.

* tools/js/os-build-fetcher.js:
(mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array
in serial (not asynchronous) is a very common pattern in this class.
(OSBuildFetcher.fetchAndReportAllInOrder): Added.
(OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted.
(OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result
in each top-level command to be execued in parallel. Since each subcommand is executed as soon as
its parent command is executed, this results in commands to be executed in parallel.
Added a whole bunch of logging so that we can at least detect a bug like this in the future.
(OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style.
(OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion
about the content returned by a subcommand.

* tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess.
execFile is defined on require('child_process') itself.
(Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist.
(Subprocess):

* tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js.
(syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep.

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

2 years agowebkitpy: Work around simctl launch returning dead processes
jbedard@apple.com [Mon, 20 Mar 2017 21:33:58 +0000 (21:33 +0000)]
webkitpy: Work around simctl launch returning dead processes
https://bugs.webkit.org/show_bug.cgi?id=169878

Reviewed by Daniel Bates.

simctl launch will sometimes give the PID of a process which has just been terminated.
To work around this, we will always check if the returned PID is of a process which is
still running.

* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess.Popen.__init__): Accept device argument.
(SimulatorProcess.Popen.poll): Call device.poll().
(SimulatorProcess._start): Pass device into Popen object.
* Scripts/webkitpy/xcode/device.py:
(Device.poll): Added.
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.install_app): Change attempts to timeout.
(SimulatedDevice.launch_app): Check that the process being returned is active, use a
timeout instead of attempts.
(SimulatedDevice):
(SimulatedDevice.poll): Added.

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

2 years agoPrepare SocketStreamHandle for being created from WK2
achristensen@apple.com [Mon, 20 Mar 2017 20:05:50 +0000 (20:05 +0000)]
Prepare SocketStreamHandle for being created from WK2
https://bugs.webkit.org/show_bug.cgi?id=169885

Reviewed by Andy Estes.

No change in behavior.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::sendFrame):
Rename send to sendData to prevent name collisions with IPC::MessageSender::send.
* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::sendData):
(WebCore::SocketStreamHandle::send): Deleted.
* platform/network/SocketStreamHandle.h:
* platform/network/cf/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImpl.h:
Make platformSend and platformClose public so I can call them from IPC proxies.

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

2 years ago[QuickLook] Subresources should be in the same origin as the main document
aestes@apple.com [Mon, 20 Mar 2017 19:50:09 +0000 (19:50 +0000)]
[QuickLook] Subresources should be in the same origin as the main document
https://bugs.webkit.org/show_bug.cgi?id=169868
<rdar://problem/29898214>

Reviewed by Daniel Bates.

Source/WebCore:

Prior to this change, QuickLook documents were placed in a unique origin, which meant all
subresources were loaded as cross-origin requests. This prevented XMLHttpRequests to the
QuickLook custom protocol, since cross-origin XHRs must be made to a protocol that
understands CORS.

Instead of a unique origin, we now create an origin for QuickLook documents from the preview
response URL (an x-apple-ql-id: URL), which will allow QuickLook to make same-origin XHRs by
using a URL with the same scheme and host as the preview response URL.

Test: http/tests/quicklook/same-origin-xmlhttprequest-allowed.html

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

LayoutTests:

* http/tests/quicklook/resources/same-origin-xmlhttprequest-allowed.rtf: Added.
* http/tests/quicklook/resources/tap-run-test-hyperlink.js:
(runTest):
* http/tests/quicklook/same-origin-xmlhttprequest-allowed-expected.txt: Added.
* http/tests/quicklook/same-origin-xmlhttprequest-allowed.html: Added.

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

2 years agowindow.crypto.getRandomValues() uses the insecure RC4 RNG
jiewen_tan@apple.com [Mon, 20 Mar 2017 19:46:45 +0000 (19:46 +0000)]
window.crypto.getRandomValues() uses the insecure RC4 RNG
https://bugs.webkit.org/show_bug.cgi?id=169623
<rdar://problem/31044229>

Reviewed by Brent Fulgham.

This patch replaces the RC4 RNG with one based on AES-CTR.

No change of behavior.

* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues):

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

2 years agoGraph coloring should use coalescable moves when spilling
fpizlo@apple.com [Mon, 20 Mar 2017 18:58:59 +0000 (18:58 +0000)]
Graph coloring should use coalescable moves when spilling
https://bugs.webkit.org/show_bug.cgi?id=169820

Reviewed by Michael Saboff.

This makes our graph coloring register allocator use a new family of move instructions when
spilling both operands of the move. It's a three-operand move:

    Move (src), (dst), %scratch

Previously, if both operands got spilled, we would emit a new instruction to load or store that
spill slot. But this made it hard for allocateStack to see that the two spill locations are
coalescable. This new kind of instruction makes it obvious that it's a coalescable move.

This change implements the coalescing of spill slots inside allocateStack.

This is an outrageous speed-up on the tsf_ir_speed benchmark from http://filpizlo.com/tsf/. This
is an interesting benchmark because it has a super ugly interpreter loop with ~20 live variables
carried around the loop back edge. This change makes that interpreter run 5x faster.

This isn't a speed-up on any other benchmarks. It also doesn't regress anything. Compile time is
neither progressed or regressed, since the coalescing is super cheap, and this does not add any
significant new machinery to the register allocator (it's just a small change to spill codegen).
Overall on our wasm benchmarks, this is a 16% throughput progression.

* assembler/MacroAssembler.h:
(JSC::MacroAssembler::move):
(JSC::MacroAssembler::move32):
(JSC::MacroAssembler::moveFloat):
(JSC::MacroAssembler::moveDouble):
* b3/air/AirAllocateRegistersByGraphColoring.cpp:
(JSC::B3::Air::allocateRegistersByGraphColoring):
* b3/air/AirAllocateStack.cpp:
(JSC::B3::Air::allocateStack):
* b3/air/AirInst.cpp:
(JSC::B3::Air::Inst::hasEarlyDef):
(JSC::B3::Air::Inst::hasLateUseOrDef):
(JSC::B3::Air::Inst::needsPadding):
* b3/air/AirInst.h:
* b3/air/AirOpcode.opcodes:
* b3/air/AirPadInterference.cpp:
(JSC::B3::Air::padInterference):
* runtime/Options.h:

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

2 years agoFix a paste-o in WebPaymentCoordinatorProxy::platformCompletePaymentSession
andersca@apple.com [Mon, 20 Mar 2017 18:30:19 +0000 (18:30 +0000)]
Fix a paste-o in WebPaymentCoordinatorProxy::platformCompletePaymentSession
https://bugs.webkit.org/show_bug.cgi?id=169881
rdar://problem/31030944

Reviewed by Dan Bernstein.

Don't always pass PKPaymentAuthorizationStatusFailure to the completion handler.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):

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

2 years ago[MediaStream] Respect constraints passed to getUserMedia
eric.carlson@apple.com [Mon, 20 Mar 2017 17:55:20 +0000 (17:55 +0000)]
[MediaStream] Respect constraints passed to getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=169870
<rdar://problem/31138936>

Reviewed by Youenn Fablet and Jer Noble.
Source/WebCore:

Remember the fitness score calculated when evaluating constraints passed to getUserMedia, so
the best device is chosen when more than one device supports the constraints. Register two
mock video and two mock audio devices with different capabilities so these changes can
be tested.

No new tests, existing tests updated.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::selectSettings): Store fitness score in m_fitnessScore.
* platform/mediastream/RealtimeMediaSource.h:

* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSource::create): Don't assume sampleRate is 44.1K
(WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers): Use sampleRate() instead of m_sampleRate.
(WebCore::MockRealtimeAudioSourceMac::reconfigure): Ditto.
(WebCore::MockRealtimeAudioSourceMac::render): Ditto.
(WebCore::MockRealtimeAudioSourceMac::applySampleRate): Ditto.

* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::updateSettings): Don't assume sampleRate is 44.1K
(WebCore::MockRealtimeAudioSource::initializeCapabilities): Support a range of sample rates.
(WebCore::MockRealtimeAudioSource::startProducingData): Initialize sampleRate if it hasn't
already been set.

* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::audioDevices): Return an array of devices.
(WebCore::MockRealtimeMediaSource::videoDevices): Ditto.
(WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
(WebCore::MockRealtimeMediaSource::mockAudioSourcePersistentID): Deleted.
(WebCore::MockRealtimeMediaSource::mockVideoSourcePersistentID): Deleted.
(WebCore::MockRealtimeMediaSource::mockAudioSourceName): Deleted.
(WebCore::MockRealtimeMediaSource::mockVideoSourceName): Deleted.
(WebCore::MockRealtimeMediaSource::audioDeviceInfo): Deleted.
(WebCore::MockRealtimeMediaSource::videoDeviceInfo): Deleted.
* platform/mock/MockRealtimeMediaSource.h:

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
(WebCore::MockRealtimeMediaSourceCenter::getMediaStreamDevices):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):

LayoutTests:

* fast/mediastream/MediaDevices-enumerateDevices-expected.txt:
* fast/mediastream/MediaDevices-getUserMedia-expected.txt:
* fast/mediastream/MediaDevices-getUserMedia.html:
* fast/mediastream/MediaStream-video-element-expected.txt:
* fast/mediastream/MediaStreamTrack-getCapabilities-expected.txt:

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

2 years ago[Xcode] Incremental builds of WebKitLegacy are slow because of the Postprocess Header...
mitz@apple.com [Mon, 20 Mar 2017 17:51:45 +0000 (17:51 +0000)]
[Xcode] Incremental builds of WebKitLegacy are slow because of the Postprocess Headers phase
https://bugs.webkit.org/show_bug.cgi?id=169861

Reviewed by Sam Weinig.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj: Specified that the Postprocess Headers script build
  phase has the Headers and PrivateHeaders directories as its inputs and a timestamp file as
  its output.

Source/WebKit/mac:

* MigrateHeaders.make: Touch the PrivateHeaders directory when migrating a header into it.
* postprocess-headers.sh: Preserve the timestamp on the headers directories. Write out the
  timestamp file used by the Xcode project to determine whether to run the script.

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

2 years agoVersioning.
jmarcell@apple.com [Mon, 20 Mar 2017 17:49:36 +0000 (17:49 +0000)]
Versioning.

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

2 years agoTextIndicator should support a mode where selection rects are used to size the snapshot
wenson_hsieh@apple.com [Mon, 20 Mar 2017 17:32:48 +0000 (17:32 +0000)]
TextIndicator should support a mode where selection rects are used to size the snapshot
https://bugs.webkit.org/show_bug.cgi?id=169845
<rdar://problem/31127818>

Reviewed by Beth Dakin.

Source/WebCore:

Adds TextIndicator support in iOS for using the would-be selection rects of a given range to determine
snapshotting bounds. See below changes for more details.

* dom/Range.cpp:
(WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines):
(WebCore::Range::collectSelectionRects):

Mark these helper methods as const.

* dom/Range.h:
* page/TextIndicator.cpp:
(WebCore::getSelectionRectsForRange):
(WebCore::initializeIndicator):

If TextIndicatorOptionUseSelectionRectForSizing is enabled, then compute selection rects and set the text rects
to be the resulting selection rects. These are in document coordinates.

* page/TextIndicator.h:

Source/WebKit2:

Adopt the new TextIndicatorOptionUseSelectionRectForSizing flag when generating an edit data interaction snapshot.

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

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

2 years agoMove code out of renderer destructors into willBeDestroyed()
simon.fraser@apple.com [Mon, 20 Mar 2017 17:28:55 +0000 (17:28 +0000)]
Move code out of renderer destructors into willBeDestroyed()
https://bugs.webkit.org/show_bug.cgi?id=169650

Reviewed by Antti Koivisto.

This is done for four reasons. First, code in willBeDestroyed() is able to call
virtual functions on derived classes. Second, this code will run before we've destroyed
the renderer's rareData, so can safely access it. Third, RenderWidget is special, and can have
its lifetime extended via manual ref-counting, and we want all cleanup to complete
before it goes into this weird zombie state. Fourth, in a shiny future where we have
ref-counted RenderObjects, we want cleanup code to be run explicitly and not tied
to object lifetime, and this is a step in that direction.

For all classes that derive from RenderObject, move code from the destructor into
willBeDestroyed(). New willBeDestroyed() implementations must call the base class.

RenderBlock and RenderBlockFlow are special; RenderBlockFlow::willBeDestroyed()
skips over RenderBlock::willBeDestroyed(), but they both need to run some code, which
I moved into RenderBlock::blockWillBeDestroyed().

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::~RenderBlock):
(WebCore::RenderBlock::willBeDestroyed):
(WebCore::RenderBlock::blockWillBeDestroyed):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::~RenderBlockFlow):
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::~RenderBox):
(WebCore::RenderBox::willBeDestroyed):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::~RenderBoxModelObject):
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::~RenderCounter):
(WebCore::RenderCounter::willBeDestroyed):
* rendering/RenderCounter.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement):
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::~RenderEmbeddedObject):
(WebCore::RenderEmbeddedObject::willBeDestroyed):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::~RenderImage):
(WebCore::RenderImage::willBeDestroyed):
* rendering/RenderImage.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::~RenderLayerModelObject):
(WebCore::RenderLayerModelObject::willBeDestroyed):
* rendering/RenderLayerModelObject.h:
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::~RenderLineBreak):
(WebCore::RenderLineBreak::willBeDestroyed):
* rendering/RenderLineBreak.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::~RenderListBox):
(WebCore::RenderListBox::willBeDestroyed):
* rendering/RenderListBox.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::~RenderListItem):
(WebCore::RenderListItem::willBeDestroyed):
* rendering/RenderListItem.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::~RenderListMarker):
(WebCore::RenderListMarker::willBeDestroyed):
* rendering/RenderListMarker.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::~RenderMenuList):
(WebCore::RenderMenuList::willBeDestroyed):
* rendering/RenderMenuList.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::~RenderNamedFlowThread):
(WebCore::RenderNamedFlowThread::willBeDestroyed):
* rendering/RenderNamedFlowThread.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::~RenderQuote):
(WebCore::RenderQuote::willBeDestroyed):
* rendering/RenderQuote.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::~RenderSearchField):
(WebCore::RenderSearchField::willBeDestroyed):
* rendering/RenderSearchField.h:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::~RenderSnapshottedPlugIn):
(WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
* rendering/RenderSnapshottedPlugIn.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::~RenderText):
(WebCore::RenderText::willBeDestroyed):
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::~RenderTextControlMultiLine):
(WebCore::RenderTextControlMultiLine::willBeDestroyed):
* rendering/RenderTextControlMultiLine.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::~RenderVideo):
(WebCore::RenderVideo::willBeDestroyed):
* rendering/RenderVideo.h:
* rendering/RenderWidget.h:
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::~RenderSVGImage):
(WebCore::RenderSVGImage::willBeDestroyed):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::~RenderSVGResourceContainer):
(WebCore::RenderSVGResourceContainer::willBeDestroyed):

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

2 years agobuildbot: run-webkit-tests should display test failures and run exceptions differently
jbedard@apple.com [Mon, 20 Mar 2017 17:11:02 +0000 (17:11 +0000)]
buildbot: run-webkit-tests should display test failures and run exceptions differently
https://bugs.webkit.org/show_bug.cgi?id=169793
<rdar://problem/30987863>

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunWebKitTests.evaluateCommand): Return EXCEPTION when run-webkit-tests returns with a code of 254.

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

2 years agoMark imported/w3c/web-platform-tests/XMLHttpRequest/timeout-multiple-fetches.html...
ryanhaddad@apple.com [Mon, 20 Mar 2017 16:46:23 +0000 (16:46 +0000)]
Mark imported/w3c/web-platform-tests/XMLHttpRequest/timeout-multiple-fetches.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169637

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark differences in media stream implementation
jonlee@apple.com [Mon, 20 Mar 2017 15:40:57 +0000 (15:40 +0000)]
Mark differences in media stream implementation
https://bugs.webkit.org/show_bug.cgi?id=169873

Reviewed by Eric Carlson.

Rearrange IDL and add comments based on 05 February 2017 Editor's Draft of Media
Capture and Streams spec.
* Modules/mediastream/DOMURLMediaStream.idl:
* Modules/mediastream/MediaDeviceInfo.idl:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/MediaStream.idl:
* Modules/mediastream/MediaStreamEvent.idl:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/MediaStreamTrackEvent.idl:
* Modules/mediastream/MediaTrackConstraints.idl:
* Modules/mediastream/MediaTrackSupportedConstraints.idl:
* Modules/mediastream/NavigatorMediaDevices.idl:
* Modules/mediastream/NavigatorUserMedia.idl:

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

2 years agoUse CopyFontDescriptorWithStrokeForStyle to get correct stroke width for captions.
pvollan@apple.com [Mon, 20 Mar 2017 12:02:50 +0000 (12:02 +0000)]
Use CopyFontDescriptorWithStrokeForStyle to get correct stroke width for captions.
https://bugs.webkit.org/show_bug.cgi?id=169674

Reviewed by Eric Carlson.

Use the MediaAccessibility function MACopyFontDescriptorWithStrokeForStyle to get
correct video captions stroke width from a given font size.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired):
* html/shadow/MediaControlElements.h:
* page/CaptionUserPreferences.h:
(WebCore::CaptionUserPreferences::captionStrokeWidth):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionStrokeWidth):
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
(WebCore::CaptionUserPreferencesMediaAF::strokeWidth): Deleted.
* page/CaptionUserPreferencesMediaAF.h:
* platform/cf/MediaAccessibilitySoftLink.cpp:
* platform/cf/MediaAccessibilitySoftLink.h:

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

2 years agoUnreviewed. Add missing types to WebKitAutocleanups.
carlosgc@webkit.org [Mon, 20 Mar 2017 09:15:02 +0000 (09:15 +0000)]
Unreviewed. Add missing types to WebKitAutocleanups.

* UIProcess/API/gtk/WebKitAutocleanups.h:

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

2 years ago[Cairo] Ensure depth and stencil renderbuffers are created on GLESv2
commit-queue@webkit.org [Mon, 20 Mar 2017 08:47:22 +0000 (08:47 +0000)]
[Cairo] Ensure depth and stencil renderbuffers are created on GLESv2
https://bugs.webkit.org/show_bug.cgi?id=166643

Patch by Emanuele Aina <emanuele.aina@collabora.com> on 2017-03-20
Reviewed by Darin Adler.

If the gfx device doesn't support GL_OES_packed_depth_stencil, the
separate depth and stencil buffers are not generated.

Copy what GraphicsContext3DEfl used to do and apply it in
GraphicsContext3DCairo.

The Intel gfx driver seem to tolerate unbound renderbuffers, but
enabling debugging in Mesa yields an error:

$ MESA_DEBUG=1 \
  MESA_EXTENSION_OVERRIDE=-GL_OES_packed_depth_stencil
  ./bin/MiniBrowser http://webglsamples.org/aquarium/aquarium.html
Mesa: User error: GL_INVALID_OPERATION in glRenderbufferStorage(no renderbuffer bound)

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
Ensure separate depth and stencil renderbuffers are created.
(WebCore::GraphicsContext3D::~GraphicsContext3D):
Ensure separate depth and stencil renderbuffers are released.

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

2 years agoWebHTMLView is useless as WebResourceHandler
ap@apple.com [Mon, 20 Mar 2017 00:26:25 +0000 (00:26 +0000)]
WebHTMLView is useless as WebResourceHandler
https://bugs.webkit.org/show_bug.cgi?id=169857

Reviewed by Dan Bernstein.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
WebHTMLView doesnt implement any of WebResourceHandler methods.

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

2 years agoImplement self.origin
cdumez@apple.com [Sun, 19 Mar 2017 21:51:19 +0000 (21:51 +0000)]
Implement self.origin
https://bugs.webkit.org/show_bug.cgi?id=168023

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/self-origin.any-expected.txt:
* web-platform-tests/html/dom/self-origin.sub-expected.txt:
Rebaseline several WPT tests now that more checks are passing.

* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt: Added.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html: Added.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginSharedWorker.js: Added.
(onconnect):
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginWorker.js: Added.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/w3c-import.log: Added.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/w3c-import.log: Added.
Import test coverage for self.origin in workers.

Source/WebCore:

Implement self.origin:
- https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope

Firefox and Chrome already support this.

Test: imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::origin):
* page/DOMWindow.h:
* page/WindowOrWorkerGlobalScope.idl:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::origin):
* workers/WorkerGlobalScope.h:

LayoutTests:

* http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-maxlength.html:
* http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-no-cr.html:
* http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status.html:
* http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null.html:
Rename origin to wsOrigin in tests to avoid conflict with window.origin.

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

2 years agoWeb Inspector: REGRESSION (r212910): Active call frame status icon has incorrect...
mattbaker@apple.com [Sun, 19 Mar 2017 21:11:50 +0000 (21:11 +0000)]
Web Inspector: REGRESSION (r212910): Active call frame status icon has incorrect left margin
https://bugs.webkit.org/show_bug.cgi?id=169862

Reviewed by Brian Burg.

* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame .status):
(body[dir=ltr] .tree-outline .item.call-frame .status):
(body[dir=rtl] .tree-outline .item.call-frame .status):

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

2 years ago`const location = "foo"` throws in a worker
cdumez@apple.com [Sun, 19 Mar 2017 17:45:39 +0000 (17:45 +0000)]
`const location = "foo"` throws in a worker
https://bugs.webkit.org/show_bug.cgi?id=169839

Reviewed by Mark Lam.

JSTests:

* ChakraCore/test/es6/letconst_global_shadow_builtins_nonconfigurable.baseline-jsc:
Update expected jsc result now that we throw a SyntaxError when trying to shadow undefined
with a let variable. We used not to throw because the value is undefined but this was not
as per EcmaScript. Both Firefox and Chrome throw in this case.

* stress/global-lexical-redeclare-variable.js:
(catch):
Update test that defines a non-configurable 'zoo' property on the global object and then
expected shadowing it with a 'let zoo' variable to work because its value was undefined.
This was not as per EcmaScript spec and both Firefox and Chrome throw in this case.

Source/JavaScriptCore:

Our HasRestrictedGlobalProperty check in JSC was slightly wrong, causing us
to sometimes throw a Syntax exception when we shouldn't when declaring a
const/let variable and sometimes not throw an exception when we should have.

This aligns our behavior with ES6, Firefox and Chrome.

* runtime/ProgramExecutable.cpp:
(JSC::hasRestrictedGlobalProperty):
(JSC::ProgramExecutable::initializeGlobalProperties):
Rewrite hasRestrictedGlobalProperty logic as per the EcmaScript spec:
- http://www.ecma-international.org/ecma-262/6.0/index.html#sec-hasproperty
In particular, they were 2 issues:
- We should throw a SyntaxError if hasProperty() returned true but getOwnProperty()
  would fail to return a descriptor. This would happen for properties that are
  not OWN properties, but defined somewhere in the prototype chain. The spec does
  not say to use hasProperty(), only getOwnProperty() and says we should return
  false if getOwnProperty() does not return a descriptor. This is what we do now.
- We would fail to throw when declaring a let/const variable that shadows an own
  property whose value is undefined. This is because the previous code was
  explicitly checking for this case. I believe this was a misinterpretation of
  ES6 which says:
  """
  Let desc be O.[[GetOwnProperty]](P).
  If desc is undefined, return false.
  """
  We should check that desc is undefined, not desc.value. This is now fixed.

LayoutTests:

* fast/dom/window-const-variable-shadowing-expected.txt: Added.
* fast/dom/window-const-variable-shadowing.html: Added.
* fast/workers/const-location-variable-expected.txt: Added.
* fast/workers/const-location-variable.html: Added.
* fast/workers/resources/worker-const-location.js: Added.
Add layout test coverage for behavior changes. Those tests pass in Firefox and Chrome.

* js/dom/const-expected.txt:
* js/dom/const.html:
Update test which wrongly expected a let variable not to be able to shadow a
window named property. This test was failing in Chrome and Firefox. The reason
this does not throw is because window named properties are not on the window
object, they are on the WindowProperties object in the Window prototype chain.

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

2 years ago[Cocoa] Web Automation: non-sticky virtual keys like 'left arrow' don't work properly
bburg@apple.com [Sun, 19 Mar 2017 15:54:32 +0000 (15:54 +0000)]
[Cocoa] Web Automation: non-sticky virtual keys like 'left arrow' don't work properly
https://bugs.webkit.org/show_bug.cgi?id=169733
<rdar://problem/30162608>

Reviewed by Joseph Pecoraro.

There were several issues that caused certain virtual keys to not work correctly.
When a virtual key like 'left arrow' was dispatched as a keydown event, it was
ultimately being translated into an insertText: command instead of moveLeft:.

 - The automation browser window was not properly made key window and active, so
   AppKit never tried to match the NSEvent as a key equivalent. That code path
   must be taken in this case, as it translates arrow keys into command selectors.

 - AppKit relies on its own private use area (PUA) unicode characters to encode
   control keys that do not affect key modifier state, like the arrow keys.
   Since these PUA characters were not being used as the 'characters' of the
   NSEvents we synthesize, the events are treated as unknown and AppKit falls
   back to inserting the codepoint as uninterpreted text.

 - The Mac implementation of platformSimulateKeyStroke did not allow non-sticky
   virtual keys to use the 'InsertByKey' interaction which sends keydown+keyup.
   This is a programming mistake that causes such inputs to assert in debug builds
   and bail out to do nothing in non-debug builds.

 - A few simulated virtual keys that are matched to key equivalents did not properly set
   'charactersIgnoringModifiers' on NSEvents, which may use the wrong editing command.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::performKeyboardInteractions):
Fix this guard so that we actually call into key event synthesis code for iOS.

* UIProcess/Automation/WebAutomationSession.h: Add declarations.

* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::charCodeForVirtualKey): Moved from iOS implementation.
(WebKit::WebAutomationSession::charCodeIgnoringModifiersForVirtualKey): Added.
There are only a few special cases for now. We will probably need to hardcode
the decomposition for other ASCII characters so the expected DOM events are fired
when entering a shifted character (i.e., 'A' should be 'Shift'+'a', not 'A').

* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
Use charCodeIgnoringModifiersForVirtualKey().

* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::sendSynthesizedEventsToPage): use -becomeKeyWindow.
(WebKit::keyHasStickyModifier): Added.
(WebKit::keyCodeForVirtualKey): Added.
(WebKit::eventModifierFlagsForVirtualKey):Added.
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
Separately compute key stickiness, keyCode, event modifier, and charCode for
the simulated keystroke. The code to compute charCode is now shared between
iOS and macOS since the PUA characters are the same for both AppKit and UIKit.

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

2 years agoimport(arg) crashes when ToString(arg) throws
utatane.tea@gmail.com [Sun, 19 Mar 2017 15:41:36 +0000 (15:41 +0000)]
import(arg) crashes when ToString(arg) throws
https://bugs.webkit.org/show_bug.cgi?id=169778

Reviewed by Saam Barati.

JSTests:

* stress/import-reject-with-exception.js: Added.
(shouldBe):
(let.x.get toString):

Source/JavaScriptCore:

JSPromiseDeferred should not be rejected with Exception*.

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncImportModule):

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

2 years agoUpdate Ukrainian translation
mcatanzaro@igalia.com [Sun, 19 Mar 2017 00:58:35 +0000 (00:58 +0000)]
Update Ukrainian translation
https://bugs.webkit.org/show_bug.cgi?id=169812

Patch by Yuri Chornoivan <yurchor@ukr.net> on 2017-03-18
Rubber-stamped by Michael Catanzaro.

* uk.po:

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

2 years agoWeb Inspector: Empty attribute added to a DOM tree outline element should not add...
webkit@devinrousso.com [Sun, 19 Mar 2017 00:58:18 +0000 (00:58 +0000)]
Web Inspector: Empty attribute added to a DOM tree outline element should not add whitespace within the tag
https://bugs.webkit.org/show_bug.cgi?id=139623

Reviewed by Brian Burg.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._attributeEditingCommitted):
If the `newText` after editing has no content, remove the element for that attribute.

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

2 years agoWeb Inspector: add keyboard shortcut to clear timeline records
webkit@devinrousso.com [Sun, 19 Mar 2017 00:41:12 +0000 (00:41 +0000)]
Web Inspector: add keyboard shortcut to clear timeline records
https://bugs.webkit.org/show_bug.cgi?id=132485

Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView):
(WebInspector.TimelineRecordingContentView.prototype.handleClearShortcut):

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

2 years agoAdd support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
jonlee@apple.com [Sat, 18 Mar 2017 20:22:18 +0000 (20:22 +0000)]
Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
https://bugs.webkit.org/show_bug.cgi?id=169731

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline tests. The results seem to show a problem in the original tests.
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt:

Source/WebCore:

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent): Create a new $implementationAsKey. Look for
ImplementedAs, and if it exists, override the value with the alias. Set the parameters of
convert<>() using JSValueToNative.
(IsValidContextForJSValueToNative): Update to include IDLDictionaryMembers.
(JSValueToNative): Bypass parseEnumeration serialization for enums if the context is an
IDLDictionaryMember. Dictionary members need convert<IDLEnumeration> which throw a TypeError
or return the enum (and utilizes parseEnumeration). parseEnumeration, in contrast, returns
an optional.

* bindings/scripts/test/TestObj.idl: Add test cases in TestDictionary.

Update test results.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:

LayoutTests:

Rebaseline. The enhancement progressed the results of these tests.
* crypto/subtle/aes-gcm-encrypt-malformed-parameters-expected.txt:
* crypto/subtle/aes-generate-key-malformed-parameters-expected.txt:
* crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt:

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

2 years ago[JSC] Remove unnecessary condition from needsDerivedConstructorInArrowFunctionLexical...
gskachkov@gmail.com [Sat, 18 Mar 2017 20:21:51 +0000 (20:21 +0000)]
[JSC] Remove unnecessary condition from needsDerivedConstructorInArrowFunctionLexicalEnvironment in BytecodeGenerator.cpp
https://bugs.webkit.org/show_bug.cgi?id=169832

Reviewed by Mark Lam.

Remove already covered condition in needsDerivedConstructorInArrowFunctionLexicalEnvironment
function. Condition isConstructor() && constructorKind() == ConstructorKind::Extends is already
isClassContext.

 * bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::needsDerivedConstructorInArrowFunctionLexicalEnvironment):

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

2 years agoUse initializers for Document member variables
simon.fraser@apple.com [Sat, 18 Mar 2017 20:03:18 +0000 (20:03 +0000)]
Use initializers for Document member variables
https://bugs.webkit.org/show_bug.cgi?id=169848

Reviewed by Chris Dumez.

Move Document to use C++11 brace initializers.

No behavior change.

* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::xmlStandaloneStatus):
(WebCore::Document::setHasXMLDeclaration):

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

2 years agoinnerText setter inserts empty text node if value starts with newline
cdumez@apple.com [Sat, 18 Mar 2017 19:51:48 +0000 (19:51 +0000)]
innerText setter inserts empty text node if value starts with newline
https://bugs.webkit.org/show_bug.cgi?id=169600

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Re-sync tests with upstream to gain test coverage.

* web-platform-tests/innerText/getter-expected.txt:
* web-platform-tests/innerText/getter-tests.js:
* web-platform-tests/innerText/setter-expected.txt:
* web-platform-tests/innerText/setter-tests.js:
* web-platform-tests/innerText/setter.html:

Source/WebCore:

innerText setter should not create empty text nodes as per:
- https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute (step 6.2)

No new tests, updated existing test.

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

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

2 years agoAllow setting the prototype of cross-origin objects, as long as they don't change
cdumez@apple.com [Sat, 18 Mar 2017 17:52:01 +0000 (17:52 +0000)]
Allow setting the prototype of cross-origin objects, as long as they don't change
https://bugs.webkit.org/show_bug.cgi?id=169787

Reviewed by Mark Lam.

LayoutTests/imported/w3c:

Import test coverage from W3C web-platform-tests.

* web-platform-tests/common/domain-setter.sub.html: Added.
* web-platform-tests/common/test-setting-immutable-prototype.js: Added.
(self.testSettingImmutablePrototypeToNewValueOnly.test):
(self.testSettingImmutablePrototypeToNewValueOnly):
(self.testSettingImmutablePrototype.else.test):
(self.testSettingImmutablePrototype):
* web-platform-tests/common/w3c-import.log:
* web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub-expected.txt: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub.html: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub-expected.txt: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub.html: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub-expected.txt: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub.html: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-expected.txt: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin.html: Added.
* web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log:
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/w3c-import.log: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub-expected.txt: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub.html: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub-expected.txt: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub-expected.txt: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub.html: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-expected.txt: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin.html: Added.

Source/JavaScriptCore:

* runtime/JSGlobalObject.h:
Mark JS global object as an immutable prototype exotic object to match Window.

* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeWithCycleCheck):
Update setPrototypeWithCycleCheck() for immutable prototype exotic objects in order
to align with:
- https://tc39.github.io/ecma262/#sec-set-immutable-prototype

In particular, we need to call [[GetPrototypeOf]] and return true if it returns the same
value as the new prototype. We really need to call [[GetPrototypeOf]] and not merely
getting the prototype slot via getPrototypeDirect() since Location and Window override
[[GetPrototypeOf]] to return null in the cross-origin case.

* runtime/JSProxy.cpp:
(JSC::JSProxy::setPrototype):
Update JSProxy::setPrototype() to forward such calls to its target. This is needed so
we end up calling JSObject::setPrototypeWithCycleCheck() for the Window object.
Handling immutable prototype exotic objects in that method does the right thing for
Window.

Source/WebCore:

Allow setting the prototype of cross-origin objects, as long as they don't change:
- https://html.spec.whatwg.org/multipage/browsers.html#windowproxy-setprototypeof
- https://html.spec.whatwg.org/multipage/browsers.html#location-setprototypeof
- https://tc39.github.io/ecma262/#sec-set-immutable-prototype

Tests: imported/w3c/web-platform-tests/common/domain-setter.sub.html
       imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub.html
       imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub.html
       imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub.html
       imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin.html
       imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub.html
       imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html
       imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub.html
       imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin.html

* bindings/js/JSLocationCustom.cpp:
* page/Location.idl:
Drop custom setPrototype() implementation for Location and mark Location as an immutable
prototype exotic object now that JSC does the right thing for those.

LayoutTests:

* http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt:
* http/tests/security/cross-frame-access-object-setPrototypeOf.html:
* js/dom/setPrototypeOf-location-window-expected.txt:
* js/dom/setPrototypeOf-location-window.html:
Add checks for setting prototype of window and location objects to the same value
to make sure it does not throw, both in the same origin and the cross origin
cases.

* fast/dom/Window/window-custom-prototype-crash-expected.txt:
* http/tests/security/xss-DENIED-regular-propterty-with-iframe-proto-expected.txt:
* js/object-literal-shorthand-construction-expected.txt:
Rebaseline tests now that the exception message is a bit different.

* js/script-tests/prototype-assignment.js:
Remove special casing for Window, it now behaves like a regular immutable prototype
exotic object.

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

2 years agoStop sending media data as soon as peer connection is closed
commit-queue@webkit.org [Sat, 18 Mar 2017 04:32:10 +0000 (04:32 +0000)]
Stop sending media data as soon as peer connection is closed
https://bugs.webkit.org/show_bug.cgi?id=169813

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-17
Reviewed by Eric Carlson.

Stopping sending of media data as soon as the peer connection is closed.
By stopping sending at source level, this may stop by a few frames/chunks earlier than before.
Making sure RealtimeOutgoingVideoSource is stopping observing the media source when being stopped and deleted.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doStop):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::stop):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::stop):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:

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

2 years agoWeb Inspector: wrong filename when saving resource from ResourceImageContentView
webkit@devinrousso.com [Sat, 18 Mar 2017 03:49:50 +0000 (03:49 +0000)]
Web Inspector: wrong filename when saving resource from ResourceImageContentView
https://bugs.webkit.org/show_bug.cgi?id=54454

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ResourceContentView.js:
(WebInspector.ResourceContentView.prototype.get supportsSave):
(WebInspector.ResourceContentView.prototype.get saveData):
* UserInterface/Views/TextResourceContentView.js:
(WebInspector.TextResourceContentView.prototype.get supportsSave): Deleted.
Add save data getter to the parent class, so that both Images and Fonts can be saved.

* UserInterface/Views/Resource.js:
(WebInspector.Resource.prototype.canRequestContent):
Drive-by: remove unused function.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214133 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoImplement incoming webrtc data based on tracksCurr
commit-queue@webkit.org [Sat, 18 Mar 2017 02:36:24 +0000 (02:36 +0000)]
Implement incoming webrtc data based on tracksCurr
https://bugs.webkit.org/show_bug.cgi?id=169836

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-17
Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/video-with-receiver.html

Constructing incoming tracks based on libwebrtc OnAddTrack.
Constructing incoming media streams based on libwebrtc OnAddStream.
Firing only addstream if legacy API flag is on.

Ensuring that media stream and media stream tracks relationship is still correctly implemented.
For that, we keep a map that relates libwebrtc media streams with WebCore media streams.
Adding the ability to get a receiver related to the track on the track event.

Implementing the possibility to create a transceiver ahead of track arrival time.
Created transceivers that are not related to any real source are kept in the peer connection back end.
When a libwebrtc track is appearing, it is associated with the track source of the corresponding transceiver based on track type.

Added the ability to create empty real time sources and set their data libwebrtc track when being available.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::addTrackFromPlatform):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::OnAddStream):
(WebCore::LibWebRTCMediaEndpoint::OnRemoveStream):
(WebCore::LibWebRTCMediaEndpoint::OnAddTrack):
(WebCore::LibWebRTCMediaEndpoint::stop):
(WebCore::createMediaStreamTrack): Deleted.
(WebCore::LibWebRTCMediaEndpoint::addStream): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doStop):
(WebCore::createReceiverForSource):
(WebCore::createEmptySource):
(WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream):
(WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::setSourceTrack):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::setSourceTrack):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:

LayoutTests:

* webrtc/video-with-receiver-expected.txt: Added.
* webrtc/video-with-receiver.html: Copied from LayoutTests/webrtc/video.html.
* webrtc/video.html:

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

2 years agoRemove TestExpectation for a test that is no longer in the tree.
ryanhaddad@apple.com [Sat, 18 Mar 2017 00:39:23 +0000 (00:39 +0000)]
Remove TestExpectation for a test that is no longer in the tree.

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[MediaStream] Compensate for video capture orientation
eric.carlson@apple.com [Sat, 18 Mar 2017 00:34:00 +0000 (00:34 +0000)]
[MediaStream] Compensate for video capture orientation
https://bugs.webkit.org/show_bug.cgi?id=169313
<rdar://problem/30994785>

Unreviewed, fix a crash in r214120 found by the bots.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(-[WebAVSampleBufferStatusChangeListener invalidate]): Drive-by removal of unnecessary code.
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
Actually retain self before callOnMainThread.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
Invalidate the change listener first.

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

2 years agoMediaQueryList instances do not update for `prefers-reduced-motion`
dino@apple.com [Fri, 17 Mar 2017 23:40:22 +0000 (23:40 +0000)]
MediaQueryList instances do not update for `prefers-reduced-motion`
https://bugs.webkit.org/show_bug.cgi?id=169835
<rdar://problem/30339378>

Reviewed by Anders Carlsson.

Source/WebCore:

Tell the document it needs to evaluate the MediaQueryLists
if accessibility settings change.

Test: fast/media/mq-prefers-reduced-motion-matchMedia.html

* page/Page.cpp:
(WebCore::Page::accessibilitySettingsDidChange):

LayoutTests:

* fast/media/mq-prefers-reduced-motion-matchMedia-expected.txt: Added.
* fast/media/mq-prefers-reduced-motion-matchMedia.html: Added.

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

2 years agoMark media/modern-media-controls/airplay-placard/airplay-placard-text-section.html...
ryanhaddad@apple.com [Fri, 17 Mar 2017 23:33:11 +0000 (23:33 +0000)]
Mark media/modern-media-controls/airplay-placard/airplay-placard-text-section.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169654

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoMake HTTPCookieStorage operate in the UIProcess in absence of a WebProcessPool.
beidson@apple.com [Fri, 17 Mar 2017 23:23:39 +0000 (23:23 +0000)]
Make HTTPCookieStorage operate in the UIProcess in absence of a WebProcessPool.
<rdar://problem/31102330> and https://bugs.webkit.org/show_bug.cgi?id=169797

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No behavior change).

* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::flushCookieStore):

* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::flushCookieStore):

Source/WebKit2:

* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::~HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
(API::HTTPCookieStore::cookieManagerDestroyed):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):
* UIProcess/API/APIHTTPCookieStore.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::create):
(WebKit::WebProcessPool::notifyThisWebProcessPoolWasCreated):
(WebKit::m_hiddenPageThrottlingTimer):
* UIProcess/WebProcessPool.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
(WebKit::WebsiteDataStore::processPoolForCookieStorageNotifications): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

2 years agoDisable per-region boxes for multicolumn
hyatt@apple.com [Fri, 17 Mar 2017 21:59:33 +0000 (21:59 +0000)]
Disable per-region boxes for multicolumn
https://bugs.webkit.org/show_bug.cgi?id=169830

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/multicol/float-adjacent-to-overflow-block.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::borderBoxRectInRegion):
(WebCore::RenderBox::renderBoxRegionInfo):
Limit all of the per-region box code to RenderNamedFlowThreads.
This code should never be used by multicolumn layout.

LayoutTests:

* fast/multicol/float-adjacent-to-overflow-block-expected.html: Added.
* fast/multicol/float-adjacent-to-overflow-block.html: Added.

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

2 years agoTime channel attack on SVG Filters
said@apple.com [Fri, 17 Mar 2017 21:51:03 +0000 (21:51 +0000)]
Time channel attack on SVG Filters
https://bugs.webkit.org/show_bug.cgi?id=118689

Reviewed by Simon Fraser.

Source/WebCore:

The time channel attack can happen if the attacker applies FEColorMatrix
or FEConvolveMatrix and provides a matrix which is filled with subnormal
floating point values. Performing floating-point operations on subnormals
is very expensive unless the pixel in the source graphics is black (or
zero). By measuring the time a filter takes to be applied, the attacker
can know whether the pixel he wants to steal from  an iframe is black or
white. By repeating the same process on all the pixels in the iframe, the
attacker can reconstruct the whole page of the iframe.

To fix this issue, the values in the matrices of these filters will clamped
to FLT_MIN. We do not want to consume too much time calculating filtered
pixels because of such tiny values. The difference between applying FLT_MIN
and applying a subnormal should not be even noticeable. Normalizing the
floating-point matrices should happen only at the beginning of the filter
platformApplySoftware().

* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::fastSetInteriorPixels):
(WebCore::FEConvolveMatrix::fastSetOuterPixels):
(WebCore::FEConvolveMatrix::platformApplySoftware):
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::normalizedFloats):

Source/WTF:

Performing arithmetic operations on subnormal floating-point numbers is
very expensive. Normalizing the floating-point number to the minimum normal
value should accelerate the calculations and there won't be a noticeable
difference in the result since all the subnormal values and the minimum
normal value are all very close to zero.

* wtf/MathExtras.h:
(normalizedFloat):

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