WebKit-https.git
2 years agoAdd CSS -webkit-appearance property for Apple Pay buttons
andersca@apple.com [Thu, 15 Sep 2016 17:45:56 +0000 (17:45 +0000)]
Add CSS -webkit-appearance property for Apple Pay buttons
https://bugs.webkit.org/show_bug.cgi?id=161986

Reviewed by Dean Jackson.

Add a new -webkit-appearance property, "-apple-pay-button".
Also, add two properties, "-apple-pay-button-type" and "-apple-pay-button-style".

* WebCore.xcodeproj/project.pbxproj:
Add RenderThemeCocoa.h and RenderThemeCocoa.mm.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonStyle):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
Add ApplePayButtonStyle and ApplePayButtonType conversion routines.

* css/CSSPropertyNames.in:
Add -apple-pay-button-style and -apple-pay-button-type.

* css/CSSValueKeywords.in:
Add CSS values.

* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.

(WebCore::isAppleLegacyCSSPropertyKeyword):
New function that returns whether the CSS property should be rewritten to -webkit-.
We want to rewrite -apple- but not -apple-pay-.

(WebCore::cssPropertyID):
Use the newly added isAppleLegacyCSSPropertyKeyword.

(WebCore::isAppleLegacyCSSValueKeyword):
Check for "-apple-pay-" in addition to "-apple-system-".

* platform/ThemeTypes.h:
Add ApplePayButtonPart.

* platform/spi/cocoa/PassKitSPI.h:
Add PKDrawApplePayButton declaration.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
Handle ApplePayButtonPart.

(WebCore::RenderTheme::paint):
Handle ApplePayButtonPart.

* rendering/RenderTheme.h:
(WebCore::RenderTheme::adjustApplePayButtonStyle):
(WebCore::RenderTheme::paintApplePayButton):
Add new functions.

* rendering/RenderThemeCocoa.h: Added.
* rendering/RenderThemeCocoa.mm: Added.
(WebCore::RenderThemeCocoa::adjustApplePayButtonStyle):
Adjust the minimum width and minimum height accordingly.

(WebCore::toPKPaymentButtonStyle):
(WebCore::toPKPaymentButtonType):
Helper functions that convert our WebCore types to PK types.

(WebCore::RenderThemeCocoa::paintApplePayButton):
Call PKDrawApplePayButton.

* rendering/RenderThemeIOS.h:
* rendering/RenderThemeMac.h:
Inherit from RenderThemeCocoa.

* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::applePayButtonStyle):
(WebCore::RenderStyle::applePayButtonType):
(WebCore::RenderStyle::setApplePayButtonStyle):
(WebCore::RenderStyle::setApplePayButtonType):
(WebCore::RenderStyle::initialApplePayButtonStyle):
(WebCore::RenderStyle::initialApplePayButtonType):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
Add new style members for the button style and button type properties.

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

2 years agoThere is no good reason for WeakBlock to care about newly allocated objects
fpizlo@apple.com [Thu, 15 Sep 2016 17:17:07 +0000 (17:17 +0000)]
There is no good reason for WeakBlock to care about newly allocated objects
https://bugs.webkit.org/show_bug.cgi?id=162006

Reviewed by Geoffrey Garen.

WeakBlock scans itself in two modes:

visit: if a Weak in the block belongs to an unmarked object, ask the Weak to consider whether
    it should do things.

reap: if a Weak in a block belongs to an unmarked object, delete the Weak.

Except that "unmarked" has a peculiar meaning: WeakBlock defines it as
!markedOrNewlyAllocated. So, a newly allocated object will never be consulted about anything.
That sounds scary until you realize that newlyAllocated must have been cleared before we even
got here.

So, we were paying the price of checking newlyAllocated for no reason. This switches the code
to using isMarked(). I don't know why the code previously checked newlyAllocated, but I do
trust my reasoning.

* heap/LargeAllocation.h:
(JSC::LargeAllocation::isMarkedDuringWeakVisiting):
(JSC::LargeAllocation::isMarkedOrNewlyAllocatedDuringWeakVisiting): Deleted.
* heap/MarkedBlock.h:
(JSC::MarkedBlock::isMarkedDuringWeakVisiting):
(JSC::MarkedBlock::isMarkedOrNewlyAllocatedDuringWeakVisiting): Deleted.
* heap/WeakBlock.cpp:
(JSC::WeakBlock::specializedVisit):
(JSC::WeakBlock::reap):

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

2 years ago[GTK] Unreviewed test gardening
jfernandez@igalia.com [Thu, 15 Sep 2016 17:10:40 +0000 (17:10 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=162019

* platform/gtk/TestExpectations:
* platform/gtk/fast/forms/menulist-clip-expected.png:
* platform/gtk/fast/forms/menulist-clip-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt:

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

2 years ago[css-grid] Implement fit-content track size
svillar@igalia.com [Thu, 15 Sep 2016 17:07:14 +0000 (17:07 +0000)]
[css-grid] Implement fit-content track size
https://bugs.webkit.org/show_bug.cgi?id=161379

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

This implements the new <fit-content> track size which is defined as follows: "Represents
the formula min(max-content, max(auto, argument)), which is calculated similar to auto
(i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is
greater than the auto minimum."

From the parsing POV fit-content was implemented as a new type of function which only takes
one argument. That forced us to refactor some code because minmax() was the only allowed
function for <track-size>s so far.

The implementation key is a new attribute in GridTrack called growthLimitCap which is
precisely the single attribute of fit-content(). Some parts of the track sizing algorithm
were adapted to this change like for example the sorting of tracks by growth potential (we
need to consider the caps).

Tests: fast/css-grid-layout/fit-content-columns.html
fast/css-grid-layout/fit-content-rows.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize): Added support for fit-content sizes.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::createGridTrackSize): Added support for fit-content sizes.
* css/parser/CSSParser.cpp:
(WebCore::isGridTrackFixedSized): Added support for fit-content sizes.
(WebCore::CSSParser::parseGridTrackSize): Added support for parsing fit-content() functions.
* css/parser/CSSPropertyParser.cpp: Added support for parsing fit-content() functions so
it'll be available once we switch to the new parser.
* rendering/RenderGrid.cpp:
(WebCore::GridTrack::baseSize): Just return a LayoutUnit, the return value optimization will
keep it fast in any case.
(WebCore::GridTrack::growthLimit): Ditto.
(WebCore::GridTrack::setGrowthLimit): Added an ASSERT to check that the growth limit is
never higher than the cap.
(WebCore::GridTrack::infiniteGrowthPotential):
(WebCore::GridTrack::plannedSize): Just return a LayoutUnit, the return value optimization will
keep it fast in any case.
(WebCore::GridTrack::tempSize): Just return a LayoutUnit, the return value optimization will
keep it fast in any case.
(WebCore::GridTrack::setTempSize): Added as we no longer return a reference in tempSize().
(WebCore::GridTrack::growTempSize): New utility function which increases the tempSize.
(WebCore::GridTrack::setInfinitelyGrowable):
(WebCore::GridTrack::setGrowthLimitCap): Added.
(WebCore::GridTrack::growthLimitCap): Ditto.
(WebCore::GridTrack::growthLimitIsInfinite): Made private.
(WebCore::RenderGrid::GridSizingData::freeSpace): Renamed from freeSpaceForDirection.
(WebCore::RenderGrid::GridSizingData::availableSpace): We now cache the available space as
it is used to compute relative (percentage) sizes.
(WebCore::RenderGrid::GridSizingData::setAvailableSpace): Ditto.
(WebCore::RenderGrid::GridSizingData::setFreeSpace): Renamed from setFreeSpaceForDirection.
(WebCore::RenderGrid::computeTrackSizesForDirection): Receives the available space instead
of the free space.
(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Properly initialize free and available
spaces.
(WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Use available space to initialize the
track sizes. Also use sizingOperation to decide whether or not sizes are indefinite. Last
but not least, added support for fit-content tracks.
(WebCore::RenderGrid::computeUsedBreadthOfMinLength): Pass a GridTrackSize instead of a GridLength.
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Ditto.
(WebCore::RenderGrid::gridTrackSize): Added support for fit-content.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Ditto.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Ditto.
(WebCore::trackSizeForTrackSizeComputationPhase):
(WebCore::sortByGridTrackGrowthPotential): Reworked the function so it properly sorts tracks
with growth limit caps to support fit-content().
(WebCore::clampGrowthShareIfNeeded): Clamps the given growthShare passed as argument to the
track growth limit cap.
(WebCore::RenderGrid::distributeSpaceToTracks): Use the new setTempSize() method. Also sort
the selected tracks to grow over growth limits in order to respect the track caps eventually
set by fit-content (otherwise those tracks could indefinitely grow over the specified value).
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Use the new defined functions.
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Use freeSpace().
(WebCore::RenderGrid::populateGridPositionsForDirection): Ditto.
(WebCore::GridTrack::infinitelyGrowable): Deleted.
(WebCore::RenderGrid::GridSizingData::freeSpaceForDirection): Deleted.
(WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection): Deleted.
(WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Deleted.
* rendering/RenderGrid.h: Changed the signature of some methods. Moved
TrackSizeComputationPhase out of the RenderGrid class.
* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::GridTrackSize): Added some extra documentation. Added a new
attribute to the constructor to support fit-content GridTrackSizes.
(WebCore::GridTrackSize::fitContentTrackBreadth): New method which returns the growth limit
cap set by fit-content().
(WebCore::GridTrackSize::minTrackBreadth):
(WebCore::GridTrackSize::isFitContent): Added.
(WebCore::GridTrackSize::length): Deleted.
(WebCore::GridTrackSize::isPercentage): Deleted.

LayoutTests:

New tests to verify that fit-content track sizes work as expected for columns and for
rows. Also added some more test cases to verify that we properly parse fit-content().

* fast/css-grid-layout/fit-content-columns-expected.html: Added.
* fast/css-grid-layout/fit-content-columns.html: Added.
* fast/css-grid-layout/fit-content-rows-expected.html: Added.
* fast/css-grid-layout/fit-content-rows.html: Added.
* fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-auto-columns-rows-get-set.html:
* fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-columns-rows-get-set.html:
* fast/css-grid-layout/resources/grid-columns-rows-get-set.js:

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

2 years agoDisable failing API WebKit2.DataDetectionReferenceDate until it can be investigated.
ryanhaddad@apple.com [Thu, 15 Sep 2016 16:59:10 +0000 (16:59 +0000)]
Disable failing API WebKit2.DataDetectionReferenceDate until it can be investigated.
https://bugs.webkit.org/show_bug.cgi?id=161967

Unreviewed test gardening.

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

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

2 years agoMarking transitions/3d/interrupted-transition.html as flaky on ios-simulator.
ryanhaddad@apple.com [Thu, 15 Sep 2016 16:59:08 +0000 (16:59 +0000)]
Marking transitions/3d/interrupted-transition.html as flaky on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=130972

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

2 years agoUnreviewed, rolling out r205931.
commit-queue@webkit.org [Thu, 15 Sep 2016 16:51:12 +0000 (16:51 +0000)]
Unreviewed, rolling out r205931.
https://bugs.webkit.org/show_bug.cgi?id=162021

Tests for this change fail on 32-bit JSC bots (Requested by
ryanhaddad on #webkit).

Reverted changeset:

"[JSC] Make the rounding-related nodes support any type"
https://bugs.webkit.org/show_bug.cgi?id=161895
http://trac.webkit.org/changeset/205931

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

2 years ago[css-grid] Fix a dangling reference
svillar@igalia.com [Thu, 15 Sep 2016 16:32:15 +0000 (16:32 +0000)]
[css-grid] Fix a dangling reference
https://bugs.webkit.org/show_bug.cgi?id=161739

Reviewed by Alexey Proskuryakov.

The code was trying to get a reference to a private attribute of a temporary object returned
by gridTrackSize().

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):

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

2 years agoUnreviewed, rolling out r205966.
svillar@igalia.com [Thu, 15 Sep 2016 15:51:18 +0000 (15:51 +0000)]
Unreviewed, rolling out r205966.

Triggered some assertions

Reverted changeset:

"[css-grid] Implement fit-content track size"
https://bugs.webkit.org/show_bug.cgi?id=161379
http://trac.webkit.org/changeset/205966

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

2 years ago[Win] run-api-tests is failing.
pvollan@apple.com [Thu, 15 Sep 2016 15:46:59 +0000 (15:46 +0000)]
[Win] run-api-tests is failing.
https://bugs.webkit.org/show_bug.cgi?id=162015

Reviewed by Brent Fulgham.

MSVC is not interpreting C++ string literals with unicode characters correctly when the source file
doesn't contain encoding information. Save the file with utf8 encoding with signature.

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:

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

2 years agoCleanup RenderLayer::shouldBeNormalFlowOnly
zalan@apple.com [Thu, 15 Sep 2016 15:42:47 +0000 (15:42 +0000)]
Cleanup RenderLayer::shouldBeNormalFlowOnly
https://bugs.webkit.org/show_bug.cgi?id=161981

Reviewed by Simon Fraser.

Source/WebCore:

This patch changes the logic of figuring about if a particular layer is normal flow only by simply checking
if the layer creates a stacking context. If it does, we assume that it can't be a normal flow layer anymore.
This patch slightly changes behaviour by making layers with isolation and reflection to be non normal flow layers anymore.

Covered by existing testcases.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

LayoutTests:

Rebaselining.

* fast/table/overflow-table-collapsed-borders-section-self-painting-layer-painting-expected.txt:

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

2 years agotest262: Should be a SyntaxError for duplicate parameter names in function with defau...
commit-queue@webkit.org [Thu, 15 Sep 2016 15:40:55 +0000 (15:40 +0000)]
test262: Should be a SyntaxError for duplicate parameter names in function with default parameters
https://bugs.webkit.org/show_bug.cgi?id=162013

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

JSTests:

* stress/es6-default-parameters.js:
* test262.yaml:

Source/JavaScriptCore:

https://tc39.github.io/ecma262/#sec-function-definitions-static-semantics-early-errors
It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
false and BoundNames of FormalParameterList contains any duplicate elements.

Non-simple parameter lists include rest parameters, destructuring,
and default parameters.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFormalParameters):
Previously, we were not failing if there were default parameters
early in the parameter list that were not yet identified as duplicates
and simple parameters later were duplicates. Now, we fail if there
are default parameters anywhere in the parameter list with a duplicate.

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

2 years agoMove --no-sample-on-timeout to config.json for each bot
jbedard@apple.com [Thu, 15 Sep 2016 15:30:00 +0000 (15:30 +0000)]
Move --no-sample-on-timeout to config.json for each bot
https://bugs.webkit.org/show_bug.cgi?id=161964

Reviewed by Daniel Bates.

Roll out changes from 205573 and move them into config.json.  At this time, only macOS and iOS simulator sample a process on timeout, —no-sample-on-timeout is unneeded for GTK, EFL and Windows.

* BuildSlaveSupport/build.webkit.org-config/config.json: Each bot now independently defines if it will be running sample on timeout.
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunWebKitTests.start): Rolled out changes from 205573.

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

2 years agojs/stringimpl-to-jsstring-on-large-strings tests consume huge memory
ossy@webkit.org [Thu, 15 Sep 2016 11:18:08 +0000 (11:18 +0000)]
js/stringimpl-to-jsstring-on-large-strings tests consume huge memory
https://bugs.webkit.org/show_bug.cgi?id=159807

Reviewed by Saam Barati.

Tools:

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunRemoteJavaScriptCoreTests.start): JSCOnly bots are memory limited devices, tests should run with --memory-limited option.
* Scripts/run-javascriptcore-tests:
(runJSCStressTests): Pass through --memory-limited option to run-jsc-stress-tests.
* Scripts/run-jsc-stress-tests: Typo fix.

LayoutTests:

* js/script-tests/stringimpl-to-jsstring-on-large-strings-1.js: Skipped on memory limited devices.
* js/script-tests/stringimpl-to-jsstring-on-large-strings-2.js: Skipped on memory limited devices.
* js/script-tests/stringimpl-to-jsstring-on-large-strings-3.js: Skipped on memory limited devices.

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

2 years ago[css-grid] Implement fit-content track size
svillar@igalia.com [Thu, 15 Sep 2016 09:45:36 +0000 (09:45 +0000)]
[css-grid] Implement fit-content track size
https://bugs.webkit.org/show_bug.cgi?id=161379

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

This implements the new <fit-content> track size which is defined as follows: "Represents
the formula min(max-content, max(auto, argument)), which is calculated similar to auto
(i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is
greater than the auto minimum."

From the parsing POV fit-content was implemented as a new type of function which only takes
one argument. That forced us to refactor some code because minmax() was the only allowed
function for <track-size>s so far.

The implementation key is a new attribute in GridTrack called growthLimitCap which is
precisely the single attribute of fit-content(). Some parts of the track sizing algorithm
were adapted to this change like for example the sorting of tracks by growth potential (we
need to consider the caps).

Tests: fast/css-grid-layout/fit-content-columns.html
fast/css-grid-layout/fit-content-rows.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize): Added support for fit-content sizes.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::createGridTrackSize): Added support for fit-content sizes.
* css/parser/CSSParser.cpp:
(WebCore::isGridTrackFixedSized): Added support for fit-content sizes.
(WebCore::CSSParser::parseGridTrackSize): Added support for parsing fit-content() functions.
* css/parser/CSSPropertyParser.cpp: Added support for parsing fit-content() functions so
it'll be available once we switch to the new parser.
* rendering/RenderGrid.cpp:
(WebCore::GridTrack::baseSize): Just return a LayoutUnit, the return value optimization will
keep it fast in any case.
(WebCore::GridTrack::growthLimit): Ditto.
(WebCore::GridTrack::setGrowthLimit): Added an ASSERT to check that the growth limit is
never higher than the cap.
(WebCore::GridTrack::infiniteGrowthPotential):
(WebCore::GridTrack::plannedSize): Just return a LayoutUnit, the return value optimization will
keep it fast in any case.
(WebCore::GridTrack::tempSize): Just return a LayoutUnit, the return value optimization will
keep it fast in any case.
(WebCore::GridTrack::setTempSize): Added as we no longer return a reference in tempSize().
(WebCore::GridTrack::growTempSize): New utility function which increases the tempSize.
(WebCore::GridTrack::setInfinitelyGrowable):
(WebCore::GridTrack::setGrowthLimitCap): Added.
(WebCore::GridTrack::growthLimitCap): Ditto.
(WebCore::GridTrack::growthLimitIsInfinite): Made private.
(WebCore::RenderGrid::GridSizingData::freeSpace): Renamed from freeSpaceForDirection.
(WebCore::RenderGrid::GridSizingData::availableSpace): We now cache the available space as
it is used to compute relative (percentage) sizes.
(WebCore::RenderGrid::GridSizingData::setAvailableSpace): Ditto.
(WebCore::RenderGrid::GridSizingData::setFreeSpace): Renamed from setFreeSpaceForDirection.
(WebCore::RenderGrid::computeTrackSizesForDirection): Receives the available space instead
of the free space.
(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Properly initialize free and available
spaces.
(WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Use available space to initialize the
track sizes. Also use sizingOperation to decide whether or not sizes are indefinite. Last
but not least, added support for fit-content tracks.
(WebCore::RenderGrid::computeUsedBreadthOfMinLength): Pass a GridTrackSize instead of a GridLength.
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Ditto.
(WebCore::RenderGrid::gridTrackSize): Added support for fit-content.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Ditto.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Ditto.
(WebCore::trackSizeForTrackSizeComputationPhase):
(WebCore::sortByGridTrackGrowthPotential): Reworked the function so it properly sorts tracks
with growth limit caps to support fit-content().
(WebCore::clampGrowthShareIfNeeded): Clamps the given growthShare passed as argument to the
track growth limit cap.
(WebCore::RenderGrid::distributeSpaceToTracks): Use the new setTempSize() method. Also sort
the selected tracks to grow over growth limits in order to respect the track caps eventually
set by fit-content (otherwise those tracks could indefinitely grow over the specified value).
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Use the new defined functions.
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Use freeSpace().
(WebCore::RenderGrid::populateGridPositionsForDirection): Ditto.
(WebCore::GridTrack::infinitelyGrowable): Deleted.
(WebCore::RenderGrid::GridSizingData::freeSpaceForDirection): Deleted.
(WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection): Deleted.
(WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Deleted.
* rendering/RenderGrid.h: Changed the signature of some methods. Moved
TrackSizeComputationPhase out of the RenderGrid class.
* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::GridTrackSize): Added some extra documentation. Added a new
attribute to the constructor to support fit-content GridTrackSizes.
(WebCore::GridTrackSize::fitContentTrackBreadth): New method which returns the growth limit
cap set by fit-content().
(WebCore::GridTrackSize::minTrackBreadth):
(WebCore::GridTrackSize::isFitContent): Added.
(WebCore::GridTrackSize::length): Deleted.
(WebCore::GridTrackSize::isPercentage): Deleted.

LayoutTests:

New tests to verify that fit-content track sizes work as expected for columns and for
rows. Also added some more test cases to verify that we properly parse fit-content().

* fast/css-grid-layout/fit-content-columns-expected.html: Added.
* fast/css-grid-layout/fit-content-columns.html: Added.
* fast/css-grid-layout/fit-content-rows-expected.html: Added.
* fast/css-grid-layout/fit-content-rows.html: Added.
* fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-auto-columns-rows-get-set.html:
* fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-columns-rows-get-set.html:
* fast/css-grid-layout/resources/grid-columns-rows-get-set.js:

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

2 years agoFix build warnings in the mediastream code
commit-queue@webkit.org [Thu, 15 Sep 2016 09:24:56 +0000 (09:24 +0000)]
Fix build warnings in the mediastream code
https://bugs.webkit.org/show_bug.cgi?id=161957

Patch by Alejandro G. Castro <alex@igalia.com> on 2016-09-15
Reviewed by Philippe Normand.

* platform/mediastream/MediaConstraints.cpp:
(WebCore::MediaConstraint::create): Added assertion and mock return.
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
(WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint):
Added assertion and mock return.
(WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint):
Added assertion and mock return.

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

2 years agoRebase binding tests after r205953
commit-queue@webkit.org [Thu, 15 Sep 2016 09:15:51 +0000 (09:15 +0000)]
Rebase binding tests after r205953
https://bugs.webkit.org/show_bug.cgi?id=162012

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-15

* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
(WebCore::jsTestNodePrototypeFunctionTestWorkerPromisePromise):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):

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

2 years ago[WebRTC][OpenWebRTC] crash in maybeHandleChangeMutedState
commit-queue@webkit.org [Thu, 15 Sep 2016 08:47:35 +0000 (08:47 +0000)]
[WebRTC][OpenWebRTC] crash in maybeHandleChangeMutedState
https://bugs.webkit.org/show_bug.cgi?id=161619

Source/WebCore:

Added OpenWebRTC support to the RealtimeMediaSource mock class.

Patch by Alejandro G. Castro <alex@igalia.com> on 2016-09-15
Reviewed by Eric Carlson.

Fixed tests.

* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr): Allowed
inheritance of the class, required to use it when creating the
mock class. Added a new constructor to create the class with null
mediastream.
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource): Use
the new BaseRealtimeMediaSourceClass in the constructor.
* platform/mock/MockRealtimeMediaSource.h: Added a new
BaseRealtimeMediaSourceClass defined using the
RealtimeMediaSourceOwr class for OpenWebRTC platform.

LayoutTests:

Patch by Alejandro G. Castro <alex@igalia.com> on 2016-09-15
Reviewed by Eric Carlson.

* platform/gtk/TestExpectations: Modify the expectations, the
tests do not crash anymore.

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

2 years ago[css-grid] Fix intrinsic size computation with flexible sized tracks
svillar@igalia.com [Thu, 15 Sep 2016 08:42:10 +0000 (08:42 +0000)]
[css-grid] Fix intrinsic size computation with flexible sized tracks
https://bugs.webkit.org/show_bug.cgi?id=161903

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

This is fixing a regression added in r192154. When computing the min content size of a grid
container (min preferred logical width) we should not take into account the fr tracks. As
stated in the early versions of the spec that size is the sum of the tracks' base sizes
before running the maximize tracks step.

That regression was causing sizing issues in grids with fr tracks both when under
min|max-content constrains and also when used as grid items (in nested grids).

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):

LayoutTests:

Added a couple of new test cases, grid with fr tracks inside a container with intrinsic
dimensions and and grid with fr tracks inside another grid with fr tracks.

* fast/css-grid-layout/flex-and-intrinsic-sizes-expected.txt:
* fast/css-grid-layout/flex-and-intrinsic-sizes.html:

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

2 years ago[css-grid] Too many gaps with trailing collapsing tracks
svillar@igalia.com [Thu, 15 Sep 2016 07:40:20 +0000 (07:40 +0000)]
[css-grid] Too many gaps with trailing collapsing tracks
https://bugs.webkit.org/show_bug.cgi?id=161905

Reviewed by Darin Adler.

Source/WebCore:

The total number and size of gaps were incorrectly computed whenever there were trailing
collapsed tracks (with collapsed gaps). The problem was that we were trying to optimize too
much the amount of hash table queries required to know the gaps between two lines. We were
considering that a gap always exist between 2 consecutive tracks if the first one is not
empty. That's generally true (for both NOTEMPTY|NOTEMPTY and NOTEMPTY|EMPTY+|NOTEMPTY
sequences) but not for all the cases (NOTEMPTY|EMPTY+).

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::guttersSize):

LayoutTests:

Added new test cases to check that trailing collapsed tracks do not add gutters at the end.

* fast/css-grid-layout/grid-auto-fit-columns-expected.txt:
* fast/css-grid-layout/grid-auto-fit-columns.html:

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

2 years agocallPromiseFunction should be made usable for custom binding code
commit-queue@webkit.org [Thu, 15 Sep 2016 07:21:18 +0000 (07:21 +0000)]
callPromiseFunction should be made usable for custom binding code
https://bugs.webkit.org/show_bug.cgi?id=161961

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-15
Reviewed by Darin Adler.

Source/WebCore:

Covered by updated test.

* bindings/js/JSDOMBinding.h:
(WebCore::castThisValue): Utility function to cast this value to a specific type.
* bindings/js/JSDOMPromise.h:
(WebCore::callPromiseFunction): Updated to take real promise function as a template parameter
for improved efficiency. Added workerMode template parameter.
(WebCore::bindingPromiseFunctionAdapter): Function signature adaptor.
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevicesGetUserMediaPromiseFunction):
(WebCore::JSMediaDevices::getUserMedia): Making use of callPromiseFunction to properly handle exceptions.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Updated to use template parameter.
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
(WebCore::jsTestNodePrototypeFunctionTestWorkerPromisePromise):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
* bindings/scripts/test/TestNode.idl: Adding Worker promise binding test.

LayoutTests:

* fast/mediastream/MediaDevices-getUserMedia-expected.txt:
* fast/mediastream/MediaDevices-getUserMedia.html: Updated to expect a rejected promise in lieu of an exception.

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

2 years agoWeb Inspector: Call frame is sometimes not selected in Debugger sidebar on initial...
mattbaker@apple.com [Thu, 15 Sep 2016 04:54:37 +0000 (04:54 +0000)]
Web Inspector: Call frame is sometimes not selected in Debugger sidebar on initial pause
https://bugs.webkit.org/show_bug.cgi?id=161835
<rdar://problem/28236680>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
If a tree other than the newly selected element's tree has the selection,
deselect it to prevent multiple tree selections.
(WebInspector.NavigationSidebarPanel.prototype.show): Deleted.
Not needed since the selected tree is no longer tracked. Incidentally,
SidebarPanel.show was only called by SearchSidebarPanel, which doesn't need
to manage selection across multiple tree outlines.

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

2 years agoUnreviewed, update ios-simulator-wk1 test expectations after migrating to iOS 10
jiewen_tan@apple.com [Thu, 15 Sep 2016 04:32:20 +0000 (04:32 +0000)]
Unreviewed, update ios-simulator-wk1 test expectations after migrating to iOS 10

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

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

2 years agoASSERT_NOT_REACHED when using spread inside an array literal with Function.prototype...
commit-queue@webkit.org [Thu, 15 Sep 2016 01:14:45 +0000 (01:14 +0000)]
ASSERT_NOT_REACHED when using spread inside an array literal with Function.prototype.apply
https://bugs.webkit.org/show_bug.cgi?id=162003

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

JSTests:

* stress/spread-calling.js:
* test262.yaml:

Source/JavaScriptCore:

* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::isSimpleArray):
Don't treat an Array that has a spread expression inside it as simple.
This avoids a fast path for f.apply(x, simpleArray) that was not handling
spread expressions within arrays, and instead taking a path that can
handle the spreading.

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

2 years agoUnreviewed, rolling out r205933 and r205936.
commit-queue@webkit.org [Thu, 15 Sep 2016 00:33:36 +0000 (00:33 +0000)]
Unreviewed, rolling out r205933 and r205936.
https://bugs.webkit.org/show_bug.cgi?id=162002

broke the build (Requested by keith_miller on #webkit).

Reverted changesets:

"Pragma out undefined-var-template warnings in JSC for
JSObjects that are templatized"
https://bugs.webkit.org/show_bug.cgi?id=161985
http://trac.webkit.org/changeset/205933

"Unreviewed, fix the Windows build."
http://trac.webkit.org/changeset/205936

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

2 years agoWebCrypto algorithms should be exposed via KeyAlgorithm dictionary
jiewen_tan@apple.com [Thu, 15 Sep 2016 00:19:12 +0000 (00:19 +0000)]
WebCrypto algorithms should be exposed via KeyAlgorithm dictionary
https://bugs.webkit.org/show_bug.cgi?id=128748
<rdar://problem/27359438>

Reviewed by Brent Fulgham and Chris Dumez.

Source/WebCore:

Replace custom CryptoAlgorithmBuilder/buildAlgorithmDescription with KeyAlgorithm dictionary which is
defined by the spec: https://www.w3.org/TR/WebCryptoAPI/#key-algorithm-dictionary. Moreover, mark
CryptoKey.usages as CachedAttribute.

Tests: crypto/subtle/crypto-key-algorithm-gc.html
       crypto/subtle/crypto-key-usages-gc.html

* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
Remove CryptoAlgorithmDescriptionBuilder.cpp.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoAlgorithmBuilder.cpp:
(WebCore::JSCryptoAlgorithmBuilder::add):
(WebCore::JSCryptoAlgorithmBuilder::createEmptyClone): Deleted.
* bindings/js/JSCryptoAlgorithmBuilder.h:
* bindings/js/JSCryptoKeyCustom.cpp:
(WebCore::JSCryptoKey::algorithm):
Get rid of dependency on CryptoAlgorithmDescriptionBuilder.
* crypto/CryptoAlgorithmDescriptionBuilder.cpp: Removed.
* crypto/CryptoAlgorithmDescriptionBuilder.h: Removed.
Replace it with KeyAlgorithm.
* crypto/CryptoKey.cpp:
(WebCore::CryptoKey::CryptoKey):
(WebCore::CryptoKey::buildAlgorithmDescription): Deleted.
* crypto/CryptoKey.h:
(WebCore::KeyAlgorithm::KeyAlgorithm):
(WebCore::KeyAlgorithm::~KeyAlgorithm):
(WebCore::CryptoKey::algorithmIdentifier):
* crypto/CryptoKey.idl:
Add KeyAlgorithm dictionary which is returned via CryptoKey.buildAlgorithm() method,
and rename m_algorithm to m_algorithmIdentifier to distingush it with newly
added KeyAlgorithm dictionary.
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::buildAlgorithm):
(WebCore::CryptoKeyRSA::buildAlgorithmDescription): Deleted.
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::buildAlgorithm):
(WebCore::CryptoKeyAES::buildAlgorithmDescription): Deleted.
* crypto/keys/CryptoKeyAES.h:
(WebCore::AesKeyAlgorithm::AesKeyAlgorithm):
(WebCore::AesKeyAlgorithm::~AesKeyAlgorithm):
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::buildAlgorithm):
(WebCore::CryptoKeyHMAC::buildAlgorithmDescription): Deleted.
* crypto/keys/CryptoKeyHMAC.h:
(WebCore::HmacKeyAlgorithm::HmacKeyAlgorithm):
(WebCore::HmacKeyAlgorithm::~HmacKeyAlgorithm):
* crypto/keys/CryptoKeyRSA.h:
(WebCore::RsaKeyAlgorithm::RsaKeyAlgorithm):
(WebCore::RsaKeyAlgorithm::~RsaKeyAlgorithm):
(WebCore::RsaHashedKeyAlgorithm::RsaHashedKeyAlgorithm):
(WebCore::RsaHashedKeyAlgorithm::~RsaHashedKeyAlgorithm):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::buildAlgorithm):
(WebCore::CryptoKeyRSA::buildAlgorithmDescription): Deleted.

LayoutTests:

* crypto/subtle/crypto-key-algorithm-gc-expected.txt: Added.
* crypto/subtle/crypto-key-algorithm-gc.html: Added.
* crypto/subtle/crypto-key-usages-gc-expected.txt: Added.
* crypto/subtle/crypto-key-usages-gc.html: Added.
* crypto/subtle/hmac-generate-key-expected.txt:
* crypto/subtle/hmac-generate-key.html:

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

2 years agoREGRESSION (r205670): ASSERTION FAILED: methodTable(vm)->toThis(this, exec, NotStrict...
cdumez@apple.com [Thu, 15 Sep 2016 00:03:05 +0000 (00:03 +0000)]
REGRESSION (r205670): ASSERTION FAILED: methodTable(vm)->toThis(this, exec, NotStrictMode) == this
https://bugs.webkit.org/show_bug.cgi?id=161982

Reviewed by Saam Barati.

Source/JavaScriptCore:

Update JSProxy::setPrototype() to return false unconditionally instead
of forwarding the call to its target. We used to forward to the target
and then the JSDOMWindow's [[SetPrototypeOf]] would return false.
However, the JSC tests use a different GlobalObject and forwarding
the setPrototypeOf() call to the GlobalObject lead to hitting an
assertion. This patch aligns the behavior of the GlobalObject used by
the JSC tests with JSDOMWindow.

* runtime/JSProxy.cpp:
(JSC::JSProxy::setPrototype):

Source/WebCore:

We no longer need a custom [[SetPrototypeOf]] anymore as JSProxy::setPrototypeOf()
no longer forwards the call to its target.

No new layout tests because the behavior only changes in the context of the JSC
tests (which were updated in this patch).

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setPrototype): Deleted.
* page/DOMWindow.idl:

LayoutTests:

Bring back JSC test coverage that got lost in r205670.

* js/object-literal-shorthand-construction-expected.txt:
* js/script-tests/object-literal-shorthand-construction.js:
* js/script-tests/sloppy-getter-setter-global-object.js:
* js/sloppy-getter-setter-global-object-expected.txt:

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

2 years agoMedia controls behave strangely when changing media sources
wenson_hsieh@apple.com [Wed, 14 Sep 2016 23:51:51 +0000 (23:51 +0000)]
Media controls behave strangely when changing media sources
https://bugs.webkit.org/show_bug.cgi?id=161914
<rdar://problem/28227805>

Reviewed by Tim Horton.

Source/WebCore:

Addresses media controls flickering while changing the source of a media element. To accomplish this, we make
the following changes to the media controls main content heuristic:

- Prevent elements that are not mostly within the mainframe rect (or elements with empty rects) from showing
  media controls. Many websites that rely on same document navigation will move videos offscreen when navigating
  to a section of their site that does not play media. Without this check, we would not know to hide a video
  element on certain popular websites that use this technique, since the video has been interacted with in the
  past.

- Rather than check whether a media element currently has video/audio sources, check whether it has ever had
  audio. Many websites will use the same media element across different videos and change only the source, and
  we should not prevent a media element from having media controls on grounds of having no audio or video in
  this case.

- Rather than add user gesture and playback behavior restrictions before dispatching an ended event, add only
  the gesture restriction immediately, and add the playback restriction after waiting for a grace period only if
  the user has not interacted with the video since ending, and the video is not currently playing or about to
  play. This gives the user a chance to interact with the controls when a video ends, but also allows the page
  to load or begin playing a new video with the same media element without thrashing media control state.

Adds 3 new API tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::mediaPlayerActiveSourceBuffersChanged):
(WebCore::HTMLMediaElement::seekWithTolerance):
(WebCore::HTMLMediaElement::beginScrubbing):
(WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::hasEverHadAudio):
(WebCore::HTMLMediaElement::hasEverHadVideo):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
(WebCore::isElementRectMostlyInMainFrame):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerActiveSourceBuffersChanged):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::notifyActiveSourceBuffersChanged):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::notifyActiveSourceBuffersChanged):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState):

Source/WebKit2:

Allows a web page to have an active video for a media control manager even if no audio or video is currently
being produced. This is because the media element may be in a state where it is changing its source and does not
currently have a video or audio track.

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

Tools:

Adds three new unit tests verifying that media controls remain stable during common `src` change scenarios. Also
tweaks an existing test to account for new `ended` behavior.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
(-[VideoControlsManagerTestWebView waitForMediaControlsToShow]):
(-[VideoControlsManagerTestWebView waitForMediaControlsToHide]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/change-video-source-on-click.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/change-video-source-on-end.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/large-video-offscreen.html: Added.

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

2 years agoYARR doesn't check for invalid flags for literal regular expressions
msaboff@apple.com [Wed, 14 Sep 2016 23:17:59 +0000 (23:17 +0000)]
YARR doesn't check for invalid flags for literal regular expressions
https://bugs.webkit.org/show_bug.cgi?id=161995

Reviewed by Mark Lam.

JSTests:

New test.

* stress/regress-161995.js: Added.
(testStatic):
(catch):

Source/JavaScriptCore:

Added a new error and a check that the flags are valid when we create a
literal regular expression.

* runtime/RegExp.cpp:
(JSC::RegExp::finishCreation):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPattern::errorMessage):
(JSC::Yarr::YarrPattern::compile):
* yarr/YarrPattern.h:

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

2 years agoUnreviewed, fix the Windows build.
keith_miller@apple.com [Wed, 14 Sep 2016 23:15:46 +0000 (23:15 +0000)]
Unreviewed, fix the Windows build.

* runtime/HashMapImpl.cpp:

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

2 years agoAdd needsPlainTextQuirk and send it to the UIProcess
bdakin@apple.com [Wed, 14 Sep 2016 23:11:49 +0000 (23:11 +0000)]
Add needsPlainTextQuirk and send it to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=161996
-and corresponding-
rdar://problem/26013388

Rubber-stamped by Simon Fraser.

Quick clean-up.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::needsPlainTextQuirk):

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

2 years agoAdd needsPlainTextQuirk and send it to the UIProcess
bdakin@apple.com [Wed, 14 Sep 2016 23:00:46 +0000 (23:00 +0000)]
Add needsPlainTextQuirk and send it to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=161996
-and corresponding-
rdar://problem/26013388

Reviewed by Anders Carlsson.

WebPageProxy should keep track of m_needsPlainTextQuirk.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setNeedsPlainTextQuirk):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::needsPlainTextQuirk):
(WebKit::WebPageProxy::needsHiddenContentEditableQuirk): Deleted.
* UIProcess/WebPageProxy.messages.in:

If m_needsPlainTextQuirk is true, set it back to false on page transition.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didStartPageTransition):

The sites that need this quirk.
(WebKit::needsPlainTextQuirk):
(WebKit::WebPage::didChangeSelection):
* WebProcess/WebPage/WebPage.h:

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

2 years agoPragma out undefined-var-template warnings in JSC for JSObjects that are templatized
keith_miller@apple.com [Wed, 14 Sep 2016 22:32:58 +0000 (22:32 +0000)]
Pragma out undefined-var-template warnings in JSC for JSObjects that are templatized
https://bugs.webkit.org/show_bug.cgi?id=161985

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

I started a true fix for this in
https://bugs.webkit.org/show_bug.cgi?id=161979, however the fix
for this issue is not sustainable. Since the scope of this issue
is just limited to the static const ClassInfo member it is
simpler to just pragma out this warning. This works because
COMDAT will, AFAIK, pick the actual specialization.  If, in the
future, we want to expose these classes to WebCore we will need to
do what we do for JSGenericTypedArrayViews and create a custom
info() function with a switch.

This patch also fixes a bunch of weak external symbols due to one of:
1) out of line template member definitions functions not being marked inline.
2) inline member functions definitions being marked as exported.
3) missing header file includes for forward function declarations.

* API/JSCallbackObject.h:
* b3/B3ValueInlines.h:
(JSC::B3::Value::as):
* runtime/HashMapImpl.h:
* runtime/JSCJSValue.h:
(JSC::toUInt32): Deleted.
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::setIndexQuicklyToDouble):
* runtime/JSGenericTypedArrayViewConstructor.h:
* runtime/JSGenericTypedArrayViewPrototype.h:
* runtime/MathCommon.h:
(JSC::toUInt32):
* runtime/TypedArrayAdaptors.h:
* runtime/VM.h:
(JSC::VM::watchdog):
(JSC::VM::heapProfiler):
(JSC::VM::samplingProfiler):

Source/WTF:

Fix WTF_EXPORT_PRIVATE for an inline member function. This would
generate a weak export.

* wtf/MetaAllocator.h:
(WTF::MetaAllocator::getLock):

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

2 years agotest262: TypedArray constructors length should be 3 and configurable
commit-queue@webkit.org [Wed, 14 Sep 2016 22:27:19 +0000 (22:27 +0000)]
test262: TypedArray constructors length should be 3 and configurable
https://bugs.webkit.org/show_bug.cgi?id=161955

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-14
Reviewed by Mark Lam.

JSTests:

* test262.yaml:

Source/JavaScriptCore:

https://tc39.github.io/ecma262/#sec-ecmascript-standard-built-in-objects
Unless otherwise specified, the length property of a built-in Function
object has the attributes:
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.

* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::finishCreation):

LayoutTests:

* js/script-tests/typedarray-constructors.js:
* js/typedarray-constructors-expected.txt:
* js/dom/constructor-length.html:
* platform/efl/js/dom/constructor-length-expected.txt:
* platform/gtk/js/dom/constructor-length-expected.txt:
* platform/ios-simulator/js/dom/constructor-length-expected.txt:
* platform/mac/js/dom/constructor-length-expected.txt:
* platform/win/js/dom/constructor-length-expected.txt:

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

2 years ago[JSC] Make the rounding-related nodes support any type
commit-queue@webkit.org [Wed, 14 Sep 2016 21:24:28 +0000 (21:24 +0000)]
[JSC] Make the rounding-related nodes support any type
https://bugs.webkit.org/show_bug.cgi?id=161895

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-09-14
Reviewed by Geoffrey Garen.

JSTests:

* stress/arith-ceil-on-various-types.js: Added.
* stress/arith-floor-on-various-types.js: Added.
* stress/arith-round-on-various-types.js: Added.
* stress/arith-trunc-on-various-types.js: Added.

Source/JavaScriptCore:

This patch changes ArithRound, ArithFloor, ArithCeil and ArithTrunc
to support polymorphic input without exiting on entry.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
The 4 functions ignore any input past the first argument. It is okay
to use the nodes with the first argument and let the Phantoms keep
the remaining arguments live.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
Our fixup had the issue we have seen on previous nodes: unaryArithShouldSpeculateInt32()
prevents us from picking a good type if we do not see any double.

* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
Prediction propagation of those nodes are fully determined
from their flags and results's prediction. They are moved
to the invariant processing.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithRounding):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArithRound):
(JSC::FTL::DFG::LowerDFGToB3::compileArithFloor):
(JSC::FTL::DFG::LowerDFGToB3::compileArithCeil):
(JSC::FTL::DFG::LowerDFGToB3::compileArithTrunc):

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

2 years agoWeb Inspector: Call Stack tree in the Debugger sidebar should mark the active call...
mattbaker@apple.com [Wed, 14 Sep 2016 21:15:59 +0000 (21:15 +0000)]
Web Inspector: Call Stack tree in the Debugger sidebar should mark the active call frame
https://bugs.webkit.org/show_bug.cgi?id=161945
<rdar://problem/28293451>

Reviewed by Joseph Pecoraro.

Add an indicator for the active call frame tree element, patterned after
Xcode's call stack UI. The indicator should be positioned on the left,
with a fill color based on the tree element's selected/focused state.

* UserInterface/Images/ActiveCallFrame.svg: Added.
Image for "active call frame" tree element status.

* UserInterface/Main.html:
New file.

* UserInterface/Views/CallFrameTreeElement.css: Added.
(.tree-outline .item.call-frame .status):
(.tree-outline .item.call-frame .status > .status-image):
(.tree-outline .item.call-frame.selected .status > .status-image):
(.tree-outline:matches(:focus, .force-focus) .item.call-frame.selected .status > .status-image):
New tree element styles.

* UserInterface/Views/CallFrameTreeElement.js:
(WebInspector.CallFrameTreeElement):
(WebInspector.CallFrameTreeElement.prototype.get callFrame):
(WebInspector.CallFrameTreeElement.prototype.get isActiveCallFrame):
(WebInspector.CallFrameTreeElement.prototype.set isActiveCallFrame):
Add property for toggling active call frame indicator.
(WebInspector.CallFrameTreeElement.prototype.onattach):
(WebInspector.CallFrameTreeElement.prototype._updateStatus):

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerCallFramesDidChange):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):

* UserInterface/Views/Variables.css:
(:root):
New global for dark border color.

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

2 years ago[MediaStream] Minor cleanup
eric.carlson@apple.com [Wed, 14 Sep 2016 20:57:41 +0000 (20:57 +0000)]
[MediaStream] Minor cleanup
https://bugs.webkit.org/show_bug.cgi?id=161976

Reviewed by Youenn Fablet and Dean Jackson.

Source/WebCore:

No new tests, no behavior change.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/CaptureDeviceInfo.h: Removed.
* Modules/mediastream/CaptureDeviceManager.cpp: Removed.
* Modules/mediastream/CaptureDeviceManager.h: Removed.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::didCompletePermissionCheck):
(WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Deleted.
(WebCore::MediaDevicesRequest::requestOrigin): Deleted.
* Modules/mediastream/MediaDevicesRequest.h:
* Modules/mediastream/MediaStreamTrackSourcesCallback.h: Removed.
* Modules/mediastream/MediaStreamTrackSourcesCallback.idl: Removed.
* Modules/mediastream/SourceInfo.cpp: Removed.
* Modules/mediastream/SourceInfo.h: Removed.
* Modules/mediastream/SourceInfo.idl: Removed.
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/CaptureDevice.h: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceInfo.h.
(WebCore::CaptureDevice::CaptureDevice):
(WebCore::CaptureDevice::persistentId):
(WebCore::CaptureDevice::label):
(WebCore::CaptureDevice::groupId):
(WebCore::CaptureDevice::kind):
(WebCore::CaptureSessionInfo::~CaptureSessionInfo): Deleted.
(WebCore::CaptureSessionInfo::supportsVideoSize): Deleted.
(WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
* platform/mediastream/CaptureDeviceManager.cpp: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceManager.cpp.
(CaptureDeviceManager::getSourcesInfo):
* platform/mediastream/CaptureDeviceManager.h: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceManager.h.
(WebCore::CaptureSessionInfo::~CaptureSessionInfo):
(WebCore::CaptureSessionInfo::supportsVideoSize):
(WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions):
* platform/mediastream/MediaStreamTrackSourcesRequestClient.h: Removed.
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::getSourcesInfo):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices):
(WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::sourceWithUID): Deleted.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamDevices):
(WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources): Deleted.
(WebCore::RealtimeMediaSourceCenterOwr::sourceWithUID): Deleted.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::audioDeviceInfo):
(WebCore::MockRealtimeMediaSource::videoDeviceInfo):
(WebCore::MockRealtimeMediaSource::trackSourceWithUID): Deleted.
* platform/mock/MockRealtimeMediaSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::getMediaStreamDevices):
(WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources): Deleted.
(WebCore::MockRealtimeMediaSourceCenter::sourceWithUID): Deleted.
* platform/mock/MockRealtimeMediaSourceCenter.h:

Source/WebKit2:

* UIProcess/UserMediaPermissionRequestProxy.cpp:

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

2 years agoAdd needsHiddenContentEditableQuirk and send it to the UIProcess
bdakin@apple.com [Wed, 14 Sep 2016 20:56:20 +0000 (20:56 +0000)]
Add needsHiddenContentEditableQuirk and send it to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=161984
-and corresponding-
rdar://problem/26013388

Reviewed by Anders Carlsson.

Keep track of m_needsHiddenContentEditableQuirk in WebPageProxy.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setNeedsHiddenContentEditableQuirk):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::needsHiddenContentEditableQuirk):
(WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction): Deleted.
* UIProcess/WebPageProxy.messages.in:

If m_needsHiddenContentEditableQuirk is true, set it back to false on page
transition.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didStartPageTransition):

Google Docs and iCloud Pages are the sites that need this quirk.
(WebKit::needsHiddenContentEditableQuirk):
(WebKit::WebPage::didChangeSelection):
* WebProcess/WebPage/WebPage.h:

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

2 years agoMove more code out from RenderObject
antti@apple.com [Wed, 14 Sep 2016 20:51:41 +0000 (20:51 +0000)]
Move more code out from RenderObject
https://bugs.webkit.org/show_bug.cgi?id=161980

Reviewed by Zalan Bujtas.

Move some functions that are only needed for RenderElement there.
Move collapsing anonymous table rows to RenderTableRow.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::hasOutlineAnnotation):
(WebCore::RenderElement::hasSelfPaintingLayer):
(WebCore::RenderElement::checkForRepaintDuringLayout):
* rendering/RenderElement.h:
(WebCore::RenderElement::hasOutline):
(WebCore::RenderElement::hasHiddenBackface): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::pixelSnappedAbsoluteClippedOverflowRect):
(WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
(WebCore::RenderObject::hasSelfPaintingLayer): Deleted.
(WebCore::RenderObject::checkForRepaintDuringLayout): Deleted.
(WebCore::RenderObject::hasOutlineAnnotation): Deleted.
(WebCore::RenderObject::hasEntirelyFixedBackground): Deleted.
(WebCore::collapseAnonymousTableRowsIfNeeded): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::hasLayer):
(WebCore::RenderObject::canBeSelectionLeaf):
(WebCore::RenderObject::hasOutline): Deleted.
(WebCore::RenderObject::hasSelectedChildren): Deleted.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::destroyAndCollapseAnonymousSiblingRows):
* rendering/RenderTableRow.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::rootBackgroundIsEntirelyFixed):

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

2 years agoSwitch CSSParser to use CSSParserFastPaths::isKeywordPropertyID()
dbates@webkit.org [Wed, 14 Sep 2016 20:46:28 +0000 (20:46 +0000)]
Switch CSSParser to use CSSParserFastPaths::isKeywordPropertyID()
https://bugs.webkit.org/show_bug.cgi?id=161983

Reviewed by David Hyatt.

Towards switching to the new CSS parser keyword properties validation logic,
switch over the old CSS parser logic for determining a keyword property to
use the analogous logic in the new CSS parser.

A side benefit of this change is that it is a step towards unifying CSS- and
SVG CSS- keyword properties. The new CSS parser does not make a distinction
between these kinds of properties and will allow us to have a shared code path
for validating a keyword property.

No functionality was changed. So, no new tests.

* css/parser/CSSParser.cpp: Include header CSSParserFastPaths.h.
(WebCore::isValidKeywordPropertyAndValue): Validate SVG CSS keyword properties. This
logic was moved from CSSParser::parseSVGValue(). In subsequent patches we will switch
the old CSS parser from this function to CSSParserFastPaths::isValidKeywordPropertyAndValue().
(WebCore::parseKeywordValue): Modified to call CSSParserFastPaths::isKeywordPropertyID().
(WebCore::CSSParser::parseValue): Ditto.
(WebCore::isKeywordPropertyID): Deleted. Incorporated its functionality into
CSSParserFastPaths::isKeywordPropertyID().
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID): Incorporates the functionality
of WebCore::isKeywordPropertyID().
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue): Move properties that can be processed as
keyword properties from here to WebCore::isValidKeywordPropertyAndValue().

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

2 years agoRemove Heap::setMarked()
fpizlo@apple.com [Wed, 14 Sep 2016 20:41:31 +0000 (20:41 +0000)]
Remove Heap::setMarked()

Rubber stamped by Keith Miller.

Nobody uses this function.

* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::setMarked): Deleted.
* heap/LargeAllocation.h:
(JSC::LargeAllocation::testAndSetMarked):
(JSC::LargeAllocation::setMarked): Deleted.
* heap/MarkedBlock.h:

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

2 years agoRename parseColorParameters and clean up conditional
dino@apple.com [Wed, 14 Sep 2016 20:12:14 +0000 (20:12 +0000)]
Rename parseColorParameters and clean up conditional
https://bugs.webkit.org/show_bug.cgi?id=161941
<rdar://problem/28292750>

Reviewed by Dan Bates.

In preparation for adding color() support, rename the existing
parseColorParameters to parseRGBParameters.

Also clean up the logic in the parseColorFromValue function.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseRGBParameters):
(WebCore::CSSParser::parseColorFromValue):
(WebCore::CSSParser::parseColorParameters): Deleted.
* css/parser/CSSParser.h:

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

2 years agoAdd support hr.color IDL attribute
cdumez@apple.com [Wed, 14 Sep 2016 19:56:03 +0000 (19:56 +0000)]
Add support hr.color IDL attribute
https://bugs.webkit.org/show_bug.cgi?id=161977

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/dom/reflection-grouping-expected.txt:

Source/WebCore:

Add support hr.color IDL attribute as per:
- https://html.spec.whatwg.org/#HTMLHRElement-partial

Even though this is a legacy attribute, it is still part of the HTML specification
and it is still supported by Firefox and Chrome.

Also note that even though WebKit does not currently support the 'color' IDL
attribute on <hr>, it does support the 'color' content attribute on <hr>.
Therefore, we only need to reflect the 'color' content attribute.

No new tests, rebaselined existing test.

* html/HTMLHRElement.idl:

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

2 years agoURLParser: Add fast path for hosts containing no non-ASCII or percent characters
achristensen@apple.com [Wed, 14 Sep 2016 19:34:53 +0000 (19:34 +0000)]
URLParser: Add fast path for hosts containing no non-ASCII or percent characters
https://bugs.webkit.org/show_bug.cgi?id=161970

Reviewed by Daniel Bates.

Covered by existing tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseHost):
* platform/URLParser.h:
When parsing the host of a URL, if it contains non-ASCII characters or percent-encoded values,
we need to do additional encoding.  Many URLs, including all already-parsed URLs, do not have
such characters in their host, and therefore do not need the additional encoding.  Skipping
the additional encoding significantly speeds up my URL parsing benchmark.

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

2 years agoAtomics on ARM don't require full-system fencing, and other minutiae
jfbastien@apple.com [Wed, 14 Sep 2016 18:51:26 +0000 (18:51 +0000)]
Atomics on ARM don't require full-system fencing, and other minutiae
https://bugs.webkit.org/show_bug.cgi?id=161928

Reviewed by Geoffrey Garen.

Add cmpxchg versions with both success and failure memory
ordering. In some interesting cases we can craft code which needs
barriers which aren't as strong.

weakCompareAndSwap is super dubious, its 3 uses seem
questionable... but for now I'm just adding debug asserts.

Rename armv7_dmb* functions to arm_dmb* because they apply to v7
and v8 (or more precisely; to ARMv7's ARM and Thumb2, as well as
ARMv8's aarch32 A32/T32 and aarch64).

Use inner-shareability domain for ARM barriers instead of
full-system. This is what C++ uses.

The default case for barriers simply used a compiler barrier. This
is generally wrong, e.g. for MIPS.

* wtf/Atomics.h:
(WTF::Atomic::compareExchangeWeak): offer two-order version
(WTF::Atomic::compareExchangeStrong): offer two-order version
(WTF::weakCompareAndSwap): a few assertions
(WTF::arm_dmb): rename since it applies to ARMv7 and v8; make it innser-shareable
(WTF::arm_dmb_st): rename since it applies to ARMv7 and v8; make it innser-shareable
(WTF::loadLoadFence): incorrect generally
(WTF::loadStoreFence): incorrect generally
(WTF::storeLoadFence): incorrect generally
(WTF::storeStoreFence): incorrect generally
(WTF::memoryBarrierAfterLock): incorrect generally
(WTF::memoryBarrierBeforeUnlock): incorrect generally
(WTF::armV7_dmb): Deleted.
(WTF::armV7_dmb_st): Deleted.

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

2 years agoShowRenderTree should take position offset into account when printing inflow position...
zalan@apple.com [Wed, 14 Sep 2016 18:46:32 +0000 (18:46 +0000)]
ShowRenderTree should take position offset into account when printing inflow positioned renderers.
https://bugs.webkit.org/show_bug.cgi?id=161978

Reviewed by Simon Fraser.

Adjust (x, y) with the inflow positioned renderer's offset.

Not testable.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::showRenderObject):

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

2 years agoURLParser: Add fast path for utf8 encoding queries
achristensen@apple.com [Wed, 14 Sep 2016 18:16:29 +0000 (18:16 +0000)]
URLParser: Add fast path for utf8 encoding queries
https://bugs.webkit.org/show_bug.cgi?id=161968

Reviewed by Daniel Bates.

No change in behavior.  Covered by existing tests.

* platform/URLParser.cpp:
(WebCore::utf8PercentEncodeQuery):
(WebCore::URLParser::parse):
If the text encoding is UTF-8 (which is quite common), then we can encode the query
as we iterate its code points. This reduces memory allocation and significantly speeds
up my URL parsing benchmark.

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

2 years agoUse Options::validateExceptionChecks() instead of VM::m_verifyExceptionEvents.
mark.lam@apple.com [Wed, 14 Sep 2016 17:55:15 +0000 (17:55 +0000)]
Use Options::validateExceptionChecks() instead of VM::m_verifyExceptionEvents.
https://bugs.webkit.org/show_bug.cgi?id=161975

Reviewed by Keith Miller.

This makes it less burdensome (no longer needs a rebuild to enable checks) to do
incremental work towards enabling checks all the time.

* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::verifyExceptionCheckNeedIsSatisfied):
* runtime/VM.h:

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

2 years agoTaggedTemplateString function calls should emit tail position calls
commit-queue@webkit.org [Wed, 14 Sep 2016 17:48:13 +0000 (17:48 +0000)]
TaggedTemplateString function calls should emit tail position calls
https://bugs.webkit.org/show_bug.cgi?id=161948

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-14
Reviewed by Yusuke Suzuki.

JSTests:

* stress/tail-call-recognize.js:
(runTests):
Ensure a tagged template string function call is tail call.

* test262.yaml:
These now pass.

Source/JavaScriptCore:

* bytecompiler/NodesCodegen.cpp:
(JSC::TaggedTemplateNode::emitBytecode):
The tagged template string function call can be a tail call:
https://tc39.github.io/ecma262/#sec-tagged-templates-runtime-semantics-evaluation

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

2 years agoLong tap menu on an image link no longer includes "Save Image" button
commit-queue@webkit.org [Wed, 14 Sep 2016 17:44:31 +0000 (17:44 +0000)]
Long tap menu on an image link no longer includes "Save Image" button
https://bugs.webkit.org/show_bug.cgi?id=161761
<rdar://27202717>

Patch by Megan Gardner <megan_gardner@apple.com> on 2016-09-14
Reviewed by Beth Dakin.

* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForImageSheet:]):
Added share to image sheet as to not regress current functionality
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
Gather information for images as well as links, and they can be both

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

2 years agoAlwasys inline atomic operations
jfbastien@apple.com [Wed, 14 Sep 2016 17:11:57 +0000 (17:11 +0000)]
Alwasys inline atomic operations
https://bugs.webkit.org/show_bug.cgi?id=155371

Reviewed by Geoffrey Garen.

Fixes "build fails with memory model cannot be stronger than
success memory model for ‘__atomic_compare_exchange’".

Pre-5 revisions of GCC at Os only generated an error message
related to invalid failure memory ordering. The reason is that
libstdc++ tries to be clever about enforcing the C++ standard's
clause [atomics.types.operations.req] ¶21 which states:

    Requires: The failure argument shall not be
    `memory_order_release` nor `memory_order_acq_rel`. The failure
    argument shall be no stronger than the success argument.

It fails at doing this because its inlining heuristics are
modified by Os, and they're not quite as dumb as O0 but not smart
enough to get to the good code at O1. Adding ALWAYS_INLINE fixes
the silliness at Os, leaves O1 great, and makes O0 slightly less
bad but still pretty bad.

The other good news is that I'm going to get this particular
problem fixed in the version of C++ which will come after C++17:

https://github.com/jfbastien/papers/blob/master/source/P0418r1.bs

While we're at it we should always inline all of these wrapped
functions because the generated code is horrendous if the memory
order isn't known at compile time.

* wtf/Atomics.h:
(WTF::Atomic::load):
(WTF::Atomic::store):
(WTF::Atomic::compareExchangeWeak):
(WTF::Atomic::compareExchangeStrong):
(WTF::Atomic::exchangeAndAdd):
(WTF::Atomic::exchange):

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

2 years agoRegression(r152725): generate-bindings.pl --write-dependencies does not work
cdumez@apple.com [Wed, 14 Sep 2016 16:56:34 +0000 (16:56 +0000)]
Regression(r152725): generate-bindings.pl --write-dependencies does not work
https://bugs.webkit.org/show_bug.cgi?id=161897

Reviewed by Darin Adler.

r152725 inadvertently dropped the code generating the JS*.dep files when
--write-dependencies is passed to the bindings generator. As a result,
our dependency tracking was broken. This patch restores the code that
was dropped in r152725.

* bindings/scripts/CodeGeneratorJS.pm:
(new):
(GenerateHeader):

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

2 years agoinput.type cannot be set to "file" after being set to another type
cdumez@apple.com [Wed, 14 Sep 2016 16:56:06 +0000 (16:56 +0000)]
input.type cannot be set to "file" after being set to another type
https://bugs.webkit.org/show_bug.cgi?id=161943

Reviewed by Daniel Bates.

LayoutTests/imported/w3c:

Rebaseline a couple of W3C tests now that more checks are passing.

* web-platform-tests/html/dom/reflection-forms-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:

Source/WebCore:

input.type cannot be set to "file" after being set to another type.
This behavior does not match the HTML specification or the behavior
of Firefox and Chrome. This patch drops this restriction and aligns
our behavior with other browsers.

Test: fast/dom/HTMLInputElement/input-type-change-to-file.html

* html/FileInputType.cpp:
(WebCore::FileInputType::canChangeFromAnotherType): Deleted.
* html/FileInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):
* html/InputType.cpp:
(WebCore::InputType::canChangeFromAnotherType): Deleted.
* html/InputType.h:

LayoutTests:

* fast/dom/HTMLInputElement/input-type-change-to-file-expected.txt: Added.
* fast/dom/HTMLInputElement/input-type-change-to-file.html: Added.
* fast/dom/HTMLInputElement/input-type-file-security-expected.txt: Added
* fast/dom/HTMLInputElement/input-type-file-security.html: Added
Add layout test coverage. I have verified that these tests are passing in both
Firefox and Chrome.

* fast/forms/input-type-change3-expected.txt:
* fast/forms/input-type-change3.html:
* fast/forms/input-valueasnumber-unsupported-expected.txt:
* fast/forms/input-valueasnumber-unsupported.html:
Update existing tests to reflect behavior change.

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

2 years agoRebaseline tests added with r205905 for ios-simulator.
ryanhaddad@apple.com [Wed, 14 Sep 2016 16:55:15 +0000 (16:55 +0000)]
Rebaseline tests added with r205905 for ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt: Added.
* platform/ios-simulator/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt: Added.
* platform/ios-simulator/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt: Added.
* platform/ios-simulator/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt: Added.

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

2 years agotest262: Array.prototype.slice should always set length
commit-queue@webkit.org [Wed, 14 Sep 2016 16:47:01 +0000 (16:47 +0000)]
test262: Array.prototype.slice should always set length
https://bugs.webkit.org/show_bug.cgi?id=161953

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-14
Reviewed by Mark Lam.

JSTests:

* test262.yaml:

Source/JavaScriptCore:

* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSplice):

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

2 years ago[GTK][Wayland] Implement clipboard support
commit-queue@webkit.org [Wed, 14 Sep 2016 16:45:48 +0000 (16:45 +0000)]
[GTK][Wayland] Implement clipboard support
https://bugs.webkit.org/show_bug.cgi?id=146574

Patch by Carlos Garnacho <carlosg@gnome.org> on 2016-09-14
Reviewed by Carlos Garcia Campos.

Source/WebCore:

Implement PlatformPasteboard in the GTK+ platform, and move Pasteboard
to using PasteboardStrategy so clipboard management is left to the
UIProcess.

DataObjectGtk is still used in the Pasteboard GTK implementation, it's
now just never backed by a GtkClipboard, this object is instead
serialized through PasteboardStrategy, so the UIProcess side can mirror
the content in a GtkClipboard-backed DataObjectGtk, which is then
exposed to the windowing through PlatformPasteboard/PasteboardHelper.

When requesting clipboard content, it works similarly, the UIProcess
side first updates its DataObjectGtk, which is then mirrored by the
WebProcess through the PasteboardStrategy requests.

* PlatformGTK.cmake: Added PlatformPasteboardGtk.cpp
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard): Eliminate usage of
PasteboardWebContent callback argument. This is done differently as
we have to signal back the WebProcess.
* platform/Pasteboard.h: Cleaned up of direct GTK+ dependency.
* platform/PasteboardStrategy.h: Added plumbing towards the pasteboard
proxy.
* platform/PlatformPasteboard.h:
* platform/gtk/DataObjectGtk.cpp:
(WebCore::DataObjectGtk::clearAllExceptFilenames): Clear the "smart
paste" flag if set, now that this is DataObjectGtk data.
* platform/gtk/DataObjectGtk.h:
(WebCore::DataObjectGtk::canSmartReplace):
(WebCore::DataObjectGtk::setCanSmartReplace): Added functions, in order
to flag whether a DataObjectGtk has the "smart paste" feature enabled
or not.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::createForCopyAndPaste):
(WebCore::Pasteboard::createForGlobalSelection):
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::writeToClipboard):
(WebCore::Pasteboard::readFromClipboard):
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::writePasteboard):
(WebCore::Pasteboard::clear):
(WebCore::Pasteboard::canSmartReplace):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::hasData):
(WebCore::Pasteboard::types):
(WebCore::Pasteboard::readString):
(WebCore::Pasteboard::readFilenames): Made to use the
PasteboardStrategy instead of PasteboardHelper/GTK+ API.
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::~PasteboardHelper):
(WebCore::ClipboardSetData::ClipboardSetData):
(WebCore::clearClipboardContentsCallback):
(WebCore::PasteboardHelper::writeClipboardContents): Remove the GClosure
to notify whether the global selection has been replaced. Use std:function
instead. Remove SmartPasteInclusion argument, now figured out through
DataObjectGtk canSmartPaste() member.
* platform/gtk/PasteboardHelper.h:
* platform/gtk/PlatformPasteboardGtk.cpp: Added.
(WebCore::PlatformPasteboard::PlatformPasteboard):
(WebCore::PlatformPasteboard::writeToClipboard):
(WebCore::PlatformPasteboard::readFromClipboard): Implemented
PlatformPasteboard using PasteboardHelper/GTK+ API.

Source/WebKit2:

Add the necessary plumbing for the GTK+ backend to use the
PlatformPasteboard in WebCore. All selection data is transmitted
at once through the serialization of PasteboardContentGtk/DataObjectGtk.

* PlatformGTK.cmake: Add PasteboardContentGtk.cpp and
WebPasteboardProxyGtk.cpp
* Shared/gtk/ArgumentCodersGtk.cpp:
(IPC::encode):
(IPC::decode): Renamed from encodeDataObject/decodeDataObject
and made public.
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode): Update DataObjectGtk
encode/decode callers. Encode the extra canSmartReplace field.
* Shared/gtk/ArgumentCodersGtk.h: Expose encode/decode methods for
DataObjectGtk.
* Shared/gtk/PasteboardContent.cpp: Added. Wraps a DataObjectGtk
so it can be serialized on WebProcess/UIProcess messaging.
(WebKit::PasteboardContent::PasteboardContent):
(WebKit::PasteboardContent::encode):
(WebKit::PasteboardContent::decode): Methods to encode/decode a
PasteboardContent.
* Shared/gtk/PasteboardContent.h: Added.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::collapseSelection): Added plumbing to allow
collapsing the global selection from the UI process side.
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in: Added plumbing for the
GTK+ pasteboard proxy functions.
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/gtk/WebPasteboardProxyGtk.cpp: Added.
(WebKit::WebPasteboardProxy::writeToClipboard):
(WebKit::WebPasteboardProxy::readFromClipboard): Implemented functions
hooking into the PlatformPasteboard. Per-selection (ie.
primary/clipboard) PlatformPasteboards are kept at this level, so those
are independently set and dealt with.
(WebKit::WebPasteboardProxy::setPrimarySelectionOwner):
(WebKit::WebPasteboardProxy::didDestroyFrame): Implemented functions
to manage the frame currently being currently interacted, so we can
signal back when the global selection has been replaced.
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::writeToClipboard):
(WebKit::WebPlatformStrategies::readFromClipboard): Added methods to
send the WebProcess->UIProcess messages.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::updateGlobalSelection): Remove GClosure to
get notifications about changes in global selection ownership. This
is done through a WebPage message now, as the UI process manages the
clipboard.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::collapseSelectionInFrame): Added methods to send
the UIProcess->WebProcess notification that the global selection has
been replaced.

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

2 years agoLayoutTest http/tests/security/cross-origin-cached-scripts-parallel.html is a flaky...
commit-queue@webkit.org [Wed, 14 Sep 2016 16:40:13 +0000 (16:40 +0000)]
LayoutTest http/tests/security/cross-origin-cached-scripts-parallel.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=161912

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-14
Reviewed by Alexey Proskuryakov.

* TestExpectations: Removing flaky expectation.
* http/tests/security/cross-origin-cached-scripts-parallel-expected.txt:
* http/tests/security/cross-origin-cached-scripts-parallel.html: Increase timeout to ensure load is made in parallel.
Fixed flakiness by doing parallel loads in two shots of two, in lieu of 1 shot of 4.

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

2 years agoMarking inspector/console/messagesCleared.html as flaky on mac-debug.
ryanhaddad@apple.com [Wed, 14 Sep 2016 16:23:00 +0000 (16:23 +0000)]
Marking inspector/console/messagesCleared.html as flaky on mac-debug.
https://bugs.webkit.org/show_bug.cgi?id=152025

Unreviewed test gardening.

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

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

2 years agoMarking fast/scrolling/arrow-key-scroll-in-rtl-document.html as flaky on mac-wk2.
ryanhaddad@apple.com [Wed, 14 Sep 2016 16:22:57 +0000 (16:22 +0000)]
Marking fast/scrolling/arrow-key-scroll-in-rtl-document.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=161549

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years ago[CSS Parser] Enable the new sizes parser by default
hyatt@apple.com [Wed, 14 Sep 2016 15:54:54 +0000 (15:54 +0000)]
[CSS Parser] Enable the new sizes parser by default
https://bugs.webkit.org/show_bug.cgi?id=161931

Reviewed by Zalan Bujtas.

Source/WebCore:

Added new tests in fast/dom/HTMLImageElement/sizes.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSGrammar.y.in:
Remove the old code that parsed source size lists.

* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
* css/MediaQueryEvaluator.h:
Change to take a const Document&, since the Document is not modified.

* css/SourceSizeList.cpp: Removed.
* css/SourceSizeList.h: Removed.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSizesAttribute): Deleted.
(WebCore::CSSParser::SourceSize::SourceSize): Deleted.
(WebCore::CSSParser::sourceSize): Deleted.
* css/parser/CSSParser.h:
Remove the old sizes processing code.

* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::skipUntilComma):
(WebCore::MediaQueryParser::parseInternal):
Fix a bug I introduced when modifying this code from Blink. The Nones should have been Nots.

* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::computeLength):
(WebCore::SizesAttributeParser::SizesAttributeParser):
(WebCore::SizesAttributeParser::calculateLengthInPixels):
(WebCore::SizesAttributeParser::mediaConditionMatches):
(WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
* css/parser/SizesAttributeParser.h:
* css/parser/SizesCalcParser.cpp:
(WebCore::SizesCalcParser::SizesCalcParser):
(WebCore::SizesCalcParser::appendLength):
* css/parser/SizesCalcParser.h:
Make the sizes parsers take a Document, since having separate style and view arguments made
no sense, given that the style used is always the view's.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
(WebCore::HTMLImageElement::selectImageSource):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
Switch image elements and the preload scanner over to the new code.

LayoutTests:

* fast/dom/HTMLImageElement/resources/green-16x16.png: Added.
* fast/dom/HTMLImageElement/resources/green-1x1.png: Added.
* fast/dom/HTMLImageElement/sizes/image-sizes-invalids-expected.txt:
* fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html:
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt: Added.
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1.html: Added.
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt: Added.
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2.html: Added.
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt: Added.
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3.html: Added.
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt: Added.
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4.html: Added.

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

2 years agoFix mastercfg_unittest
jbedard@apple.com [Wed, 14 Sep 2016 15:16:04 +0000 (15:16 +0000)]
Fix mastercfg_unittest
https://bugs.webkit.org/show_bug.cgi?id=161816

Reviewed by Daniel Bates.

(RunWebKitTests.start):
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py: Fixed broken unit tests.

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

2 years agoMarking imported/w3c/web-platform-tests/XMLHttpRequest/response-method.htm as failing...
ryanhaddad@apple.com [Wed, 14 Sep 2016 06:06:34 +0000 (06:06 +0000)]
Marking imported/w3c/web-platform-tests/XMLHttpRequest/response-method.htm as failing on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=161949

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

2 years agoRebaseline imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-content...
ryanhaddad@apple.com [Wed, 14 Sep 2016 06:02:31 +0000 (06:02 +0000)]
Rebaseline imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm for ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-content-type-expected.txt:

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

2 years agoMore unreviewed test gardening for iOS 10.
ryanhaddad@apple.com [Wed, 14 Sep 2016 05:58:15 +0000 (05:58 +0000)]
More unreviewed test gardening for iOS 10.

* platform/ios-simulator/TestExpectations:

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

2 years agoUnreviewed test gardening for iOS 10.
ryanhaddad@apple.com [Wed, 14 Sep 2016 05:26:57 +0000 (05:26 +0000)]
Unreviewed test gardening for iOS 10.

* platform/ios-simulator/TestExpectations:
* platform/ios-simulator/editing/deleting/delete-emoji-expected.txt:
* platform/ios-simulator/fast/text/font-weights-expected.txt:
* platform/ios-simulator/fast/text/system-font-weight-expected.txt:

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

2 years agoUnreviewed, rolling out r205887.
cdumez@apple.com [Wed, 14 Sep 2016 04:56:56 +0000 (04:56 +0000)]
Unreviewed, rolling out r205887.

Broke the Windows build

Reverted changeset:

"Merge Element::ScrollToOptions and
DOMWindow::ScrollToOptions"
https://bugs.webkit.org/show_bug.cgi?id=161932
http://trac.webkit.org/changeset/205887

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

2 years agoRebaseline js/dom/global-constructors-attributes.html for Yosemite.
ryanhaddad@apple.com [Wed, 14 Sep 2016 04:11:51 +0000 (04:11 +0000)]
Rebaseline js/dom/global-constructors-attributes.html for Yosemite.

Unreviewed test gardening.

* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoPromises aren't resolved properly when making a ObjC API callback
msaboff@apple.com [Wed, 14 Sep 2016 02:29:22 +0000 (02:29 +0000)]
Promises aren't resolved properly when making a ObjC API callback
https://bugs.webkit.org/show_bug.cgi?id=161929

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

When we go to call out to an Objective C function registered via the API,
we first drop all JSC locks to make the call.  As part of dropping the locks,
we drain the microtask queue that is used among other things for handling deferred
promise resolution.  The DropAllLocks scope class that drops the locks while in
scope, resets the current thread's AtomicStringTable to the default table.  This
is wrong for two reasons, first it happens before we drain the microtask queue and
second it isn't needed as JSLock::willReleaseLock() restores the current thread's
AtomicStringTable to the table before the lock was acquired.

In fact, the manipulation of the current thread's AtomicStringTable is already
properly handled as a stack in JSLock::didAcquireLock() and willReleaseLock().
Therefore the manipulation of the AtomicStringTable in DropAllLocks constructor
and destructor should be removed.

* API/tests/testapi.mm:
(testObjectiveCAPIMain): Added a new test.
* runtime/JSLock.cpp:
(JSC::JSLock::DropAllLocks::DropAllLocks):
(JSC::JSLock::DropAllLocks::~DropAllLocks):

Source/WTF:

Removed resetCurrentAtomicStringTable() which is no longer referenced.

* wtf/WTFThreadData.h:
(WTF::WTFThreadData::resetCurrentAtomicStringTable): Deleted.

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

2 years agoRemove a .rej file.
dino@apple.com [Wed, 14 Sep 2016 02:22:35 +0000 (02:22 +0000)]
Remove a .rej file.

* animation/DocumentTimeline.h.rej: Removed.

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

2 years agoImplement URLSearchParams
achristensen@apple.com [Wed, 14 Sep 2016 01:34:27 +0000 (01:34 +0000)]
Implement URLSearchParams
https://bugs.webkit.org/show_bug.cgi?id=161920

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/send-usp-expected.txt:
* web-platform-tests/fetch/api/request/request-init-002-expected.txt:
* web-platform-tests/fetch/api/response/response-init-002-expected.txt:
* web-platform-tests/url/interfaces-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:
* web-platform-tests/url/urlsearchparams-append-expected.txt:
* web-platform-tests/url/urlsearchparams-constructor-expected.txt:
* web-platform-tests/url/urlsearchparams-delete-expected.txt:
* web-platform-tests/url/urlsearchparams-get-expected.txt:
* web-platform-tests/url/urlsearchparams-getall-expected.txt:
* web-platform-tests/url/urlsearchparams-has-expected.txt:
* web-platform-tests/url/urlsearchparams-set-expected.txt:
* web-platform-tests/url/urlsearchparams-stringifier-expected.txt:

Source/WebCore:

Covered by newly passing web platform tests.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* html/DOMURL.cpp:
(WebCore::DOMURL::setQuery):
(WebCore::DOMURL::searchParams):
* html/DOMURL.h:
* html/URLSearchParams.cpp: Added.
(WebCore::URLSearchParams::URLSearchParams):
(WebCore::URLSearchParams::get):
(WebCore::URLSearchParams::has):
(WebCore::URLSearchParams::set):
(WebCore::URLSearchParams::append):
(WebCore::URLSearchParams::getAll):
(WebCore::URLSearchParams::remove):
(WebCore::URLSearchParams::toString):
(WebCore::URLSearchParams::updateURL):
(WebCore::URLSearchParams::Iterator::Iterator):
* html/URLSearchParams.h: Added.
(WebCore::URLSearchParams::create):
(WebCore::URLSearchParams::createIterator):
* html/URLSearchParams.idl: Added.
* html/URLUtils.idl:
* platform/URLParser.cpp:
(WebCore::percentDecode):
(WebCore::URLParser::parseHost):
(WebCore::formURLDecode):
(WebCore::serializeURLEncodedForm):
(WebCore::URLParser::serialize):
* platform/URLParser.h:

Source/WTF:

* wtf/text/StringView.h:
(WTF::StringView::split): Added.

LayoutTests:

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-content-type-expected.txt:

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

2 years agoReplace RGBA32 with Color in member variables
dino@apple.com [Wed, 14 Sep 2016 00:38:57 +0000 (00:38 +0000)]
Replace RGBA32 with Color in member variables
https://bugs.webkit.org/show_bug.cgi?id=161856
<rdar://problem/28254324>

Reviewed by Simon Fraser.

In preparation for the Color class to become more than
just a 4-byte RGBA value, I went through a few places
that were using the RGBA32 type directly, and replaced
them with Color. This will make some objects a little
bigger e.g. BorderValue and its friends.

I mostly looked at the places that were using RGBA32 as
a member variable. There is still a lot of RGBA32 use
around the project, in particular the CSS parser.

There should be no behaviour change.

Source/WebCore:

* html/canvas/CanvasRenderingContext2D.cpp: Shadows now use Color.
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::shouldDrawShadows):
(WebCore::CanvasRenderingContext2D::didDraw):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasStyle.cpp: Canvas style uses Color for fills and strokes.
(WebCore::CanvasStyle::CanvasStyle):
(WebCore::CanvasStyle::isEquivalentColor):
(WebCore::CanvasStyle::isEquivalentRGBA):
(WebCore::CanvasStyle::applyStrokeColor):
(WebCore::CanvasStyle::applyFillColor):
* html/canvas/CanvasStyle.h:
(WebCore::CanvasStyle::CMYKAValues::CMYKAValues):
(WebCore::CanvasStyle::color):

* html/track/TextTrackCueGeneric.h: Foreground, background and
highlight colors.
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::setForegroundColor):
(WebCore::GenericCueData::setBackgroundColor):
(WebCore::GenericCueData::setHighlightColor):

* page/PageOverlay.cpp: Background color.
(WebCore::PageOverlay::setBackgroundColor):
* page/PageOverlay.h:

* platform/graphics/mac/ColorMac.h: Random function that returned RGBA32.
* platform/graphics/mac/ColorMac.mm:
(WebCore::oldAquaFocusRingColor):

* rendering/RenderTableCell.cpp: Update the size of CollapsedBorderValue.

* rendering/RenderTheme.h: Use a NeverDestroyed Color rather than a static RGBA32.

* rendering/style/BorderValue.h: Use a Color.
(WebCore::BorderValue::BorderValue):
(WebCore::BorderValue::isTransparent):
(WebCore::BorderValue::operator==):
(WebCore::BorderValue::setColor):
(WebCore::BorderValue::color):
* rendering/style/CollapsedBorderValue.h:
(WebCore::CollapsedBorderValue::CollapsedBorderValue):
(WebCore::CollapsedBorderValue::color):
* rendering/style/OutlineValue.h:
(WebCore::OutlineValue::operator==):

* rendering/style/RenderStyle.cpp: Update to match new BorderValue.

Source/WebKit/mac:

* Misc/WebKitNSStringExtras.mm:
(-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]): Explicitly
call a Color constructor, rather than passing an RGBA32.

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

2 years ago[media-source] MediaSource.addSourceBuffer(null) should throw an exception
jer.noble@apple.com [Wed, 14 Sep 2016 00:11:42 +0000 (00:11 +0000)]
[media-source] MediaSource.addSourceBuffer(null) should throw an exception
https://bugs.webkit.org/show_bug.cgi?id=161884

Reviewed by Eric Carlson.

Source/WebCore:

Fixes test: imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer.html

* Modules/mediasource/MediaSource.idl: The addSourceBuffer() parameter is not optional
    and not nullable.

LayoutTests:

* platform/mac/TestExpectations:
* platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt: Added.

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

2 years agoRemove Chrome app-specific CSS property -webkit-app-region
dbates@webkit.org [Wed, 14 Sep 2016 00:10:50 +0000 (00:10 +0000)]
Remove Chrome app-specific CSS property -webkit-app-region
https://bugs.webkit.org/show_bug.cgi?id=161935

Reviewed by Simon Fraser.

* css/parser/CSSParserFastPaths.cpp:

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

2 years agoTreat some CSS properties as keyword properties
dbates@webkit.org [Wed, 14 Sep 2016 00:10:21 +0000 (00:10 +0000)]
Treat some CSS properties as keyword properties
https://bugs.webkit.org/show_bug.cgi?id=161934

Reviewed by Simon Fraser.

Move validation of the following CSS keyword properties from CSSParser::parseValue() to
WebCore::isValidKeywordPropertyAndValue():

CSSPropertyColumnProgression
CSSPropertyFontStretch
CSSPropertyTextAlign
CSSPropertyUnicodeBidi
CSSPropertyWebkitColumnAxis
CSSPropertyWebkitCursorVisibility
CSSPropertyWebkitTextDecorationStyle
CSSPropertyWebkitTextOrientation
CSSPropertyWebkitTextZoom
CSSPropertyWebkitTouchCallout

Among other benefits, this will make it more straightforward to migrate from CSSParser::is{KeywordPropertyID, ValidKeywordPropertyAndValue}()
to CSSParserFastPaths::is{KeywordPropertyID, ValidKeywordPropertyAndValue}(), respectively.

* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):

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

2 years agoMerge Element::ScrollToOptions and DOMWindow::ScrollToOptions
cdumez@apple.com [Tue, 13 Sep 2016 23:27:47 +0000 (23:27 +0000)]
Merge Element::ScrollToOptions and DOMWindow::ScrollToOptions
https://bugs.webkit.org/show_bug.cgi?id=161932

Reviewed by Simon Fraser.

Merge Element::ScrollToOptions and DOMWindow::ScrollToOptions.
Ideally we would merge them on IDL side as well but this is for
another patch.

* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
* dom/Element.h:
* dom/Element.idl:
* dom/ScrollToOptions.h: Added.
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollTo):
* page/DOMWindow.h:
* page/DOMWindow.idl:

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

2 years agoRemove Heap::isLive()
fpizlo@apple.com [Tue, 13 Sep 2016 23:19:48 +0000 (23:19 +0000)]
Remove Heap::isLive()
https://bugs.webkit.org/show_bug.cgi?id=161933

Reviewed by Mark Lam.

Before I put any more effort into maintaining this weird function, I decided to check how it
was used. It turns out it's not.

* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::isLive): Deleted.

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

2 years agoLanding optimized .png files, forgot to do it initially.
ap@apple.com [Tue, 13 Sep 2016 23:13:51 +0000 (23:13 +0000)]
Landing optimized .png files, forgot to do it initially.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS10.png:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS10@2x.png:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS10Simulator.png:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOSDevice.png:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOSDevice@2x.png:

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

2 years agoSwitch build.webkit.org to iOS 10
ap@apple.com [Tue, 13 Sep 2016 23:08:54 +0000 (23:08 +0000)]
Switch build.webkit.org to iOS 10
https://bugs.webkit.org/show_bug.cgi?id=161930

Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunWebKitTests.start):
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS10.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS10@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS10Simulator.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS10Simulator@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOSDevice.png:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOSDevice@2x.png:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOSSimulator.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOSSimulator@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
* BuildSlaveSupport/build.webkit.org-config/wkbuild.py:
* BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py:
* Scripts/webkitpy/port/ios.py:
* TestResultServer/static-dashboards/builders.jsonp:

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

2 years ago[Cocoa] Unify font's ascent, descent, and x-height between macOS and iOS
mmaxfield@apple.com [Tue, 13 Sep 2016 22:38:46 +0000 (22:38 +0000)]
[Cocoa] Unify font's ascent, descent, and x-height between macOS and iOS
https://bugs.webkit.org/show_bug.cgi?id=161877

Reviewed by Simon Fraser.

Source/WebCore:

macOS and iOS have slightly different handling of ascent, descent, and x-height.
This patch migrates them to have the same handling of them.

There are slight behavior changes here because our previous code converted between
floats and doubles in unnecessary places, and does not handle rounding in
consistent ways. The differences are all miniscule, but nevertheless lead to test
results needing to be updated.

Coincidentally, by performing this unification, there are no longer any places
on macOS Sierra which are using the CGFontRef member of PlatformFontData. This
patch removes the member on that operating system for memory savings as well as
clarity.

Covered by existing tests.

* platform/graphics/FontPlatformData.cpp:
* platform/graphics/FontPlatformData.h:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::platformIsEqual):
(WebCore::FontPlatformData::ctFont):

LayoutTests:

Updating expected results.

* imported/blink/svg/text/obb-paintserver-expected.html: Covered tiny unrelated 1px difference.
* imported/blink/svg/text/obb-paintserver.html: Ditto.
* platform/ios-simulator/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.txt:
* platform/ios-simulator/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt:
* platform/ios-simulator/svg/custom/glyph-transformation-with-hkern-expected.txt: Copied from LayoutTests/svg/custom/glyph-transformation-with-hkern-expected.txt.
* platform/ios-simulator/svg/custom/repaint-shadow-expected.txt: Copied from LayoutTests/svg/custom/repaint-shadow-expected.txt.
* platform/ios-simulator/svg/text/text-hkern-on-vertical-text-expected.txt: Copied from LayoutTests/svg/text/text-hkern-on-vertical-text-expected.txt.
* platform/ios-simulator/svg/text/text-vkern-on-horizontal-text-expected.txt: Copied from LayoutTests/svg/text/text-vkern-on-horizontal-text-expected.txt.
* platform/ios-simulator/tables/mozilla/bugs/bug55527-expected.txt:
* platform/mac-yosemite/fast/text/emoji-expected.txt:
* platform/mac-yosemite/svg/W3C-SVG-1.1-SE/text-intro-05-t-expected.txt:
* platform/mac/css2.1/t1202-counter-04-b-expected.txt:
* platform/mac/css2.1/t1202-counters-04-b-expected.txt:
* platform/mac/fast/text/emoji-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/filters-felem-01-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/linking-uri-01-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/painting-marker-07-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/pservers-grad-17-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/pservers-grad-20-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/pservers-pattern-03-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/styling-css-04-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/styling-pres-02-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/svgdom-over-01-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/text-intro-02-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/text-intro-05-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/text-intro-09-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/text-tref-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/text-tspan-02-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-05-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-03-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/filters-light-04-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-05-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-06-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-glyph-02-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-kern-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/render-elems-06-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/render-elems-07-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/render-elems-08-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-align-08-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-fonts-03-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-text-04-t-expected.txt:
* platform/mac/svg/batik/text/xmlSpace-expected.txt:
* platform/mac/svg/custom/glyph-selection-bidi-mirror-expected.txt:
* platform/mac/svg/custom/glyph-setting-d-attribute-expected.txt:
* platform/mac/svg/foreignObject/text-tref-02-b-expected.txt:
* platform/mac/svg/text/kerning-expected.txt:
* platform/mac/svg/text/multichar-glyph-expected.txt:
* svg/custom/glyph-transformation-with-hkern-expected.txt:
* svg/custom/repaint-shadow-expected.txt:
* svg/text/text-hkern-on-vertical-text-expected.txt:
* svg/text/text-vkern-on-horizontal-text-expected.txt:

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

2 years agoDFG NewArrayBuffer node should watch for "have a bad time" state change.
mark.lam@apple.com [Tue, 13 Sep 2016 22:16:25 +0000 (22:16 +0000)]
DFG NewArrayBuffer node should watch for "have a bad time" state change.
https://bugs.webkit.org/show_bug.cgi?id=161927
<rdar://problem/27995222>

Reviewed by Geoffrey Garen.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):

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

2 years ago[Win] Unreviewed build fix.
bfulgham@apple.com [Tue, 13 Sep 2016 21:56:55 +0000 (21:56 +0000)]
[Win] Unreviewed build fix.

Based on a suggestion by Simon Fraser, I have corrected the
headers to avoid including <d2d1.h> directly, relying instead
on forward declarations.

* platform/graphics/FloatPoint.h:
* platform/graphics/FloatRect.h:
* platform/graphics/FloatSize.h:
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/transforms/AffineTransform.h:
* platform/graphics/transforms/TransformationMatrix.h:

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

2 years agoSupport jsc shell builtin `read`
jfbastien@apple.com [Tue, 13 Sep 2016 21:53:11 +0000 (21:53 +0000)]
Support jsc shell builtin `read`
https://bugs.webkit.org/show_bug.cgi?id=161662

Reviewed by Keith Miller.

JSTests:

* stress/jsc-read.js: Added.
(test): test `read` and `readFile` shell builtins, in string and binary mode.

Source/JavaScriptCore:

The jsc shell currently supports a `readFile` method which returns
a string. SpiderMonkey's js shell and V8's d8 shell both support
similar file-to-string functions, as well as a
binary-file-to-Uint8Array function. jsc should support a similar
binary file method to simplify testing, including testing of
WebAssembly blobs.

Emscripten's shell.js (which is also used for some WebAssembly
things) has a polyfill [1] for a builtin called `read`. jsc should
therefore have a builtin with the same name if we want things to
"Just Work".

  [1]: https://github.com/kripken/emscripten/blob/5f0918409a1407dd168f57cfa34b109cd1770a8a/src/shell.js#L138

* jsc.cpp:
(GlobalObject::finishCreation): add `read`, make `readFile` take up to 2 arguments.
(functionReadFile): support binary files, as per SpiderMonkey.
* runtime/Error.h:
(JSC::throwVMError): convenience function, I'll add more uses in a follow-up
* runtime/JSTypedArrays.cpp:
(JSC::createUint8TypedArray): JS private export of JSUint8Array::create.
* runtime/JSTypedArrays.h: expose private export.

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

2 years agoProvide a mechanism to specify the maximum size of WKThumbnailView snapshots
timothy_horton@apple.com [Tue, 13 Sep 2016 21:09:35 +0000 (21:09 +0000)]
Provide a mechanism to specify the maximum size of WKThumbnailView snapshots
https://bugs.webkit.org/show_bug.cgi?id=161896
<rdar://problem/28229827>

Reviewed by Simon Fraser.

Some clients know that their thumbnail views will only be displayed up to
a specific size that is significantly smaller than the WKView size. Allow
them to avoid wasting lots of memory on unnecessarily large snapshots.

* UIProcess/API/Cocoa/_WKThumbnailView.h:
* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView requestSnapshot]):
(-[_WKThumbnailView _requestSnapshotIfNeeded]):
(-[_WKThumbnailView setMaximumSnapshotSize:]):
Add a maximumSnapshotSize property which can be changed dynamically.

* TestWebKitAPI/Tests/WebKit2/WKThumbnailView.mm:
(TestWebKitAPI::TEST):
Add a test for the new property.
Also fix the old new test to run on arbitrary scale displays without failing.

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

2 years agoGet rid of the m_premultiplyAlpha flag of the ImageFrame class
commit-queue@webkit.org [Tue, 13 Sep 2016 20:56:22 +0000 (20:56 +0000)]
Get rid of the m_premultiplyAlpha flag of the ImageFrame class
https://bugs.webkit.org/show_bug.cgi?id=159721

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

This flag was only needed when calling ImageBackingStore::create() in
ImageFrame::setSize(). Instead we can pass ImageDecoder::m_premultiplyAlpha
to ImageFrame::setSize(), which is renamed ImageFrame::initializeBackingStore().
The passed premultiplyAlpha can then be passed to ImageBackingStore::create().

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageFrame::ImageFrame):
(WebCore::ImageFrame::operator=):
(WebCore::ImageFrame::initializeBackingStore):
(WebCore::ImageFrame::copyBitmapData): Deleted.
(WebCore::ImageFrame::setSize): Deleted.
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageFrame::disposalMethod):
(WebCore::ImageFrame::setDisposalMethod):
(WebCore::ImageDecoder::premultiplyAlpha):
(WebCore::ImageFrame::premultiplyAlpha): Deleted.
(WebCore::ImageFrame::setPremultiplyAlpha): Deleted.
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::frameBufferAtIndex):
* platform/image-decoders/bmp/BMPImageReader.cpp:
(WebCore::BMPImageReader::decodeBMP):
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::decode):
(WebCore::GIFImageDecoder::initFrameBuffer):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::frameCount):
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::frameBufferAtIndex):
(WebCore::JPEGImageDecoder::outputScanlines):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::frameBufferAtIndex):
(WebCore::PNGImageDecoder::rowAvailable):
(WebCore::PNGImageDecoder::readChunks):
(WebCore::PNGImageDecoder::initFrameBuffer):
(WebCore::setPixelRGB): Deleted.
(WebCore::setPixelRGBA): Deleted.
(WebCore::setPixelPremultipliedRGBA): Deleted.
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::frameBufferAtIndex):
(WebCore::WEBPImageDecoder::decode):

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

2 years agoREGRESSION (r196321): Amazon Videos are all black in Fullscreen
andersca@apple.com [Tue, 13 Sep 2016 20:14:04 +0000 (20:14 +0000)]
REGRESSION (r196321): Amazon Videos are all black in Fullscreen
https://bugs.webkit.org/show_bug.cgi?id=161924
rdar://problem/28208208

Reviewed by Dan Bernstein.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(main):
Set AppleMagnifiedMode to true.

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

2 years agoWeb Inspector: Use Array.shallowEqual instead of Object.shallowEqual in more places
mattbaker@apple.com [Tue, 13 Sep 2016 20:12:07 +0000 (20:12 +0000)]
Web Inspector: Use Array.shallowEqual instead of Object.shallowEqual in more places
https://bugs.webkit.org/show_bug.cgi?id=161867
<rdar://problem/28261328>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
(value):
Array.shallowEqual should return false if passed a non-array.

* UserInterface/Models/CSSRule.js:
(WebInspector.CSSRule.prototype.update):
* UserInterface/Models/Color.js:
(WebInspector.Color.prototype.isKeyword):
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
(WebInspector.DOMNodeStyles.prototype.refresh):
* UserInterface/Models/Geometry.js:
(WebInspector.CubicBezier.prototype.toString):
* UserInterface/Views/GeneralTreeElement.js:
(WebInspector.GeneralTreeElement.prototype.set classNames):
* UserInterface/Views/NewTabContentView.js:
(WebInspector.NewTabContentView.prototype._updateShownTabs):
Prefer Array.shallowEqual over Obejct.shallowEqual if the arguments
will always be arrays.

LayoutTests:

* inspector/unit-tests/array-utilities-expected.txt:
* inspector/unit-tests/array-utilities.html:
Add test coverage for Array.shallowEqual.
Use Array.shallowEqual instead of JSON.stringify in tests.
Use expectFalse and expectEqual in tests where appropriate.

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

2 years ago[Win][Direct2D] Provide Direct2D-based geometry and transform cast operations
bfulgham@apple.com [Tue, 13 Sep 2016 19:54:53 +0000 (19:54 +0000)]
[Win][Direct2D] Provide Direct2D-based geometry and transform cast operations
https://bugs.webkit.org/show_bug.cgi?id=161818

Reviewed by Dean Jackson.

Source/WebCore:

Tested by new TestWebKitAPI tests.

Add new casting operators to and from various Direct2D data types.

* PlatformWin.cmake:
* platform/graphics/FloatPoint.h:
(WebCore::FloatPoint::FloatPoint):
* platform/graphics/FloatRect.h:
* platform/graphics/FloatSize.h:
(WebCore::FloatSize::FloatSize):
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/transforms/AffineTransform.h:
* platform/graphics/transforms/TransformationMatrix.h:
* platform/graphics/win/FloatPointDirect2D.cpp:
* platform/graphics/win/FloatRectDirect2D.cpp:
* platform/graphics/win/FloatSizeDirect2D.cpp:
* platform/graphics/win/IntPointWin.cpp:
(WebCore::IntPoint::IntPoint):
(WebCore::IntPoint::operator D2D1_POINT_2F):
(WebCore::IntPoint::operator D2D1_POINT_2U):
* platform/graphics/win/IntRectWin.cpp:
(WebCore::IntRect::IntRect):
(WebCore::IntRect::operator D2D1_RECT_F):
(WebCore::IntRect::operator D2D1_RECT_U):
* platform/graphics/win/IntSizeWin.cpp:
(WebCore::IntSize::IntSize):
(WebCore::IntSize::operator D2D1_SIZE_U):
(WebCore::IntSize::operator D2D1_SIZE_F):
* platform/graphics/win/TransformationMatrixDirect2D.cpp: Added.
(WebCore::TransformationMatrix::TransformationMatrix):
(WebCore::TransformationMatrix::operator D2D1_MATRIX_3X2_F):
(WebCore::AffineTransform::AffineTransform):
(WebCore::AffineTransform::operator D2D1_MATRIX_3X2_F):

Source/WebKit:

* PlatformWin.cmake: Link to Direct2D on Windows.

Tools:

Add several new test suites for the various geometric primitives in WebCore.

* TestWebKitAPI/PlatformWin.cmake: Add new files for test cases.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Ditto.
* TestWebKitAPI/Tests/WebCore/AffineTransform.cpp: Added.
* TestWebKitAPI/Tests/WebCore/FloatPoint.cpp: Added.
* TestWebKitAPI/Tests/WebCore/FloatRect.cpp: Added.
* TestWebKitAPI/Tests/WebCore/FloatSize.cpp: Added.
* TestWebKitAPI/Tests/WebCore/IntPoint.cpp: Added.
* TestWebKitAPI/Tests/WebCore/IntRect.cpp: Added.
* TestWebKitAPI/Tests/WebCore/IntSize.cpp: Added.
* TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp: Add some new
Windows-focused test cases.

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

2 years agoUndoing a candidate insertion results in the replaced text being selected
timothy_horton@apple.com [Tue, 13 Sep 2016 19:44:42 +0000 (19:44 +0000)]
Undoing a candidate insertion results in the replaced text being selected
https://bugs.webkit.org/show_bug.cgi?id=161894
<rdar://problem/28225774>

Reviewed by Simon Fraser.

Test: editing/mac/spelling/accept-candidate-undo-does-not-select.html

* WebCore.xcodeproj/project.pbxproj:
* editing/ReplaceRangeWithTextCommand.cpp: Added.
(WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
(WebCore::ReplaceRangeWithTextCommand::doApply):
* editing/ReplaceRangeWithTextCommand.h: Added.
(WebCore::ReplaceRangeWithTextCommand::create):
Add a editor command that replaces a range with the given text.

* editing/Editor.cpp:
(WebCore::Editor::rangeForTextCheckingResult):
(WebCore::Editor::handleAcceptedCandidate):
(WebCore::Editor::selectTextCheckingResult): Deleted.
* editing/Editor.h:
Make use of the new editor command to do candidate insertion as a single
composite operation, so that it is undone as a unit. Otherwise, undo ends up
undoing the insertion, but not the selection, and we are left with the old
text, selected, which is undesirable.

* editing/mac/spelling/accept-candidate-allows-autocorrect-on-next-word-expected.txt:
* editing/mac/spelling/accept-candidate-replacing-multiple-words-expected.txt:
* editing/mac/spelling/accept-candidate-undo-does-not-select-expected.txt: Copied from LayoutTests/editing/mac/spelling/accept-candidate-replacing-multiple-words-expected.txt.
* editing/mac/spelling/accept-candidate-undo-does-not-select.html: Added.
* editing/mac/spelling/accept-candidate-without-adding-space-expected.txt:
* editing/mac/spelling/accept-candidate-without-crossing-editing-boundary-expected.txt:
Adjust some test results, and add a new test that ensures that undoing
a candidate insertion does not select the replaced text.

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

2 years ago[CSS Parser] Add CSS Variable Parsing support
hyatt@apple.com [Tue, 13 Sep 2016 19:08:30 +0000 (19:08 +0000)]
[CSS Parser] Add CSS Variable Parsing support
https://bugs.webkit.org/show_bug.cgi?id=161916

Reviewed by Dean Jackson.

This patch not only adds the parser for CSS variables (from Blink), but it also brings in
all of the data structures used to store variables and custom property declarations. We
will be abandoning our old data structures eventually in favor of these new ones. They
are not significantly different other than operating on the CSSParserTokenRanges rather
than the soon-to-be-removed parser value lists.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSCustomIdentValue.cpp: Added.
(WebCore::CSSCustomIdentValue::CSSCustomIdentValue):
(WebCore::CSSCustomIdentValue::customCSSText):
* css/CSSCustomIdentValue.h: Added.
(WebCore::CSSCustomIdentValue::create):
(WebCore::CSSCustomIdentValue::value):
(WebCore::CSSCustomIdentValue::isKnownPropertyID):
(WebCore::CSSCustomIdentValue::valueAsPropertyID):
(WebCore::CSSCustomIdentValue::equals):
* css/CSSCustomPropertyDeclaration.cpp: Added.
(WebCore::CSSCustomPropertyDeclaration::customCSSText):
* css/CSSCustomPropertyDeclaration.h: Added.
(WebCore::CSSCustomPropertyDeclaration::create):
(WebCore::CSSCustomPropertyDeclaration::name):
(WebCore::CSSCustomPropertyDeclaration::value):
(WebCore::CSSCustomPropertyDeclaration::id):
(WebCore::CSSCustomPropertyDeclaration::equals):
(WebCore::CSSCustomPropertyDeclaration::CSSCustomPropertyDeclaration):
* css/CSSCustomPropertyValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isCustomPropertyDeclaration):
(WebCore::CSSValue::isCustomIdentValue):
(WebCore::CSSValue::isVariableReferenceValue):
* css/CSSValueKeywords.in:
* css/CSSVariableData.cpp: Added.
(WebCore::CSSVariableData::updateTokens):
(WebCore::CSSVariableData::operator==):
(WebCore::CSSVariableData::consumeAndUpdateTokens):
(WebCore::CSSVariableData::CSSVariableData):
* css/CSSVariableData.h: Added.
(WebCore::CSSVariableData::create):
(WebCore::CSSVariableData::createResolved):
(WebCore::CSSVariableData::tokenRange):
(WebCore::CSSVariableData::tokens):
(WebCore::CSSVariableData::needsVariableResolution):
(WebCore::CSSVariableData::CSSVariableData):
* css/CSSVariableDependentValue.h:
* css/CSSVariableReferenceValue.cpp: Added.
(WebCore::CSSVariableReferenceValue::customCSSText):
* css/CSSVariableReferenceValue.h: Added.
(WebCore::CSSVariableReferenceValue::create):
(WebCore::CSSVariableReferenceValue::variableDataValue):
(WebCore::CSSVariableReferenceValue::equals):
(WebCore::CSSVariableReferenceValue::CSSVariableReferenceValue):
* css/CSSVariableValue.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::filterProperties):
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeVariableValue):
* css/parser/CSSVariableParser.cpp: Added.
(WebCore::CSSVariableParser::isValidVariableName):
(WebCore::classifyBlock):
(WebCore::isValidVariableReference):
(WebCore::classifyVariableRange):
(WebCore::CSSVariableParser::containsValidVariableReferences):
(WebCore::CSSVariableParser::parseDeclarationValue):
* css/parser/CSSVariableParser.h: Added.

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

2 years agoRemove CSS keyword properties from CSSParser::parseValue(CSSPropertyID, bool)
dbates@webkit.org [Tue, 13 Sep 2016 19:01:32 +0000 (19:01 +0000)]
Remove CSS keyword properties from CSSParser::parseValue(CSSPropertyID, bool)
https://bugs.webkit.org/show_bug.cgi?id=161918

Reviewed by Simon Fraser.

CSSParser::parseValue(CSSPropertyID, bool) calls ASSERT_NOT_REACHED() when processing a CSS property
that is known to accept only keyword values as a means to guide a person to add such a CSS property
to the switch block in WebCore::isValidKeywordPropertyAndValue(). In theory this sounds good, but
in practice it does not work out and the list of such properties is stale. We should remove the
case statements for such properties and the maintenance burden they required, which was manual and
error prone. We should think about a better way to enforce that all CSS properties are parsed/validated.

The approach of calling ASSERT_NOT_REACHED is not beneficial to catching coding mistakes because
CSSParser::parseValue() has a default case statement to parse/validate SVG CSS properties and hence
does not allow the C++ compiler to validate that the switch block covers all CSSPropertyIDs.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValue):

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

2 years agoOrganize CSS keyword properties in WebCore::isKeywordPropertyID()
dbates@webkit.org [Tue, 13 Sep 2016 19:01:04 +0000 (19:01 +0000)]
Organize CSS keyword properties in WebCore::isKeywordPropertyID()
https://bugs.webkit.org/show_bug.cgi?id=161917

Reviewed by Simon Fraser.

Group and sort compile-time feature keywords and move them to the end of the switch block
to avoid the distraction of preprocessor statements scattered throughout the list. Sort
all the other keyword properties to make it straightforward to find a property by name.

* css/parser/CSSParser.cpp:
(WebCore::isKeywordPropertyID):

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

2 years agoWeb Inspector: Should be able to pretty print module code (import / export statements)
commit-queue@webkit.org [Tue, 13 Sep 2016 18:37:12 +0000 (18:37 +0000)]
Web Inspector: Should be able to pretty print module code (import / export statements)
https://bugs.webkit.org/show_bug.cgi?id=161891
<rdar://problem/28272784>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-13
Reviewed by Yusuke Suzuki.

Source/WebInspectorUI:

* Tools/Formatting/EsprimaFormatterDebug.js:
* Tools/Formatting/index.html:
Update the formatting tool to toggle between source type modes.

* UserInterface/Proxies/FormatterWorkerProxy.js:
* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatJavaScript):
Provide a flag to parse the input as a module instead of a script/program.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype._startWorkerPrettyPrint):
Using the formatter here, we may have module scripts in the future.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
Using the formatter for a function is not module source.

* UserInterface/Workers/Formatter/ESTreeWalker.js:
(ESTreeWalker.prototype._walkChildren):
Visit children of Export/Import nodes.

* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):
Output tokens with appropriate whitespace.

LayoutTests:

* inspector/formatting/formatting-javascript-expected.txt:
* inspector/formatting/formatting-javascript.html:
* inspector/formatting/resources/javascript-tests/modules-expected.js: Added.
* inspector/formatting/resources/javascript-tests/modules.js: Added.
Include a new test for modules.

* inspector/formatting/formatting-json.html:
All of these are non-module source code.

* inspector/formatting/resources/utilities.js:
Determine if module or not based on the test name.

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

2 years agoAX: Crash at AccessibilityRenderObject::computeAccessibilityIsIgnored const + 552
n_wang@apple.com [Tue, 13 Sep 2016 18:20:28 +0000 (18:20 +0000)]
AX: Crash at AccessibilityRenderObject::computeAccessibilityIsIgnored const  + 552
https://bugs.webkit.org/show_bug.cgi?id=161276

Reviewed by Chris Fleizach.

Sometimes when calling JavaScript removeChild or setAttribute on a node, it seems like
the renderer is deallocated during the process of computeAccessibilityIsIgnored. It's
causing a crash when we are accessing the renderer after that. Since RenderObject is not ref
counted and we cannot hold onto it for the duration of the function, fixed it by adding
more nil checks.

Despite my best efforts, I couldn't make a layout test that destroys the renderer within
the computeAccessibilityIsIgnored function.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):

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

2 years agoMarking http/tests/security/cross-origin-cached-scripts-parallel.html as flaky.
ryanhaddad@apple.com [Tue, 13 Sep 2016 17:53:25 +0000 (17:53 +0000)]
Marking http/tests/security/cross-origin-cached-scripts-parallel.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=161912

Unreviewed test gardening.

* TestExpectations:

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

2 years agoMedia-source backed elements block load event; cause web-platform-test flakiness
jer.noble@apple.com [Tue, 13 Sep 2016 17:43:05 +0000 (17:43 +0000)]
Media-source backed elements block load event; cause web-platform-test flakiness
https://bugs.webkit.org/show_bug.cgi?id=161881

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-delaying-load-event.html

The MSE specification has added an explicit step to their "attaching to media element"
algorithm which tells the media element to stop delaying the load event. And indeed,
the HTMLMediaElement blocks the load event when a MediaSource is attached but its data
is never loaded.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::setPrivateAndOpen):
* html/HTMLMediaElement.h:

LayoutTests:

* media/media-source/media-source-delaying-load-event-expected.txt: Added.
* media/media-source/media-source-delaying-load-event.html: Added.

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

2 years agoUnreviewed gardening; removed duplicate entry for mediasource-config-change-mp4-v...
jer.noble@apple.com [Tue, 13 Sep 2016 17:33:20 +0000 (17:33 +0000)]
Unreviewed gardening; removed duplicate entry for mediasource-config-change-mp4-v-bitrate.html.

* platform/mac/TestExpectations:

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

2 years agoInput type object and the associated render can go out of sync.
zalan@apple.com [Tue, 13 Sep 2016 17:05:39 +0000 (17:05 +0000)]
Input type object and the associated render can go out of sync.
https://bugs.webkit.org/show_bug.cgi?id=161871
<rdar://problem/28178094>

Reviewed by Antti Koivisto.

Source/WebCore:

Bail out when we've got a mismatched renderer.

Test: fast/forms/assert-on-input-type-change.html

* html/ImageInputType.cpp:
(WebCore::ImageInputType::altAttributeChanged):

LayoutTests:

* fast/forms/assert-on-input-type-change-expected.txt: Added.
* fast/forms/assert-on-input-type-change.html: Added.

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

2 years ago[GTK] Get rid of DataObjectGtk::forClipboard and cleanup pasteboard code
carlosgc@webkit.org [Tue, 13 Sep 2016 16:13:38 +0000 (16:13 +0000)]
[GTK] Get rid of DataObjectGtk::forClipboard and cleanup pasteboard code
https://bugs.webkit.org/show_bug.cgi?id=161907

Reviewed by Michael Catanzaro.

Source/WebCore:

We don't really need to keep a DataObjectGtk for every clipboard, we could simply pass the DataObjectGtk to read
and write methods of PasteboardHelper.

* editing/gtk/EditorGtk.cpp:
(WebCore::createFragmentFromPasteboardData): Update for DataObjectGtk API changes.
* platform/Pasteboard.h:
* platform/gtk/DataObjectGtk.cpp: Remove forClipboard() static method.
* platform/gtk/DataObjectGtk.h: Ditto.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::Pasteboard): Always create a new DataObjectGtk.
(WebCore::Pasteboard::dataObject): Return a const reference instead of a pointer.
(WebCore::Pasteboard::writePlainText): Pass the DataObjectGtk to PasteboardHelper.
(WebCore::Pasteboard::write): Ditto.
(WebCore::Pasteboard::writePasteboard): Ditto.
(WebCore::Pasteboard::clear): Ditto.
(WebCore::Pasteboard::read): Ditto.
(WebCore::Pasteboard::hasData): Ditto.
(WebCore::Pasteboard::types): Ditto.
(WebCore::Pasteboard::readString): Ditto.
(WebCore::Pasteboard::readFilenames): Ditto.
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::getClipboardContents): Update the given DataObjectGtk.
(WebCore::PasteboardHelper::fillSelectionData): Use a const reference to DataObjectGtk instead of a pointer.
(WebCore::PasteboardHelper::targetListForDataObject): Ditto.
(WebCore::PasteboardHelper::fillDataObjectFromDropData): Use a reference to DataObjectGtk instead of a pointer.
(WebCore::ClipboardSetData::ClipboardSetData): Helper struct to pass DataObjectGtk and callback to clipboard callbacks.
(WebCore::ClipboardSetData::~ClipboardSetData):
(WebCore::getClipboardContentsCallback): Get the DataObjectGtk from ClipboardSetData struct passed as user data.
(WebCore::clearClipboardContentsCallback): Get the DataObjectGtk and callback from ClipboardSetData struct
passed as user data.
(WebCore::PasteboardHelper::writeClipboardContents): Write the given DataObjectGtk.
* platform/gtk/PasteboardHelper.h:

Source/WebKit2:

Update to DataObjectGtk and PasteboardHelper API changes.

* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::startDrag):
(WebKit::DragAndDropHandler::fillDragData):
(WebKit::DragAndDropHandler::dataObjectForDropData):
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::collapseSelection):
(WebKit::WebEditorClient::updateGlobalSelection): Remove wrong X11 guards, since that code is not X11 specific.

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

2 years agoParkingLot is going to have a bad time with threads dying
fpizlo@apple.com [Tue, 13 Sep 2016 15:59:25 +0000 (15:59 +0000)]
ParkingLot is going to have a bad time with threads dying
https://bugs.webkit.org/show_bug.cgi?id=161893

Reviewed by Michael Saboff.

If a thread dies right as it falls out of parkConditionally, then unparkOne() and friends
might die because they will dereference a deallocated ThreadData.

The solution is to ref-count ThreadData's. When unparkOne() and friends want to hold onto a
ThreadData past the queue lock, they can use RefPtr<>.

* wtf/ParkingLot.cpp:
(WTF::ParkingLot::unparkOne):
(WTF::ParkingLot::unparkOneImpl):
(WTF::ParkingLot::unparkAll):

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

2 years agoDrop support for <isindex>
cdumez@apple.com [Tue, 13 Sep 2016 15:02:44 +0000 (15:02 +0000)]
Drop support for <isindex>
https://bugs.webkit.org/show_bug.cgi?id=7139

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Import layout test coverage from W3C web-platform-tests. We used to fail
the last check but we now pass it. Chrome also passes this last check.

* web-platform-tests/html/semantics/forms/historical-expected.txt: Added.
* web-platform-tests/html/semantics/forms/historical.html: Added.
* web-platform-tests/html/semantics/forms/w3c-import.log: Added.

Source/WebCore:

Drop support for <isindex> and <input name=isindex>. Those are no longer
in the HTML specification and Chrome / Edge have already dropped their
support. Firefox is also planning on dropping this.

Test: imported/w3c/web-platform-tests/html/semantics/forms/historical.html

* css/StyleResolver.cpp:
(WebCore::elementTypeHasAppearanceFromUAStyle):
* css/html.css:
(input, textarea, keygen, select, button, meter, progress):
(input, textarea, keygen, select, button):
(#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS):
(input::placeholder):
(input:focus, textarea:focus, keygen:focus, select:focus):
* dom/Element.cpp:
(WebCore::Element::ieForbidsInsertHTML):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
* html/HTMLTagNames.in:
* html/parser/HTMLStackItem.h:
(WebCore::isSpecialNode):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processCloseWhenNestedTag): Deleted.
(WebCore::createCaseMap): Deleted.
* html/parser/HTMLTreeBuilder.h:
* platform/network/FormData.cpp:
(WebCore::FormData::appendKeyValuePairItems):

Source/WebInspectorUI:

Drop references to isindex.

* UserInterface/Views/DOMTreeElement.js:

Source/WebKit/mac:

Drop references to isindex.

* WebCoreSupport/WebEditorClient.mm:
(attributesForAttributedStringConversion):
* WebView/WebHTMLView.mm:
(+[WebHTMLView _excludedElementsForAttributedStringConversion]):

LayoutTests:

Drop outdated tests / checks.

* dom/html/level2/html/HTMLIsIndexElement01-expected.txt: Removed.
* dom/html/level2/html/HTMLIsIndexElement01.html: Removed.
* dom/html/level2/html/HTMLIsIndexElement01.js: Removed.
* dom/html/level2/html/HTMLIsIndexElement02-expected.txt: Removed.
* dom/html/level2/html/HTMLIsIndexElement02.html: Removed.
* dom/html/level2/html/HTMLIsIndexElement02.js: Removed.
* dom/html/level2/html/HTMLIsIndexElement03-expected.txt: Removed.
* dom/html/level2/html/HTMLIsIndexElement03.html: Removed.
* dom/html/level2/html/HTMLIsIndexElement03.js: Removed.
* fast/dom/HTMLIsIndexElement/prototype-chain-expected.txt: Removed.
* fast/dom/HTMLIsIndexElement/prototype-chain.html: Removed.
* fast/dom/HTMLIsIndexElement/script-tests/prototype-chain.js: Removed.
* fast/dom/isindex-001.html: Removed.
* fast/dom/isindex-002.html: Removed.
* fast/events/resources/tabindex-focus-blur-all-frame1.html:
* fast/events/resources/tabindex-focus-blur-all-frame2.html:
* fast/events/resources/tabindex-focus-blur-all-iframe1.html:
* fast/events/resources/tabindex-focus-blur-all-iframe2.html:
* fast/forms/isindex-name-expected.txt: Removed.
* fast/forms/isindex-name.html: Removed.
* fast/forms/isindex-placeholder-expected.html: Removed.
* fast/forms/isindex-placeholder.html: Removed.
* fast/forms/text-style-color.html: Removed.
* fast/parser/fragment-parser-expected.txt:
* fast/parser/script-tests/fragment-parser.js:
* fast/replaced/table-percent-height-text-controls-expected.txt:
* fast/replaced/table-percent-height-text-controls.html:
* html5lib/generated/run-isindex-data-expected.txt: Removed.
* html5lib/generated/run-isindex-data.html: Removed.
* html5lib/generated/run-isindex-write-expected.txt: Removed.
* html5lib/generated/run-isindex-write.html: Removed.
* html5lib/resources/isindex.dat:
* html5lib/resources/tests19.dat:
* html5lib/resources/tests2.dat:
* html5lib/resources/webkit02.dat:
* http/tests/misc/isindex-formdata-expected.txt: Removed.
* http/tests/misc/isindex-formdata.html: Removed.
* http/tests/misc/isindex-with-no-form-base-href-expected.txt: Removed.
* http/tests/misc/isindex-with-no-form-base-href.html: Removed.
* http/tests/misc/isindex-with-no-form-expected.txt: Removed.
* http/tests/misc/isindex-with-no-form.html: Removed.
* http/tests/misc/resources/isindex-with-no-form-base-href-submit.html: Removed.
* http/tests/misc/resources/isindex-with-no-form-base-href.html: Removed.
* platform/efl/fast/dom/isindex-001-expected.png: Removed.
* platform/efl/fast/dom/isindex-001-expected.txt: Removed.
* platform/efl/fast/dom/isindex-002-expected.png: Removed.
* platform/efl/fast/dom/isindex-002-expected.txt: Removed.
* platform/efl/fast/forms/text-style-color-expected.png: Removed.
* platform/efl/fast/forms/text-style-color-expected.txt: Removed.
* platform/gtk/fast/dom/isindex-001-expected.png: Removed.
* platform/gtk/fast/dom/isindex-001-expected.txt: Removed.
* platform/gtk/fast/dom/isindex-002-expected.png: Removed.
* platform/gtk/fast/dom/isindex-002-expected.txt: Removed.
* platform/gtk/fast/forms/text-style-color-expected.png: Removed.
* platform/gtk/fast/forms/text-style-color-expected.txt: Removed.
* platform/ios-simulator/fast/dom/isindex-001-expected.txt: Removed.
* platform/ios-simulator/fast/dom/isindex-002-expected.txt: Removed.
* platform/ios-simulator/fast/forms/text-style-color-expected.txt: Removed.
* platform/mac-elcapitan/fast/dom/isindex-001-expected.txt: Removed.
* platform/mac-elcapitan/fast/dom/isindex-002-expected.txt: Removed.
* platform/mac-elcapitan/fast/forms/text-style-color-expected.txt: Removed.
* platform/mac/fast/dom/isindex-001-expected.png: Removed.
* platform/mac/fast/dom/isindex-001-expected.txt: Removed.
* platform/mac/fast/dom/isindex-002-expected.png: Removed.
* platform/mac/fast/dom/isindex-002-expected.txt: Removed.
* platform/mac/fast/forms/text-style-color-expected.png: Removed.
* platform/mac/fast/forms/text-style-color-expected.txt: Removed.
* platform/win/fast/dom/isindex-001-expected.txt: Removed.
* platform/win/fast/dom/isindex-002-expected.txt: Removed.
* platform/win/fast/forms/text-style-color-expected.txt: Removed.

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