WebKit-https.git
2 years agoWeb Inspector: AXI: linkified refs to #document and #text are not usually navigable...
commit-queue@webkit.org [Thu, 29 Sep 2016 22:15:57 +0000 (22:15 +0000)]
Web Inspector: AXI: linkified refs to #document and #text are not usually navigable nodes; consider delinkifying them
https://bugs.webkit.org/show_bug.cgi?id=130600
<rdar://problem/16391333>

Patch by Aaron Chu <aaron_chu@apple.com> on 2016-09-29
Reviewed by Brian Burg.

.:

Added a manual test to test the node links in the Accessibility Inspector
https://bugs.webkit.org/show_bug.cgi?id=130600

* ManualTests/accessibility/delinkified-non-navigable-links.html: Added.

Source/WebInspectorUI:

Removing link style for non-navigable nodes by first
checking nodeType of the node.

* UserInterface/Base/DOMUtilities.js:
(WebInspector.linkifyNodeReference):

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

2 years agoFix syntax violation handling in IPv4 address parsing
achristensen@apple.com [Thu, 29 Sep 2016 22:02:04 +0000 (22:02 +0000)]
Fix syntax violation handling in IPv4 address parsing
https://bugs.webkit.org/show_bug.cgi?id=162756

Reviewed by Tim Horton.

Source/WebCore:

When we are parsing the up to 4 numbers in an IPv4 address, if we find a syntax violation
(the canonicalized address would be different than the input string) then wait to report
it until we have determined that this is a valid IPv4 address that will be canonicalized.
If it is not a valid IPv4 address, then we will just treat the characters as the host, and
that could be no syntax violation.

Covered by a new API test and existing API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
* platform/URLParser.h:

Tools:

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

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

2 years agoFix post-landing nits after r206561.
cdumez@apple.com [Thu, 29 Sep 2016 21:28:45 +0000 (21:28 +0000)]
Fix post-landing nits after r206561.
https://bugs.webkit.org/show_bug.cgi?id=162659

Reviewed by Alex Christensen.

Uses more StringViews and constness.

* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
* dom/SecurityContext.h:
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::DOMTokenList):
(WebCore::DOMTokenList::supports):
* html/DOMTokenList.h:
(WebCore::DOMTokenList::DOMTokenList):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::sandbox):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::relList):
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::isSupported):
* html/LinkRelAttribute.h:

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

2 years agoURLParser should correctly parse ports with leading 0's
achristensen@apple.com [Thu, 29 Sep 2016 21:25:14 +0000 (21:25 +0000)]
URLParser should correctly parse ports with leading 0's
https://bugs.webkit.org/show_bug.cgi?id=162752

* platform/URLParser.cpp:
(WebCore::URLParser::parsePort):
Followup.  Remove branches based on Geoffrey's feedback.

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

2 years agoURLParser should correctly parse ports with leading 0's
achristensen@apple.com [Thu, 29 Sep 2016 21:20:43 +0000 (21:20 +0000)]
URLParser should correctly parse ports with leading 0's
https://bugs.webkit.org/show_bug.cgi?id=162752

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

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

Tools:

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

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

2 years ago[iOS] Add test for Touch constructor
cdumez@apple.com [Thu, 29 Sep 2016 21:13:33 +0000 (21:13 +0000)]
[iOS] Add test for Touch constructor
https://bugs.webkit.org/show_bug.cgi?id=162736
<rdar://problem/28520007>

Reviewed by Ryosuke Niwa.

Add test for Touch constructor. There are no expected results because
the test (folder) is skipped in the open source.

* fast/events/touch/touch-constructor.html: Added.

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

2 years agoFix flaky test media/click-placeholder-not-pausing.html
adachan@apple.com [Thu, 29 Sep 2016 21:04:34 +0000 (21:04 +0000)]
Fix flaky test media/click-placeholder-not-pausing.html
https://bugs.webkit.org/show_bug.cgi?id=162661

Reviewed by Eric Carlson.

This test became flaky after r201474 when we started to delay showing
the inline placeholder until we are sure the video layer has been moved
into the video fullscreen layer. This means we can't guarantee that the
placeholder is visible right away after the video's presentation mode
changes to "picture-in-picture".

To fix this, wait for the placeholder to become visible before clicking it.

* media/click-placeholder-not-pausing.html:
* platform/mac-wk2/TestExpectations:

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

2 years agoUnreviewed, rolling out r206483.
commit-queue@webkit.org [Thu, 29 Sep 2016 21:02:59 +0000 (21:02 +0000)]
Unreviewed, rolling out r206483.
https://bugs.webkit.org/show_bug.cgi?id=162750

May have caused iOS perf regression (Requested by smfr on
#webkit).

Reverted changeset:

"REGRESSION (r204552): Yelp carousel animation is not smooth."
https://bugs.webkit.org/show_bug.cgi?id=162632
http://trac.webkit.org/changeset/206483

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

2 years agoArrow functions do not infer name from computed property but normal functions do
joepeck@webkit.org [Thu, 29 Sep 2016 20:33:21 +0000 (20:33 +0000)]
Arrow functions do not infer name from computed property but normal functions do
https://bugs.webkit.org/show_bug.cgi?id=162720

Reviewed by Saam Barati.

JSTests:

* stress/inferred-names.js:

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitSetFunctionNameIfNeeded):
Set function name on arrow functions as well.

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

2 years agoURLParser: make parsing invalid IPv4 addresses more robust and correct
achristensen@apple.com [Thu, 29 Sep 2016 20:21:54 +0000 (20:21 +0000)]
URLParser: make parsing invalid IPv4 addresses more robust and correct
https://bugs.webkit.org/show_bug.cgi?id=162746

Reviewed by Tim Horton.

Source/WebCore:

If parsing an IPv4 address fails, the characters are just treated as a regular domain.

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):

Tools:

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

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

2 years agoURLParser: IPv6 addresses followed by a colon are invalid
achristensen@apple.com [Thu, 29 Sep 2016 20:18:16 +0000 (20:18 +0000)]
URLParser: IPv6 addresses followed by a colon are invalid
https://bugs.webkit.org/show_bug.cgi?id=162747

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

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

Tools:

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

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

2 years agoRemoving El Capitan modifier from flaky test media/restore-from-page-cache.html.
ryanhaddad@apple.com [Thu, 29 Sep 2016 20:03:11 +0000 (20:03 +0000)]
Removing El Capitan modifier from flaky test media/restore-from-page-cache.html.
https://bugs.webkit.org/show_bug.cgi?id=158747

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[Modern Media Controls] scheduler for layout nodes
commit-queue@webkit.org [Thu, 29 Sep 2016 20:02:25 +0000 (20:02 +0000)]
[Modern Media Controls] scheduler for layout nodes
https://bugs.webkit.org/show_bug.cgi?id=162726
<rdar://problem/28543043>

Patch by Antoine Quint <graouts@apple.com> on 2016-09-29
Reviewed by Dean Jackson.

Source/WebCore:

For the work on the modern media controls we will be using a tree of LayoutNode objects that will
commit to the DOM in coordinated `requestAnimationFrame()` calls to ensure all layouts are done
in an efficient and coordinated manner. As a preamble, we introduce a `scheduler` singleton which
provides a single public method `scheduleLayout(callback)` to queue callbacks to be fired in the
next `requestAnimationFrame()` callback.

Tests: media/modern-media-controls/scheduler/not-reentrant.html
       media/modern-media-controls/scheduler/single-callback-when-registered-multiple-times.html

* Modules/modern-media-controls/controls/scheduler.js: Added.
(const.scheduler.new.prototype.scheduleLayout):
(const.scheduler.new.prototype._requestFrameIfNeeded):
(const.scheduler.new.prototype._frameDidFire):
(const.scheduler.new.prototype._layout):

LayoutTests:

Testing the basic functionality for the LayoutNode scheduler.

* media/modern-media-controls/scheduler/not-reentrant-expected.txt: Added.
* media/modern-media-controls/scheduler/not-reentrant.html: Added.
* media/modern-media-controls/scheduler/single-callback-when-registered-multiple-times-expected.txt: Added.
* media/modern-media-controls/scheduler/single-callback-when-registered-multiple-times.html: Added.

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

2 years agoText nodes assigned to a linked slot are not clickable
rniwa@webkit.org [Thu, 29 Sep 2016 19:49:54 +0000 (19:49 +0000)]
Text nodes assigned to a linked slot are not clickable
https://bugs.webkit.org/show_bug.cgi?id=162091
<rdar://problem/28383300>

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was caused by updateMouseEventTargetNode adjusting the target to its parent element when
the original target was a text node. Fixed the bug by using the parent element in the composed tree.

Also fixed the bug that the hit testing was not finding the anchor element and keeping the cursor
in I-beam by traversing the composed tree instead.

Test: fast/shadow-dom/click-text-inside-linked-slot.html

* dom/Node.cpp:
(WebCore::Node::enclosingLinkEventParentOrSelf): Fixed the cursor problem.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode): Fixed the activation problem.

LayoutTests:

Added a regression test for clicking inside a text node assigned to a slot inside a hyperlink.

Unfortunately, there is not a way to make this a W3C style test until the web platform tests
start supporting WebDriver.

* fast/shadow-dom/click-text-inside-linked-slot-expected.txt: Added.
* fast/shadow-dom/click-text-inside-linked-slot.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoAllow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess...
weinig@apple.com [Thu, 29 Sep 2016 19:48:25 +0000 (19:48 +0000)]
Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
<rdar://problem/27648683>
https://bugs.webkit.org/show_bug.cgi?id=162735

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/spi/cf/CFNetworkSPI.h:
Forward declare _sourceApplicationSecondaryIdentifier and _CTDataConnectionServiceType

Source/WebKit2:

Add SPI for overriding the following NSURLSessionConfigurations properties:
    - _sourceApplicationBundleIdentifier
    - _sourceApplicationSecondaryIdentifier
    - _CTDataConnectionServiceType

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalSourceApplicationBundleIdentifier):
(WebKit::globalSourceApplicationSecondaryIdentifier):
(WebKit::globalCTDataConnectionServiceType):
(WebKit::NetworkSession::setCustomProtocolManager):
(WebKit::NetworkSession::setSourceApplicationAuditTokenData):
(WebKit::NetworkSession::setSourceApplicationBundleIdentifier):
(WebKit::NetworkSession::setSourceApplicationSecondaryIdentifier):
(WebKit::NetworkSession::setCTDataConnectionServiceType):
(WebKit::NetworkSession::NetworkSession):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
(-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
(-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
(-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
(-[_WKProcessPoolConfiguration CTDataConnectionServiceType]):
(-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

2 years agoRemove addSubresourceStyleURLs functions
antti@apple.com [Thu, 29 Sep 2016 19:36:39 +0000 (19:36 +0000)]
Remove addSubresourceStyleURLs functions
https://bugs.webkit.org/show_bug.cgi?id=162731

Reviewed by Ryosuke Niwa.

Use the generic std::function taking traverseSubresources instead. This prevents bugs caused by the code paths
not being in sync.

These functions are only used by the legacy webarchive code to gather URLs to locate CachedResources from the memory cache.
This can be improved further by returning the cached resources themselves instead of the URLs.

* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::addSubresourceStyleURLs): Deleted.
* css/CSSFontFaceSrcValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::addSubresourceStyleURLs): Deleted.
* css/CSSPrimitiveValue.h:
* css/CSSReflectValue.cpp:
(WebCore::CSSReflectValue::addSubresourceStyleURLs): Deleted.
* css/CSSReflectValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::addSubresourceStyleURLs): Deleted.
* css/CSSValue.h:
* css/CSSValueList.cpp:
(WebCore::CSSValueList::addSubresourceStyleURLs): Deleted.
* css/CSSValueList.h:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::addSubresourceStyleURLs): Deleted.
* css/StyleProperties.h:
* css/StyleRuleImport.h:
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::traverseSubresources):

    Fix a bug where this would miss @import rules in @imported stylesheets.
    Include the CachedResource for the imported stylesheet itself.

    Tested by the test cases under LayoutTests/webarchive

(WebCore::StyleSheetContents::addSubresourceStyleURLs): Deleted.
* css/StyleSheetContents.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::addSubresourceAttributeURLs):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::addSubresourceAttributeURLs):

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

2 years agoMarking fast/images/load-img-with-empty-src.html as crashing.
ryanhaddad@apple.com [Thu, 29 Sep 2016 19:22:56 +0000 (19:22 +0000)]
Marking fast/images/load-img-with-empty-src.html as crashing.
https://bugs.webkit.org/show_bug.cgi?id=162696

Unreviewed test gardening.

* TestExpectations:

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

2 years agoRe-enable StringView life-cycle checking.
mark.lam@apple.com [Thu, 29 Sep 2016 19:17:03 +0000 (19:17 +0000)]
Re-enable StringView life-cycle checking.
https://bugs.webkit.org/show_bug.cgi?id=160384
<rdar://problem/28479434>

Reviewed by Saam Barati.

Re-landing after slow running tests have been resolved.

* wtf/text/StringView.h:

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

2 years agoBreak some slow running tests into smaller bits so they don't time out.
mark.lam@apple.com [Thu, 29 Sep 2016 19:11:05 +0000 (19:11 +0000)]
Break some slow running tests into smaller bits so they don't time out.
https://bugs.webkit.org/show_bug.cgi?id=162743

Reviewed by Keith Miller.

The following tests have shown to be slow running:
    op_div.js
    op_lshift.js
    op_mod.js
    op_mul.js
    op_rshift.js
    op_sub.js
    op_urshift

These tests auto-generate permutations of values to apply to binary operations.
They also test the operations with 3 permutations of value types:
    1. VarVar - both operands variables
    2. VarConst - variable operand 1, constant / literal operand 2
    3. ConstVar - constant / literal operand 1, variable operand 2

We can prevent these tests from timing out by breaking each up to only run 1 of
the 3 permutations of value types.

* stress/op_div-ConstVar.js: Added.
* stress/op_div-VarConst.js: Added.
* stress/op_div-VarVar.js: Copied from JSTests/stress/op_div.js.
(o1.valueOf): Deleted.
* stress/op_div.js: Removed.
* stress/op_lshift-ConstVar.js: Added.
* stress/op_lshift-VarConst.js: Added.
* stress/op_lshift-VarVar.js: Copied from JSTests/stress/op_lshift.js.
(o1.valueOf): Deleted.
* stress/op_lshift.js: Removed.
* stress/op_mod-ConstVar.js: Added.
* stress/op_mod-VarConst.js: Added.
* stress/op_mod-VarVar.js: Copied from JSTests/stress/op_mod.js.
(o1.valueOf): Deleted.
* stress/op_mod.js: Removed.
* stress/op_mul-ConstVar.js: Added.
* stress/op_mul-VarConst.js: Added.
* stress/op_mul-VarVar.js: Copied from JSTests/stress/op_mul.js.
(o1.valueOf): Deleted.
* stress/op_mul.js: Removed.
* stress/op_rshift-ConstVar.js: Added.
* stress/op_rshift-VarConst.js: Added.
* stress/op_rshift-VarVar.js: Copied from JSTests/stress/op_rshift.js.
(o1.valueOf): Deleted.
* stress/op_rshift.js: Removed.
* stress/op_sub-ConstVar.js: Added.
* stress/op_sub-VarConst.js: Added.
* stress/op_sub-VarVar.js: Copied from JSTests/stress/op_sub.js.
(o1.valueOf): Deleted.
* stress/op_sub.js: Removed.
* stress/op_urshift-ConstVar.js: Added.
* stress/op_urshift-VarConst.js: Added.
* stress/op_urshift-VarVar.js: Copied from JSTests/stress/op_urshift.js.
(o1.valueOf): Deleted.
* stress/op_urshift.js: Removed.
* stress/resources/binary-op-values.js: Added.
(o1.valueOf):

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

2 years agotest262: class and function names should be inferred in assignment
commit-queue@webkit.org [Thu, 29 Sep 2016 19:01:42 +0000 (19:01 +0000)]
test262: class and function names should be inferred in assignment
https://bugs.webkit.org/show_bug.cgi?id=146262

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

JSTests:

* stress/arrowfunction-name.js: Added.
Quick tests for arrow function names.

* stress/inferred-names.js: Added.
General test for inferred function names.

* test262.yaml:
Pass many tests checking inferred function names.

Source/JavaScriptCore:

* parser/ASTBuilder.h:
(JSC::ASTBuilder::appendParameter):
(JSC::ASTBuilder::appendArrayPatternEntry):
(JSC::ASTBuilder::appendObjectPatternEntry):
(JSC::ASTBuilder::tryInferFunctionNameInPattern):
Assign names to default value functions and classes in destructuring.

(JSC::ASTBuilder::createAssignResolve):
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::makeAssignNode):
Assign names to both normal and arrow functions.

* parser/Nodes.h:
(JSC::ExpressionNode::isBaseFuncExprNode):
Both functions and arrow functions infer name, they both extend
this base so give the base an is check.

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

2 years agoMarking fast/images/pdf-as-image-with-annotations.html as crashing.
ryanhaddad@apple.com [Thu, 29 Sep 2016 18:59:44 +0000 (18:59 +0000)]
Marking fast/images/pdf-as-image-with-annotations.html as crashing.
https://bugs.webkit.org/show_bug.cgi?id=162696

Unreviewed test gardening.

* TestExpectations:

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

2 years ago[Win][Direct2D] Add D2D Font handling code
bfulgham@apple.com [Thu, 29 Sep 2016 18:45:08 +0000 (18:45 +0000)]
[Win][Direct2D] Add D2D Font handling code
https://bugs.webkit.org/show_bug.cgi?id=162712

Reviewed by Brent Fulgham.

This patch lands a set of new files that implement

No new tests until complete backend lands.

* platform/graphics/Font.h:
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::syntheticObliqueAngle): Added helper function.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::dwFont): Added.
(WebCore::FontPlatformData::dwFontFace): Ditto.
* platform/graphics/GlyphBuffer.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs): Use helper function.
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs): Ditto.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::createFontPlatformData): Add case for Direct2D.
* platform/graphics/win/FontCascadeDirect2D.cpp: Added.
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::~FontCustomPlatformData): Fix whitespace.
(WebCore::FontCustomPlatformData::fontPlatformData): Add Direct2D case.
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Clean up C++ initializers.
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Ditto.
* platform/graphics/win/FontPlatformDataDirect2D.cpp: Added.
* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Clean up C++ initializers.
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp: Added.
* platform/graphics/win/SimpleFontDataDirect2D.cpp: Added.
* platform/graphics/win/TextAnalyzerHelper.cpp: Added.
* platform/graphics/win/TextAnalyzerHelper.h: Added.

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

2 years agoMake WKTR short timeout dynamic
ap@apple.com [Thu, 29 Sep 2016 18:44:54 +0000 (18:44 +0000)]
Make WKTR short timeout dynamic
https://bugs.webkit.org/show_bug.cgi?id=162733

Reviewed by Alex Christensen.

WebKitTestRunner has a hardcoded value for how long to wait for IPC responses,
which is 5 seconds, or 10 seconds under ASan. But some of the operations can be
fairly time consuming - e.g. launching Networking process on demand.
These may take longer under load, especially with GuardMalloc.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::reattachPageToWebProcess):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::shortTimeout):
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::dumpResults):

* WebKitTestRunner/TestInvocation.h:
(WTR::TestInvocation::customTimeout): Deleted, this function was unused.

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

2 years agoB3 opcodes should leave room for flags
fpizlo@apple.com [Thu, 29 Sep 2016 18:44:53 +0000 (18:44 +0000)]
B3 opcodes should leave room for flags
https://bugs.webkit.org/show_bug.cgi?id=162692

Reviewed by Keith Miller.
Source/JavaScriptCore:

It used to be that the main thing that determined what a Value did was the opcode. The
Opcode was how you knew what subclass of Value you had. The opcode told you what the Value
actually did. This change replaces Opcode with Kind, which is a tuple of opcode and other
stuff.

Opcodes are great, and that's how most compilers work. But opcodes are one-dimensional. Here
is how this manifests. Say you have an opcode, like Load. You will be happy if your IR has
one Load opcode. But then, you might add Load8S/Load8Z/Load16S/Load16Z opcodes, as we have
done in B3. B3 has one dimension of Load opcodes, which determines something like the C type
of the load. But in the very near future, we will want to add two more dimensions to Loads:

- A flag to say if the load traps.
- A flag to say if the load has acquire semantics.

Mapping these three dimensions (type, trap, acquire) onto the one-dimensional Opcode space
would create mayham: Load8S, Load8STrap, Load8SAcquire, Load8STrapAcquire, Load8Z,
Load8ZTrap, etc.

This happens in other parts of the IR. For example, we have a dimension of arithmetic
operations: add, sub, mul, div, mod, etc. Then we have the chill flag. But since opcodes
are one-dimensional, that means having ChillDiv and ChillMod, and tons of places in the
compiler that case on both Div and ChillDiv, or case on both Mod and ChillMod, since they
are only interested in the kind of arithmetic being done and not the chillness.

Though the examples all involve bits (chill or not, trapping or not, etc), I can imagine
other properties that behave more like small enums, like if we fill out more memory ordering
modes other than just "acquire? yes/no". There will eventually have to be something like a
std::memory_order associated with memory accesses.

One approach to this problem is to have a Value subclass that contains fields with the meta
data. I don't like this for two reasons:

- In bug 162688, I want to make trapping memory accesses have stackmaps. This means that a
  trapping memory access would have a different Value subclass than a non-trapping memory
  access. So, this meta-data needs to channel into ValueType::accepts(). Currently that
  takes Opcode and nothing else.

- Compiler IRs are all about making common tasks easy. If it becomes commonplace for opcodes
  to require a custom Value subclass just for a bit then that's not very easy.

This change addresses this problem by making the compiler pass around Kinds rather than
Opcodes. A Kind contains an Opcode as well as any number of opcode-specific bits. This
change demonstrates how Kind should be used by converting chillness to it. Kind has
hasIsChill(), isChill(), and setIsChill() methods. hasIsChill() is true only for Div and
Mod. setIsChill() asserts if !hasIsChill(). If you want to create a Chill Div, you say
chill(Div). IR dumps will print it like this:

    Int32 @38 = Div<Chill>(@36, @37, DFG:@24, ControlDependent)

Where "Div<Chill>" is how a Kind that hasExtraBits() dumps itself. If a Kind does not
hasExtraBits() (the normal case) then it dumps like a normal Opcode (without the "<>").

I replaced many uses of Opcode with Kind. New code has to be mindful that Opcode may not be
the right way to summarize what a value does, and so in many cases it's better to carry
around a Kind instead - especially if you will use it to stamp out new Values. Opcode is no
longer sufficient to perform a dynamic Value cast, since that code now uses Kind. ValueKey
now wants a Kind instead of an Opcode. All Value constructors now take Kind instead of
Opcode. But most opcodes don't get any extra Kind bits, and so the code that operates on
those opcodes is largely unchanged.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3ArgumentRegValue.h:
* b3/B3CCallValue.h:
* b3/B3CheckValue.cpp:
(JSC::B3::CheckValue::convertToAdd):
(JSC::B3::CheckValue::CheckValue):
* b3/B3CheckValue.h:
(JSC::B3::CheckValue::accepts):
* b3/B3Const32Value.h:
* b3/B3Const64Value.h:
* b3/B3ConstDoubleValue.h:
* b3/B3ConstFloatValue.h:
* b3/B3FenceValue.h:
* b3/B3Kind.cpp: Added.
(JSC::B3::Kind::dump):
* b3/B3Kind.h: Added.
(JSC::B3::Kind::Kind):
(JSC::B3::Kind::opcode):
(JSC::B3::Kind::setOpcode):
(JSC::B3::Kind::hasExtraBits):
(JSC::B3::Kind::hasIsChill):
(JSC::B3::Kind::isChill):
(JSC::B3::Kind::setIsChill):
(JSC::B3::Kind::operator==):
(JSC::B3::Kind::operator!=):
(JSC::B3::Kind::hash):
(JSC::B3::Kind::isHashTableDeletedValue):
(JSC::B3::chill):
(JSC::B3::KindHash::hash):
(JSC::B3::KindHash::equal):
* b3/B3LowerMacros.cpp:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/B3MemoryValue.h:
* b3/B3Opcode.cpp:
(WTF::printInternal):
* b3/B3Opcode.h:
* b3/B3PatchpointValue.h:
(JSC::B3::PatchpointValue::accepts):
* b3/B3ReduceStrength.cpp:
* b3/B3SlotBaseValue.h:
* b3/B3StackmapValue.cpp:
(JSC::B3::StackmapValue::StackmapValue):
* b3/B3StackmapValue.h:
* b3/B3SwitchValue.h:
(JSC::B3::SwitchValue::accepts):
* b3/B3UpsilonValue.h:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::dump):
(JSC::B3::Value::deepDump):
(JSC::B3::Value::invertedCompare):
(JSC::B3::Value::effects):
(JSC::B3::Value::key):
(JSC::B3::Value::typeFor):
(JSC::B3::Value::badKind):
(JSC::B3::Value::badOpcode): Deleted.
* b3/B3Value.h:
* b3/B3ValueInlines.h:
(JSC::B3::Value::as):
* b3/B3ValueKey.cpp:
(JSC::B3::ValueKey::dump):
(JSC::B3::ValueKey::materialize):
* b3/B3ValueKey.h:
(JSC::B3::ValueKey::ValueKey):
(JSC::B3::ValueKey::kind):
(JSC::B3::ValueKey::opcode):
(JSC::B3::ValueKey::operator==):
(JSC::B3::ValueKey::hash):
* b3/B3ValueKeyInlines.h:
(JSC::B3::ValueKey::ValueKey):
* b3/B3VariableValue.cpp:
(JSC::B3::VariableValue::VariableValue):
* b3/B3VariableValue.h:
* b3/testb3.cpp:
(JSC::B3::testChillDiv):
(JSC::B3::testChillDivTwice):
(JSC::B3::testChillDiv64):
(JSC::B3::testChillModArg):
(JSC::B3::testChillModArgs):
(JSC::B3::testChillModImms):
(JSC::B3::testChillModArg32):
(JSC::B3::testChillModArgs32):
(JSC::B3::testChillModImms32):
(JSC::B3::testSwitchChillDiv):
(JSC::B3::testEntrySwitchWithCommonPaths):
(JSC::B3::testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::chillDiv):
(JSC::FTL::Output::chillMod):

Websites/webkit.org:

Updated the documentation to talk about Kind and the isChill bit, and to remove
ChillDiv/ChillMod.

* docs/b3/intermediate-representation.html:

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

2 years agoparser-syntax-check should display the output of syntax errors
sbarati@apple.com [Thu, 29 Sep 2016 18:44:14 +0000 (18:44 +0000)]
parser-syntax-check should display the output of syntax errors
https://bugs.webkit.org/show_bug.cgi?id=162738

Reviewed by Joseph Pecoraro.

It's good to have this test display the syntax error messages
when we're expecting a syntax error because it will both allow
us to track changes in error messages and verify that we get
the expected error message when writing new tests.

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:
(runTest):

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

2 years agoURLParser should fail to parse unclosed IPv6 addresses
achristensen@apple.com [Thu, 29 Sep 2016 18:19:31 +0000 (18:19 +0000)]
URLParser should fail to parse unclosed IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162715

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

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

Tools:

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

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

2 years agoURLParser should ignore tabs at all possible locations
achristensen@apple.com [Thu, 29 Sep 2016 18:18:04 +0000 (18:18 +0000)]
URLParser should ignore tabs at all possible locations
https://bugs.webkit.org/show_bug.cgi?id=162711

Reviewed by Tim Horton.

Source/WebCore:

The URL spec says to remove all tabs and newlines before parsing a URL.
To reduce passes on the URL and copies of data, I chose to just ignore them every time I increment the iterator.
This is fragile, but faster.  It can be completely tested, though.  That is what this patch does.

Covered by an addition to the API tests that tries inserting one tab at each location of each test.

* platform/URLParser.cpp:
(WebCore::URLParser::advance):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendWindowsDriveLetter):
(WebCore::URLParser::isPercentEncodedDot):
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::checkLocalhostCodePoint):
(WebCore::URLParser::isAtLocalhost):
(WebCore::URLParser::isLocalhost):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
(WebCore::isPercentEncodedDot): Deleted.
(WebCore::isSingleDotPathSegment): Deleted.
(WebCore::isDoubleDotPathSegment): Deleted.
(WebCore::consumeSingleDotPathSegment): Deleted.
(WebCore::consumeDoubleDotPathSegment): Deleted.
* platform/URLParser.h:
(WebCore::URLParser::advance):

Tools:

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

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

2 years agoFix hit testing on display:block <svg> elements
simon.fraser@apple.com [Thu, 29 Sep 2016 18:09:59 +0000 (18:09 +0000)]
Fix hit testing on display:block <svg> elements
https://bugs.webkit.org/show_bug.cgi?id=162717
rdar://problem/23261130

Reviewed by Zalan Bujtas.
Source/WebCore:

RenderSVGRoot::nodeAtPoint() needs to test for both the HitTestBlockBackground and
HitTestChildBlockBackground phases, since we only get the HitTestChildBlockBackground
phase when the <svg> is a block. This is similar to code in RenderTable::nodeAtPoint(),
and matches Blink code.

This fixes the point dragging on http://anthonydugois.com/svg-path-builder/.

Test: svg/hittest/block-svg.html

* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::nodeAtPoint):

LayoutTests:

Test hit testing on inline and block <svg> elements.

* svg/hittest/block-svg-expected.txt: Added.
* svg/hittest/block-svg.html: Added.

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

2 years agoWe don't properly propagate non-simple-parameter-list when parsing a setter
sbarati@apple.com [Thu, 29 Sep 2016 18:03:23 +0000 (18:03 +0000)]
We don't properly propagate non-simple-parameter-list when parsing a setter
https://bugs.webkit.org/show_bug.cgi?id=160483

Reviewed by Joseph Pecoraro.

JSTests:

* test262.yaml:

Source/JavaScriptCore:

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionParameters):

LayoutTests:

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:

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

2 years agoAssigning non-numeric to input.minlength should set minlength to 0
cdumez@apple.com [Thu, 29 Sep 2016 17:41:50 +0000 (17:41 +0000)]
Assigning non-numeric to input.minlength should set minlength to 0
https://bugs.webkit.org/show_bug.cgi?id=162727

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Import test coverage.

* web-platform-tests/html/semantics/forms/the-input-element/minlength-expected.txt: Added.
* web-platform-tests/html/semantics/forms/the-input-element/minlength.html: Added.

Source/WebCore:

There was a typo when we were updating the m_minLength member from the 'min'
content attribute instead of the 'minlength' one.

Test: imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/minlength.html.

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

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

2 years ago[Web IDL] Fix overload resolution when the distinguishing argument is a Window
cdumez@apple.com [Thu, 29 Sep 2016 17:18:35 +0000 (17:18 +0000)]
[Web IDL] Fix overload resolution when the distinguishing argument is a Window
https://bugs.webkit.org/show_bug.cgi?id=162728

Reviewed by Ryosuke Niwa.

Fix overload resolution when the distinguishing argument is a Window.
Window is special because we could have a window or a proxy to the
Window (JSDOMWindowShell).

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadedFunctionOrConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
* bindings/scripts/test/TestObj.idl:

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

2 years agoFixed compilation of PluginView when NETSCAPE_PLUGIN_API is disabled
annulen@yandex.ru [Thu, 29 Sep 2016 17:08:41 +0000 (17:08 +0000)]
Fixed compilation of PluginView when NETSCAPE_PLUGIN_API is disabled
https://bugs.webkit.org/show_bug.cgi?id=162725

Reviewed by Alex Christensen.

Fix for r206460, streamDidFinishLoading() does not override anything
when NETSCAPE_PLUGIN_API is disabled because PlugivView does not
inherit PluginStreamClient in this case.

* Plugins/PluginView.h:

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

2 years agoUnreviewed, rolling out r206563.
commit-queue@webkit.org [Thu, 29 Sep 2016 17:08:28 +0000 (17:08 +0000)]
Unreviewed, rolling out r206563.
https://bugs.webkit.org/show_bug.cgi?id=162732

Caused stress/op_*.js.ftl-no-cjit tests to time out (Requested
by ryanhaddad on #webkit).

Reverted changeset:

"Re-enable StringView life-cycle checking."
https://bugs.webkit.org/show_bug.cgi?id=160384
http://trac.webkit.org/changeset/206563

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

2 years ago[Win] Compile fix.
pvollan@apple.com [Thu, 29 Sep 2016 15:47:00 +0000 (15:47 +0000)]
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=162262

Reviewed by Anders Carlsson.

If CoreText.h is included, we will get redefinition compile errors on some older SDK
versions.

* platform/spi/win/CoreTextSPIWin.h:

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

2 years agoNetworkSession: HTTP authentication doesn't work if PROTECTION_SPACE_AUTH_CALLBACK...
carlosgc@webkit.org [Thu, 29 Sep 2016 15:30:33 +0000 (15:30 +0000)]
NetworkSession: HTTP authentication doesn't work if PROTECTION_SPACE_AUTH_CALLBACK is not enabled
https://bugs.webkit.org/show_bug.cgi?id=162724

Reviewed by Alex Christensen.

NetworkLoad always expects continueCanAuthenticateAgainstProtectionSpace() to be called to complete the
authentication challenge, which is only defined when PROTECTION_SPACE_AUTH_CALLBACK is enabled.
I've added missing #ifdefs for PROTECTION_SPACE_AUTH_CALLBACK.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::didReceiveChallenge): Call completeAuthenticationChallenge() instead of
canAuthenticateAgainstProtectionSpaceAsync() when PROTECTION_SPACE_AUTH_CALLBACK is not enabled.
(WebKit::NetworkLoad::completeAuthenticationChallenge): Moved common code to complete the authentication
challenge from continueCanAuthenticateAgainstProtectionSpace().
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Call completeAuthenticationChallenge().
(WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
(WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:

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

2 years ago[SOUP] Remove WebCoreSynchronousLoader from ResourceHandleSoup
carlosgc@webkit.org [Thu, 29 Sep 2016 15:28:54 +0000 (15:28 +0000)]
[SOUP] Remove WebCoreSynchronousLoader from ResourceHandleSoup
https://bugs.webkit.org/show_bug.cgi?id=162723

Reviewed by Sergio Villar Senin.

Since all soup based ports switched to NetworkProcess this is dead code.

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

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

2 years agoAX: Meter: [Mac] Content in label element should be used as AXTitle or AXDescription
n_wang@apple.com [Thu, 29 Sep 2016 15:13:00 +0000 (15:13 +0000)]
AX: Meter: [Mac] Content in label element should be used as AXTitle or AXDescription
https://bugs.webkit.org/show_bug.cgi?id=162586

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed the label element's text as AXDescription for meter elements.
Also refactored the code for fetching the label element's text and taken care of
the case where aria-label and aria-labelledby attributes are used on label elements.

Test: accessibility/mac/meter-with-label-element.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isLabelable):
(WebCore::AccessibilityNodeObject::textForLabelElement):
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::title):
(WebCore::AccessibilityNodeObject::usesAltTagForTextComputation): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement):

LayoutTests:

* accessibility/mac/aria-label-on-label-element-expected.txt:
* accessibility/mac/aria-label-on-label-element.html:
* accessibility/mac/meter-with-label-element-expected.txt: Added.
* accessibility/mac/meter-with-label-element.html: Added.

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

2 years agoClang 3.9 reports a compilation warning about ENABLE_EXCEPTION_SCOPE_VERIFICATION
commit-queue@webkit.org [Thu, 29 Sep 2016 15:12:54 +0000 (15:12 +0000)]
Clang 3.9 reports a compilation warning about ENABLE_EXCEPTION_SCOPE_VERIFICATION
https://bugs.webkit.org/show_bug.cgi?id=162718

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-09-29
Reviewed by Alex Christensen.

Clang 3.9 reports a following compilation warning:
  Source/JavaScriptCore/runtime/VM.h:656:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]

* wtf/Platform.h: Changed the definition of ENABLE_EXCEPTION_SCOPE_VERIFICATION not to use 'defined'.

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

2 years ago[Streams API] Improve ReadableStreamDefaultController.h/cpp
commit-queue@webkit.org [Thu, 29 Sep 2016 12:48:16 +0000 (12:48 +0000)]
[Streams API] Improve ReadableStreamDefaultController.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=160293

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-09-29
Reviewed by Youenn Fablet.

Various small improvements in ReadableStreamDefaultController code (helper methods and asserts).

No change in behaviour.

* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked): Added an assert and updated based
on new helper methods.
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::close): Updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::error): Updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::enqueue): Added an assert and updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::jsController): New helper method.
(WebCore::ReadableStreamDefaultController::globalObject): Return reference instead of pointer.
(WebCore::ReadableStreamDefaultController::globalExec): New helper; return reference after performing an assert.
(WebCore::ReadableStreamDefaultController::error<String>): Added an assert and updated based on new helper methods.

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

2 years ago[EFL] Add search button to url bar in MiniBrowser
commit-queue@webkit.org [Thu, 29 Sep 2016 10:28:14 +0000 (10:28 +0000)]
[EFL] Add search button to url bar in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=162716

Patch by Gyuyoung Kim <gyuyoung.kim@navercorp.com> on 2016-09-29
Reviewed by Michael Catanzaro.

As a bug title, it would be good to add a search button to URL bar.
Additionally this patch changes color of button to recognize the buttons.

* MiniBrowser/efl/main.c:
(_search_button_clicked_cb):
(_create_toolbar_button):
(window_create):
(create_toolbar_button): Deleted.

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

2 years agoAdded Beacon API to the Feature Status page.
jond@apple.com [Thu, 29 Sep 2016 09:52:52 +0000 (09:52 +0000)]
Added Beacon API to the Feature Status page.
https://bugs.webkit.org/show_bug.cgi?id=162630

Reviewed by Alex Christensen.

* features.json:

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

2 years agoImport touch-events web-platform-tests
cdumez@apple.com [Thu, 29 Sep 2016 04:44:24 +0000 (04:44 +0000)]
Import touch-events web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=162713

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Import touch-events web-platform-tests.

* web-platform-tests/touch-events/OWNERS: Added.
* web-platform-tests/touch-events/create-touch-touchlist.html: Added.
* web-platform-tests/touch-events/historical.html: Added.
* web-platform-tests/touch-events/multi-touch-interactions.js: Added.
(debug_print):
(check_list_subset_of_two_targetlists):
(is_at_least_one_item_in_targetlist):
(check_no_item_in_targetlist):
(check_targets):
(run.):
(run):
* web-platform-tests/touch-events/touch-globaleventhandler-interface.html: Added.
* web-platform-tests/touch-events/touch-support.js: Added.
(check_Touch_object):
(check_TouchEvent):
* web-platform-tests/touch-events/touch-touchevent-constructor.html: Added.
* web-platform-tests/touch-events/w3c-import.log: Added.

LayoutTests:

Skip on all platforms that do not have Touch enabled.

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

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

2 years agoDrop first 'state' parameter to JSDOMWindow::toWrapped() / JSEventTarget::toWrapped()
cdumez@apple.com [Thu, 29 Sep 2016 03:58:33 +0000 (03:58 +0000)]
Drop first 'state' parameter to JSDOMWindow::toWrapped() / JSEventTarget::toWrapped()
https://bugs.webkit.org/show_bug.cgi?id=162709

Reviewed by Alex Christensen.

Drop first 'state' parameter to JSDOMWindow::toWrapped() / JSEventTarget::toWrapped()
as it is unused. This is the quickest way to allow DOMWindow / EventTarget members
in IDL dictionaries. This is because the generated bindings code relies on
convertWrapperType() in JSDOMConvert.h which calls toWrapped() with a single
parameter. Right now, the only type that requires an ExecState for its toWrapped()
is XPathNSResolver (which should likely be a callback interface rather than a
regular interface).

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(JSValueToNative):

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

2 years agoMarking fast/images/object-image.html as crashing.
ryanhaddad@apple.com [Thu, 29 Sep 2016 01:36:42 +0000 (01:36 +0000)]
Marking fast/images/object-image.html as crashing.
https://bugs.webkit.org/show_bug.cgi?id=162696

Unreviewed test gardening.

* TestExpectations:

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

2 years agostringProtoFuncRepeatCharacter will return `null` when it should not
sbarati@apple.com [Thu, 29 Sep 2016 01:29:03 +0000 (01:29 +0000)]
stringProtoFuncRepeatCharacter will return `null` when it should not
https://bugs.webkit.org/show_bug.cgi?id=161944

Reviewed by Yusuke Suzuki.

JSTests:

* stress/pad-start-calls-repeat-character-with-double.js: Added.
(logLinesWithContext):

Source/JavaScriptCore:

stringProtoFuncRepeatCharacter was expecting its second argument
to always be a boxed integer. This is not correct. The DFG may decide
to represent a particular value as a double instead of integer. This
function needs to have correct behavior when its second argument is
a boxed double. I also added an assertion stating that the second argument
is always a number. We can guarantee this since it's only called from
builtins.

* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncRepeatCharacter):

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

2 years agoAPI test WebKit2.AutoLayoutIntegration is a flaky timeout
timothy_horton@apple.com [Thu, 29 Sep 2016 01:14:38 +0000 (01:14 +0000)]
API test WebKit2.AutoLayoutIntegration is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=160284

Reviewed by Dan Bernstein.

* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(-[AutoLayoutWKWebView load:withWidth:expectingContentSize:resettingWidth:]):
(-[AutoLayoutWKWebView beginLayoutAtMinimumWidth:andExpectContentSizeChange:]):
(-[AutoLayoutWKWebView waitForContentSizeChangeResettingWidth:]):
(-[AutoLayoutWKWebView layoutAtMinimumWidth:andExpectContentSizeChange:resettingWidth:]):
(-[AutoLayoutWKWebView invalidateIntrinsicContentSize]):
(TEST):
Make the autolayout tests a bit more flexible regarding the ordering of
invalidateIntrinsicContentSize, to avoid a race between the load
completing and the invalidation.

Also, move the newly added test to use its own WKWebView, since once in a
while we get a first layout notification from the previous page, causing the test to fail.

Un-disable the tests, which now run without any flakes for me with quite a few iterations.

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

2 years agoRe-enable StringView life-cycle checking.
mark.lam@apple.com [Thu, 29 Sep 2016 00:03:08 +0000 (00:03 +0000)]
Re-enable StringView life-cycle checking.
https://bugs.webkit.org/show_bug.cgi?id=160384
<rdar://problem/28479434>

Reviewed by Saam Barati.

* wtf/text/StringView.h:

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

2 years agoLog console messages when the anchor download attribute is ignored
cdumez@apple.com [Wed, 28 Sep 2016 23:51:04 +0000 (23:51 +0000)]
Log console messages when the anchor download attribute is ignored
https://bugs.webkit.org/show_bug.cgi?id=162703

Reviewed by Alex Christensen.

Log console messages when the anchor download attribute is ignored so
that the developer can better understand what's happening.

Source/WebCore:

No new tests, rebaselined existing tests.

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

LayoutTests:

* fast/dom/HTMLAnchorElement/anchor-download-synthetic-click-expected.txt:
* http/tests/security/anchor-download-block-crossorigin-expected.txt:

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

2 years agoAdd support for DOMTokenList.supports()
cdumez@apple.com [Wed, 28 Sep 2016 23:49:50 +0000 (23:49 +0000)]
Add support for DOMTokenList.supports()
https://bugs.webkit.org/show_bug.cgi?id=162659

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-link-element/link-rellist-expected.txt:

Source/WebCore:

Add support for DOMTokenList.supports():
- https://dom.spec.whatwg.org/#dom-domtokenlist-supports

Firefox and Chrome already recently implemented it (Chrome since
version 50 and Firefox since version 49).

Test: fast/dom/DOMTokenList-supports.html

* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::enforceSandboxFlags): Deleted.
* dom/SecurityContext.h:
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::DOMTokenList):
(WebCore::DOMTokenList::supports):
(WebCore::DOMTokenList::replace): Deleted.
* html/DOMTokenList.h:
(WebCore::DOMTokenList::DOMTokenList):
* html/DOMTokenList.idl:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::relList):
* html/HTMLAnchorElement.idl:
* html/HTMLAreaElement.idl:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::sandbox):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::relList):
* html/HTMLTableCellElement.idl:
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::isSupported):
(WebCore::LinkRelAttribute::LinkRelAttribute): Deleted.
* html/LinkRelAttribute.h:

LayoutTests:

Add layout test coverage. Our pass rate is identical to Firefox 49,
everything passes except HTMLElement.dropzone. Chrome 53's pass rate
is lower because relList is not a DOMTokenList on anchor / area,
they do not support HTMLElement.dropzone and their
DOMTokenList.supports() is case-sensitive.

* fast/dom/DOMTokenList-supports-expected.txt: Added.
* fast/dom/DOMTokenList-supports.html: Added.

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

2 years agoDOMTokenList’s value and stringifier should not return parsed tokens
rniwa@webkit.org [Wed, 28 Sep 2016 23:34:54 +0000 (23:34 +0000)]
DOMTokenList’s value and stringifier should not return parsed tokens
https://bugs.webkit.org/show_bug.cgi?id=161076

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Rebaselined tests that are now passing.

* web-platform-tests/dom/lists/DOMTokenList-stringifier-expected.txt:
* web-platform-tests/dom/lists/DOMTokenList-value-expected.txt:
* web-platform-tests/dom/nodes/Element-classlist-expected.txt:

Source/WebCore:

Updated our implementation of DOMTokenList.prototype.value and its toString function
to match the latest DOM specification: https://dom.spec.whatwg.org/#interface-domtokenlist

"value" attribute, on getting, runs its serialize steps, which simply gets the attribute value.
On setting, it sets the attribute value with the given value.

The stringification behavior returns the same serialize steps as "value" attribute on getting.

This change simplifies our implementation of DOMTokenList and removes the need for m_cachedValue,
which has been removed in this patch.

No new tests since existing tests cover this.

* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::value): Just call getAttribute.
(WebCore::DOMTokenList::setValue): Just call setAttribute.
(WebCore::DOMTokenList::updateTokensFromAttributeValue):
(WebCore::DOMTokenList::associatedAttributeValueChanged):
(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens): Moved the code to update the tokens
from from the attribute value. This is the "update steps".
* html/DOMTokenList.h:

LayoutTests:

Added more test cases and rebaselined tests. Most of changes are due to the change that DOMTokenList's value
and stringifier now returns the original attribute value with extra whitespaces.

* fast/dom/HTMLLinkElement/sizes-setter-expected.txt:
* fast/dom/HTMLLinkElement/sizes-setter.html:
* fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt:
* fast/dom/HTMLOutputElement/htmloutputelement-expected.txt:
* fast/dom/HTMLOutputElement/htmloutputelement.html:
* fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js:
* fast/frames/sandbox-attribute-expected.txt:
* fast/frames/sandbox-attribute.html:

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

2 years agoMarking fast/images/animated-gif-restored-from-bfcache.html as flaky on mac-wk2 debug.
ryanhaddad@apple.com [Wed, 28 Sep 2016 23:22:57 +0000 (23:22 +0000)]
Marking fast/images/animated-gif-restored-from-bfcache.html as flaky on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=162510

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoMark fast/images/pdf-as-image-too-big.html as crashing.
ryanhaddad@apple.com [Wed, 28 Sep 2016 23:17:46 +0000 (23:17 +0000)]
Mark fast/images/pdf-as-image-too-big.html as crashing.
https://bugs.webkit.org/show_bug.cgi?id=162696

Unreviewed test gardening.

* TestExpectations:

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

2 years agoCRASH at WebCore::CDMSessionAVStreamSession::update + 950
jer.noble@apple.com [Wed, 28 Sep 2016 22:13:31 +0000 (22:13 +0000)]
CRASH at WebCore::CDMSessionAVStreamSession::update + 950
https://bugs.webkit.org/show_bug.cgi?id=162701

Reviewed by Beth Dakin.

If the SourceBuffer backing a <video> element is removed before CDMSessionAVStreamSession::update() gets
a chance to run, the protectedSourceBuffer will be null. Just bail early and indicate an error.

* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update):

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

2 years agoThe write barrier should be down with TSO
fpizlo@apple.com [Wed, 28 Sep 2016 21:55:53 +0000 (21:55 +0000)]
The write barrier should be down with TSO
https://bugs.webkit.org/show_bug.cgi?id=162316

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This makes our write barrier behave correctly when it races with the collector. The
collector wants to do this when visiting:

    object->cellState = black
    visit(object)

The mutator wants to do this when storing:

    object->property = newValue
    if (object->cellState == black)
        remember(object)

Prior to this change, this didn't work right because the compiler would sometimes place
barriers before the store to the property and because the mutator did not have adequate
fences.

Prior to this change, the DFG and FTL would emit this:

    if (object->cellState == black)
        remember(object)
    object->property = newValue

Which is wrong, because the object could start being scanned just after the cellState
check, at which point the store would be lost. We need to confirm that the state was not
black *after* the store! This change was harder than you'd expect: placing the barrier
after the store broke B3's ability to do its super crazy ninja CSE on some store-load
redundancies. Because the B3 CSE has some moves that the DFG CSE lacks, the DFG CSE's
ability to ignore barriers didn't help. I fixed this by having the FTL convey precise
heap ranges for the patchpoint corresponding to the barrier slow path. It reads the world
(because of the store-load fence) and it writes only cellState (because the B3 heap ranges
don't have any way to represent any of the GC's other state, which means that B3 does not
have to worry about aliasing with any of that).

The collector already uses a store-load fence on x86 just after setting the cellState and
before visiting the object. The mutator needs to do the same. But we cannot put a
store-load fence of any kind before store barriers, because that causes enormous slow
downs. In the worst case, Octane/richards slowed down by 90%! That's crazy! However, the
overall slow downs were small enough (0-15% on benchmark suite aggregates) that it would be
reasonable if the slow down only happened while the GC was running. Then, the concurrent GC
would lift throughput-while-collecting from 0% of peak to 85% of peak. This changes the
barrier so that it looks like this:

    if (object->cellState <= heap.sneakyBlackThreshold)
        slowPath(object)

Where sneakyBlackThreshold is the normal blackThreshold when we're not collecting, or a
tautoligical threshold (that makes everything look black) when we are collecting. This
turns out to not be any more expensive than the barrier in tip of tree when the GC is not
running, or a 0-15% slow-down when it is "running". (Of course we don't run the GC
concurrently yet. I still have more work to do.) The slowPath() does some extra work to
check if we are concurrently collecting; if so, it does a fence and rechecks if the object
really did need that barrier.

This also reintroduces elimination of redundant store barriers, which was lost in the last
store barrier change. We can only do it when there is no possibility of GC, exit, or
exceptions between the two store barriers. We could remove the exit/exception limitation if
we taught OSR exit how to buffer store barriers, which is an insane thing to do considering
that I've never been able to detect a win from redundant store barrier elimination. I just
want us to have it for stupidly obvious situations, like a tight sequence of stores to the
same object. This same optimization also sometimes strength-reduces the store barrier so
that it uses a constant black threshold rather than the sneaky one, thereby saving one
load.

Even with all of those optimizations, I still had problems with barrier cost. I found that one
of the benchmarks that was being hit particularly hard was JetStream/regexp-2010. Fortunately
that benchmark does most of its barriers in a tight C++ loop in RegExpMatchesArray.h. When we
know what we're doing, we can defer GC around a bunch of object initializations and then remove
all of the barriers between any of the objects allocated within the deferral. Unfortunately,
our GC deferral mechanism isn't really performant enough to make this be a worthwhile
optimization. The most efficient version of such an optimization that I could come up with was
to have a DeferralContext object that houses a boolean that is false by default, but the GC
writes true into it if it would have wanted to GC. You thread a pointer to the deferralContext
through all of your allocations. This kind of mechanism has the overhead of a zero
initialization on the stack on entry and a zero check on exit. This is probably even efficient
enough that we could start thinking about having the DFG use it, for example if we found a
bounded-time section of code with a lot of barriers and entry/exit sites that aren't totally
wacky. This optimization took this patch from 0.68% JetStream regressed to neutral, according
to my latest data.

Finally, an earlier version of this change put the store-load fence in B3 IR, so I ended up
adding FTLOutput support for it and AbstractHeapRepository magic for decorating the heaps.
I think we might as well keep that, it'll be useful.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::branch32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::branch32):
(JSC::MacroAssemblerX86_64::branch64): Deleted.
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGAbstractHeap.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGClobbersExitState.cpp:
(JSC::DFG::clobbersExitState):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.h:
(JSC::DFG::Node::isStoreBarrier):
* dfg/DFGNodeType.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStoreBarrier):
(JSC::DFG::SpeculativeJIT::storeToWriteBarrierBuffer): Deleted.
(JSC::DFG::SpeculativeJIT::writeBarrier): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileBaseValueStoreBarrier): Deleted.
(JSC::DFG::SpeculativeJIT::writeBarrier): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileBaseValueStoreBarrier): Deleted.
(JSC::DFG::SpeculativeJIT::writeBarrier): Deleted.
* dfg/DFGStoreBarrierClusteringPhase.cpp: Added.
(JSC::DFG::performStoreBarrierClustering):
* dfg/DFGStoreBarrierClusteringPhase.h: Added.
* dfg/DFGStoreBarrierInsertionPhase.cpp:
* dfg/DFGStoreBarrierInsertionPhase.h:
* ftl/FTLAbstractHeap.h:
(JSC::FTL::AbsoluteAbstractHeap::at):
(JSC::FTL::AbsoluteAbstractHeap::operator[]):
* ftl/FTLAbstractHeapRepository.cpp:
(JSC::FTL::AbstractHeapRepository::decorateFenceRead):
(JSC::FTL::AbstractHeapRepository::decorateFenceWrite):
(JSC::FTL::AbstractHeapRepository::computeRangesAndDecorateInstructions):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileStoreBarrier):
(JSC::FTL::DFG::LowerDFGToB3::storageForTransition):
(JSC::FTL::DFG::LowerDFGToB3::lazySlowPath):
(JSC::FTL::DFG::LowerDFGToB3::emitStoreBarrier):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::fence):
(JSC::FTL::Output::absolute):
* ftl/FTLOutput.h:
* heap/CellState.h:
(JSC::isWithinThreshold):
(JSC::isBlack):
* heap/Heap.cpp:
(JSC::Heap::writeBarrierSlowPath):
* heap/Heap.h:
(JSC::Heap::barrierShouldBeFenced):
(JSC::Heap::addressOfBarrierShouldBeFenced):
(JSC::Heap::sneakyBlackThreshold):
(JSC::Heap::addressOfSneakyBlackThreshold):
* heap/HeapInlines.h:
(JSC::Heap::writeBarrier):
(JSC::Heap::writeBarrierWithoutFence):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::jumpIfIsRememberedOrInEdenWithoutFence):
(JSC::AssemblyHelpers::sneakyJumpIfIsRememberedOrInEden):
(JSC::AssemblyHelpers::jumpIfIsRememberedOrInEden):
(JSC::AssemblyHelpers::storeBarrierStoreLoadFence):
(JSC::AssemblyHelpers::jumpIfStoreBarrierStoreLoadFenceNotNeeded):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitWriteBarrier):
(JSC::JIT::privateCompilePutByVal):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_by_id):
* llint/LowLevelInterpreter.asm:
* offlineasm/x86.rb:
* runtime/Options.h:

Source/WTF:

Added clearRange(), which quickly clears a range of bits. This turned out to be useful for
a DFG optimization pass.

* wtf/FastBitVector.cpp:
(WTF::FastBitVector::clearRange):
* wtf/FastBitVector.h:

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

2 years agoURLParser should properly handle unexpected periods and overflows in IPv4 addresses
achristensen@apple.com [Wed, 28 Sep 2016 21:53:53 +0000 (21:53 +0000)]
URLParser should properly handle unexpected periods and overflows in IPv4 addresses
https://bugs.webkit.org/show_bug.cgi?id=162655

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
* platform/URLParser.h:

Tools:

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

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

2 years agoDisable flaky API test WebKit2.AutoLayoutIntegration.
ryanhaddad@apple.com [Wed, 28 Sep 2016 21:42:34 +0000 (21:42 +0000)]
Disable flaky API test WebKit2.AutoLayoutIntegration.
https://bugs.webkit.org/show_bug.cgi?id=160284

Unreviewed test gardening.

* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(TEST):

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

2 years agoFix race condition in StringView's UnderlyingString lifecycle management.
mark.lam@apple.com [Wed, 28 Sep 2016 21:30:27 +0000 (21:30 +0000)]
Fix race condition in StringView's UnderlyingString lifecycle management.
https://bugs.webkit.org/show_bug.cgi?id=162702

Reviewed by Geoffrey Garen.

There 2 relevant functions at play:

void StringView::setUnderlyingString(const StringImpl* string)
{
    UnderlyingString* underlyingString;
    if (!string)
        underlyingString = nullptr;
    else {
        std::lock_guard<StaticLock> lock(underlyingStringsMutex);
        auto result = underlyingStrings().add(string, nullptr);
        if (result.isNewEntry)
            result.iterator->value = new UnderlyingString(*string);
        else
            ++result.iterator->value->refCount;
        underlyingString = result.iterator->value; // Point P2.
    }
    adoptUnderlyingString(underlyingString); // Point P5.
}

... and ...

void StringView::adoptUnderlyingString(UnderlyingString* underlyingString)
{
    if (m_underlyingString) {
        // Point P0.
        if (!--m_underlyingString->refCount) {
            if (m_underlyingString->isValid) { // Point P1.
                std::lock_guard<StaticLock> lock(underlyingStringsMutex);
                underlyingStrings().remove(&m_underlyingString->string); // Point P3.
            }
            delete m_underlyingString; // Point P4.
        }
    }
    m_underlyingString = underlyingString;
}

Imagine the following scenario:

1. Thread T1 has been using an UnderlyingString U1, and is now done with it.
   T1 runs up to point P1 in adoptUnderlyingString(), and is blocked waiting for
   the underlyingStringsMutex (which is currently being held by Thread T2).
2. Context switch to Thread T2.
   T2 wants to use UnderlyingString U1, and runs up to point P2 in setUnderlyingString()
   and releases the underlyingStringsMutex.
   Note: T2 thinks it has successfully refCounted U1, and therefore U1 is safe to use.
3. Context switch to Thread T1.
   T1 acquires the underlyingStringsMutex, and proceeds to remove it from the
   underlyingStrings() map (see Point P3).  It thinks it has successfully done so
   and proceeds to delete U1 (see Point P4).
4. Context switch to Thread T2.
   T2 proceeds to use U1 (see Point P5 in setUnderlyingString()).
   Note: U1 has already been freed.  This is a use after free.

The fix is to acquire the underlyingStringsMutex at Point P0 in adoptUnderlyingString()
instead of after P1.  This ensures that the decrementing of the UnderlyingString
refCount and its removal from the underlyingStrings() map is done as an atomic unit.

Note: If you look in StringView.cpp, you see another setUnderlyingString() which
takes a StringView otherString.  This version of setUnderlyingString() can only
be called from within the same thread that created the other StringView.  As a
result, here, we are guaranteed that the UnderlyingString refCount is never zero,
and there's no other threat of another thread trying to delete the UnderlyingString
while we adopt it.  Hence, we don't need to acquire the underlyingStringsMutex
here.

This race condition was found when running layout tests fetch/fetch-worker-crash.html
and storage/indexeddb/modern/opendatabase-versions.html when CHECK_STRINGVIEW_LIFETIME
is enabled.  This issue resulted in those tests crashing due to a use-after-free.

* wtf/text/StringView.cpp:
(WTF::StringView::adoptUnderlyingString):
(WTF::StringView::setUnderlyingString):

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

2 years agoSome media tests are crashing due to soft-linking failures
wenson_hsieh@apple.com [Wed, 28 Sep 2016 21:27:29 +0000 (21:27 +0000)]
Some media tests are crashing due to soft-linking failures
https://bugs.webkit.org/show_bug.cgi?id=162698

Reviewed by Jer Noble.

We should be handling soft-linking failures for MRMediaRemoteSetNowPlayingVisibility gracefully. Guards these
calls with canLoad_MediaRemote_MRMediaRemoteSetParentApplication and also use the
SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER macro when soft linking.

* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:

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

2 years agoImprove useCodeCache Option description string.
joepeck@webkit.org [Wed, 28 Sep 2016 21:23:29 +0000 (21:23 +0000)]
Improve useCodeCache Option description string.

* runtime/Options.h:
Address late review comments and clarify description.

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

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

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

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

Tools:

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

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

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

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

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

Tools:

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

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

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

Reviewed by Tim Horton.

Source/WebCore:

Covered by a new API test.

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

Tools:

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

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

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

* bindings/js/ios/TouchConstructors.cpp:

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

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

Unreviewed test gardening.

* TestExpectations:

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

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

Reviewed by Ryosuke Niwa.

Source/WebCore:

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

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

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

LayoutTests:

Add layout test coverage.

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

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

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

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

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

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

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

Reviewed by Geoffrey Garen.

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

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

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

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

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

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

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

Reviewed by Simon Fraser.

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

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

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

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

Unreviewed test gardening.

* TestExpectations:

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

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

Unreviewed test gardening.

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

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

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

* woff2/CMakeLists.txt:

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

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

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

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

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

Source/WebCore:

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

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

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

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

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

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

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

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

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

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

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

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

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

Reviewed by Alex Christensen.

* woff2/CMakeLists.txt:

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

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

Rubber stamped by Keith Miller.

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

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

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

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

Reviewed by Jer Noble.

Source/WebCore:

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

Introduces 2 new unit tests in NowPlayingControlsTests.

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

Source/WebKit2:

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

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

Tools:

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

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

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

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

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

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

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

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

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

Roll r206506 back in since the build fix landed in r206521

Reverted changeset:

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

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

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

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

Source/WebCore:

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

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

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

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

LayoutTests:

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

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

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

Reviewed by Zalan Bujtas.

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

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

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

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

Reverted changeset:

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

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

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

Reviewed by Brent Fulgham.

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

* DumpRenderTree/TestRunner.cpp:

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

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

Reviewed by Eric Carlson.

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

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

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

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

Reviewed by Carlos Garcia Campos.

Source/WebCore:

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

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

Tools:

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

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

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

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

Reviewed by Eric Carlson.

Source/WebCore:

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

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

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

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

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

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

LayoutTests:

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

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

"Reviewed" by Carlos Garcia Campos.

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

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

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

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

Source/WebCore:

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

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

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

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

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

Updated the tests expectations of the bindings.

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

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

LayoutTests:

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

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

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

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

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

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

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

Test: fast/text/woff2-totalsfntsize.html

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

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

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

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

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

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

Reviewed by Carlos Garcia Campos.

* platform/gtk/UserAgentGtk.cpp:

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

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

Reviewed by Michael Catanzaro.

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

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

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

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

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

No change in behaviour.

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

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

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

Reviewed by Alex Christensen.

* Source/cmake/OptionsGTK.cmake:

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

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

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

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

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

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

Reviewed by Michael Catanzaro.

Source/WebKit2:

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

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

Tools:

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

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

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

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

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

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

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

No new tests, no new behaviours.

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

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