WebKit-https.git
22 months agoAX: VoiceOver in Safari does not read table header for first cell in first body row
cfleizach@apple.com [Fri, 17 Nov 2017 23:44:16 +0000 (23:44 +0000)]
AX: VoiceOver in Safari does not read table header for first cell in first body row
https://bugs.webkit.org/show_bug.cgi?id=179780
<rdar://problem/35590551>

Reviewed by Joanmarie Diggs.

Source/WebCore:

A table cell shouldn't be considered a row header if it's in a row of other headers.

Test: accessibility/table-header-calculation-for-header-rows.html

* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::headerObject):

LayoutTests:

* accessibility/table-header-calculation-for-header-rows-expected.txt: Added.
* accessibility/table-header-calculation-for-header-rows.html: Added.
* accessibility/table-attributes-expected.txt: Updated.
* platform/gtk/accessibility/table-attributes-expected.txt: Updated.

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

22 months agoDon't invert a matrix for every channel of every pixel of an FETurbulence filter
simon.fraser@apple.com [Fri, 17 Nov 2017 23:36:24 +0000 (23:36 +0000)]
Don't invert a matrix for every channel of every pixel of an FETurbulence filter
https://bugs.webkit.org/show_bug.cgi?id=179829

Reviewed by Dean Jackson.

FETurbulence::fillRegion() called filter().mapAbsolutePointToLocalPoint(point) for each
of the 4 channels on a point, which is stupid.

Fix to invert the matrix once, and then map the point once for each pixel. This reduces
the time in fillRegion() function by about 30%.

* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::absoluteTransform const):
(WebCore::Filter::mapAbsolutePointToLocalPoint const): Deleted.

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

22 months agoREGRESSION(r224390): Revert unneeded Ref use.
bfulgham@apple.com [Fri, 17 Nov 2017 23:34:09 +0000 (23:34 +0000)]
REGRESSION(r224390): Revert unneeded Ref use.
https://bugs.webkit.org/show_bug.cgi?id=179844
<rdar://problem/35624718>

Reviewed by Chris Dumez.

A Ref was added to a simple code path used for type checking, which introduced a nullptr
deref. The original change was not needed, so let's revert it.

* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::contentDocument const): Use 'nullptr' instead of 0.
(WebCore::HTMLFrameOwnerElement::contentWindow const): Ditto.
(WebCore::HTMLFrameOwnerElement::getSVGDocument const): Revert to original code here.

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

22 months agoWeb Inspector: Network Tab - Add HAR Export button
joepeck@webkit.org [Fri, 17 Nov 2017 23:32:49 +0000 (23:32 +0000)]
Web Inspector: Network Tab - Add HAR Export button
https://bugs.webkit.org/show_bug.cgi?id=179570
<rdar://problem/35484918>

Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:
New strings.

* UserInterface/Images/Export.svg: Added.
* UserInterface/Images/Import.svg: Added.
Add symmetric import/export buttons.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
Expose the save keyboard shortcut so we can show its display name in a tooltip.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.get navigationItems):
(WI.NetworkTableContentView.prototype.reset):
(WI.NetworkTableContentView.prototype.layout):
(WI.NetworkTableContentView.prototype._updateExportButton):
Include the export button and enable/disable it when appropriate.

(WI.NetworkTableContentView.prototype.closed):
Add a missing event listener removal.

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

22 months agoWeb Inspector: Disabled ImageAndText-style buttons should have gray text
mattbaker@apple.com [Fri, 17 Nov 2017 23:18:28 +0000 (23:18 +0000)]
Web Inspector: Disabled ImageAndText-style buttons should have gray text
https://bugs.webkit.org/show_bug.cgi?id=179843
<rdar://problem/35624337>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ButtonNavigationItem.css:
(.navigation-bar .item.button.disabled.image-and-text,):
(.navigation-bar .item.button.disabled > .glyph): Deleted.

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

22 months agoAX: AOM: Implement boolean type properties
n_wang@apple.com [Fri, 17 Nov 2017 23:14:18 +0000 (23:14 +0000)]
AX: AOM: Implement boolean type properties
https://bugs.webkit.org/show_bug.cgi?id=179496

Reviewed by Chris Fleizach.

Source/WebCore:

Accessibility Object Model
Explainer: https://wicg.github.io/aom/explainer.html
Spec: https://wicg.github.io/aom/spec/

Implemented the boolean type properties for Accessibility Object Modal.

Test: accessibility/mac/AOM-bool-properties.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::~AXObjectCache):
(WebCore::AXObjectCache::findModalNodes):
(WebCore::AXObjectCache::updateCurrentModalNode):
(WebCore::AXObjectCache::modalNode):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::handleMenuItemSelected):
(WebCore::AXObjectCache::focusModalNode):
(WebCore::AXObjectCache::focusModalNodeTimerFired):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::handleModalChange):
(WebCore::isNodeAriaVisible):
(WebCore::AXObjectCache::findAriaModalNodes): Deleted.
(WebCore::AXObjectCache::updateCurrentAriaModalNode): Deleted.
(WebCore::AXObjectCache::ariaModalNode): Deleted.
(WebCore::AXObjectCache::focusAriaModalNode): Deleted.
(WebCore::AXObjectCache::focusAriaModalNodeTimerFired): Deleted.
(WebCore::AXObjectCache::handleAriaModalChange): Deleted.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::modalNode):
(WebCore::AXObjectCache::focusModalNodeTimerFired):
(WebCore::AXObjectCache::handleModalChange):
(WebCore::AXObjectCache::ariaModalNode): Deleted.
(WebCore::AXObjectCache::focusAriaModalNodeTimerFired): Deleted.
(WebCore::AXObjectCache::handleAriaModalChange): Deleted.
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::isMultiSelectable const):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::readOnlyValue const):
(WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue const): Deleted.
* accessibility/AccessibilityARIAGridCell.h:
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::isEnabled const):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isEnabled const):
(WebCore::AccessibilityNodeObject::isMultiSelectable const):
(WebCore::AccessibilityNodeObject::isRequired const):
(WebCore::shouldUseAccessibilityObjectInnerText):
(WebCore::AccessibilityNodeObject::canSetValueAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsReadOnly const):
(WebCore::AccessibilityObject::readOnlyValue const):
(WebCore::AccessibilityObject::ariaIsMultiline const):
(WebCore::AccessibilityObject::isModalDescendant const):
(WebCore::AccessibilityObject::isModalNode const):
(WebCore::AccessibilityObject::ignoredFromModalPresence const):
(WebCore::AccessibilityObject::boolValueForProperty const):
(WebCore::AccessibilityObject::supportsARIAAttributes const):
(WebCore::AccessibilityObject::supportsExpanded const):
(WebCore::AccessibilityObject::isExpanded const):
(WebCore::AccessibilityObject::isAXHidden const):
(WebCore::AccessibilityObject::defaultObjectInclusion const):
(WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
(WebCore::AccessibilityObject::supportsARIAReadOnly const): Deleted.
(WebCore::AccessibilityObject::ariaReadOnlyValue const): Deleted.
(WebCore::AccessibilityObject::isAriaModalDescendant const): Deleted.
(WebCore::AccessibilityObject::isAriaModalNode const): Deleted.
(WebCore::AccessibilityObject::ignoredFromARIAModalPresence const): Deleted.
(WebCore::AccessibilityObject::isARIAHidden const): Deleted.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isHidden const):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
(WebCore::AccessibilityRenderObject::isSelected const):
(WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
(WebCore::AccessibilityRenderObject::liveRegionAtomic const):
(WebCore::AccessibilityRenderObject::isBusy const):
* accessibility/AccessibleNode.cpp:
(WebCore::ariaAttributeMap):
(WebCore::isPropertyValueBoolean):
(WebCore::AccessibleNode::effectiveBoolValueForElement):
(WebCore::AccessibleNode::boolValueForProperty):
(WebCore::AccessibleNode::setBoolProperty):
(WebCore::AccessibleNode::atomic const):
(WebCore::AccessibleNode::setAtomic):
(WebCore::AccessibleNode::busy const):
(WebCore::AccessibleNode::setBusy):
(WebCore::AccessibleNode::disabled const):
(WebCore::AccessibleNode::setDisabled):
(WebCore::AccessibleNode::expanded const):
(WebCore::AccessibleNode::setExpanded):
(WebCore::AccessibleNode::hidden const):
(WebCore::AccessibleNode::setHidden):
(WebCore::AccessibleNode::modal const):
(WebCore::AccessibleNode::setModal):
(WebCore::AccessibleNode::multiline const):
(WebCore::AccessibleNode::setMultiline):
(WebCore::AccessibleNode::multiselectable const):
(WebCore::AccessibleNode::setMultiselectable):
(WebCore::AccessibleNode::readOnly const):
(WebCore::AccessibleNode::setReadOnly):
(WebCore::AccessibleNode::required const):
(WebCore::AccessibleNode::setRequired):
(WebCore::AccessibleNode::selected const):
(WebCore::AccessibleNode::setSelected):
* accessibility/AccessibleNode.h:
* accessibility/AccessibleNode.idl:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(setAtkStateSetFromCoreObject):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

LayoutTests:

* accessibility/mac/AOM-bool-properties-expected.txt: Added.
* accessibility/mac/AOM-bool-properties.html: Added.

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

22 months agoNFC update ClassInfo to C++14
jfbastien@apple.com [Fri, 17 Nov 2017 23:10:45 +0000 (23:10 +0000)]
NFC update ClassInfo to C++14
https://bugs.webkit.org/show_bug.cgi?id=179783

Reviewed by Mark Lam.

Forked from #179734, use `using` instead of `typedef`. It's easier
to read.

* runtime/ClassInfo.h:

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

22 months agoAdd a TimingScope class for microbenchmarking sections of code
simon.fraser@apple.com [Fri, 17 Nov 2017 23:00:43 +0000 (23:00 +0000)]
Add a TimingScope class for microbenchmarking sections of code
https://bugs.webkit.org/show_bug.cgi?id=179825

Reviewed by Zalan Bujtas.

Add a class, similar to B3TimingScope, which makes it easy to microbenchmark
sections of code. Use looks like:

TimingScope scope("some label", 100);

where this will print mean scope duration every 100 calls. Sample output:

    FETurbulence::platformApplySoftware: 100 calls, mean duration: 3.073181ms
    FETurbulence::platformApplySoftware: 200 calls, mean duration: 3.074612ms
    FETurbulence::platformApplySoftware: 300 calls, mean duration: 3.065722ms

Because TimingScope needs to store state beween invocations, and there may be
multiple TimingScopes in use at the same time, data is stored in a global
hash map with atomic access.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/TimingScope.cpp: Added.
(WTF::TimingScope::scopeDidEnd):
* wtf/TimingScope.h: Added.
(WTF::TimingScope::TimingScope):
(WTF::TimingScope::~TimingScope):

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

22 months agoWeb Inspector: Network Tab - Update Ignore Caches button
commit-queue@webkit.org [Fri, 17 Nov 2017 22:53:46 +0000 (22:53 +0000)]
Web Inspector: Network Tab - Update Ignore Caches button
https://bugs.webkit.org/show_bug.cgi?id=179841

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-17
Reviewed by Matt Baker.

* UserInterface/Images/IgnoreCaches.svg:
This changes from an arrow over a cache to a slash through a cache.

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

22 months agoTurn on selection layout tests that are already working on iOS
megan_gardner@apple.com [Fri, 17 Nov 2017 22:12:17 +0000 (22:12 +0000)]
Turn on selection layout tests that are already working on iOS
https://bugs.webkit.org/show_bug.cgi?id=179842

Reviewed by Tim Horton.

I have checked these test manually and on the flakiness dashboard and they are all
working on iOS. No reason to not run them on iOS now.

* platform/ios-wk2/TestExpectations:

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

22 months agoAX: [ATK] Fix WKTR's methods for testing row header and column header presence and...
jdiggs@igalia.com [Fri, 17 Nov 2017 22:09:53 +0000 (22:09 +0000)]
AX: [ATK] Fix WKTR's methods for testing row header and column header presence and count
https://bugs.webkit.org/show_bug.cgi?id=179837

Reviewed by Chris Fleizach.

Tools:

Add support to rowHeaders() for tables. Return an empty array in rowHeaders()
and columnHeaders() upon failure. Rename getRowHeaders() and getColumnHeaders()
to getTableRowHeaders() and getTableColumnHeaders() respectively.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::rowHeaders const):
(WTR::AccessibilityUIElement::columnHeaders const):
(WTR::AccessibilityUIElement::attributesOfColumnHeaders):
(WTR::AccessibilityUIElement::attributesOfRowHeaders):

LayoutTests:

* accessibility/gtk/table-headers-count-expected.txt: Added.
* accessibility/gtk/table-headers-count.html: Added.
* platform/gtk/TestExpectations: Remove a couple of "crash" failures.
* platform/gtk/accessibility/table-sections-expected.txt: Remove null objects.

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

22 months agoWebAssembly JS API: throw when a promise can't be created
jfbastien@apple.com [Fri, 17 Nov 2017 21:57:09 +0000 (21:57 +0000)]
WebAssembly JS API: throw when a promise can't be created
https://bugs.webkit.org/show_bug.cgi?id=179826
<rdar://problem/35455813>

Reviewed by Mark Lam.

JSTests:

Test WebAssembly.{compile,instantiate} where promise creation
fails because of a stack overflow.

* wasm/js-api/promise-stack-overflow.js: Added.
(const.runNearStackLimit.f.const.t):
(async.testCompile):
(async.testInstantiate):

Source/JavaScriptCore:

Failure *in* a promise causes rejection, but failure to create a
promise (because of stack overflow) isn't really spec'd (as all
stack things JS). This applies to WebAssembly.compile and
WebAssembly.instantiate.

Dan's current proposal says:

    https://littledan.github.io/spec/document/js-api/index.html#stack-overflow

    Whenever a stack overflow occurs in WebAssembly code, the same
    class of exception is thrown as for a stack overflow in
    JavaScript. The particular exception here is
    implementation-defined in both cases.

    Note: ECMAScript doesn’t specify any sort of behavior on stack
    overflow; implementations have been observed to throw RangeError,
    InternalError or Error. Any is valid here.

This is for general stack overflow within WebAssembly, not
specifically for promise creation within JavaScript, but it seems
like a stack overflow in promise creation should follow the same
rule instead of, say, swallowing the overflow and returning
undefined.

* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::webAssemblyInstantiateFunc):

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

22 months agoClean up URL.h
achristensen@apple.com [Fri, 17 Nov 2017 21:38:11 +0000 (21:38 +0000)]
Clean up URL.h
https://bugs.webkit.org/show_bug.cgi?id=179710

Reviewed by Brady Eidson.

No change in behavior.

* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::urlString const):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::url const):
* platform/URL.cpp:
(WebCore::URL::serialize const): Deleted.
* platform/URL.h:
* platform/mac/URLMac.mm:
(WebCore::URL::createCFURL const):

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

22 months agoClean up after r224952
achristensen@apple.com [Fri, 17 Nov 2017 21:35:30 +0000 (21:35 +0000)]
Clean up after r224952
https://bugs.webkit.org/show_bug.cgi?id=179809

Reviewed by Brady Eidson.

* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread):
(WTF::callOnMainThread):
* wtf/MainThread.h:
* wtf/generic/MainThreadGeneric.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::currentRunLoopInCommonMode): Deleted.
* wtf/mac/MainThreadMac.mm:
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::currentRunLoopInCommonMode): Deleted.
* wtf/win/MainThreadWin.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::currentRunLoopInCommonMode): Deleted.

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

22 months agoUse RunLoop and Mode from NetworkingContext if they are given
achristensen@apple.com [Fri, 17 Nov 2017 21:33:28 +0000 (21:33 +0000)]
Use RunLoop and Mode from NetworkingContext if they are given
https://bugs.webkit.org/show_bug.cgi?id=179800
<rdar://problem/35519421>

Reviewed by Brady Eidson.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(callOnMainThreadOrSchedule):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

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

22 months agoWeb Inspector: Remove WI.instanceForClass
mattbaker@apple.com [Fri, 17 Nov 2017 21:29:43 +0000 (21:29 +0000)]
Web Inspector: Remove WI.instanceForClass
https://bugs.webkit.org/show_bug.cgi?id=179746

Reviewed by Timothy Hatcher.

The implementations of DetailsSidebarPanel subclasses assume that panels
are closed and released when no longer needed. Keeping them alive with
instanceForClass isn't the right choice, since sidebar panels remove their
event listeners when closed.

* UserInterface/Base/Main.js:
(WI.instanceForClass): Deleted.
* UserInterface/Views/DebuggerTabContentView.js:
(WI.DebuggerTabContentView.prototype.showDetailsSidebarPanels):
* UserInterface/Views/TabContentView.js:
(WI.TabContentView.prototype.get detailsSidebarPanels):

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

22 months agoLayoutTest http/tests/inspector/network/har/har-page.html is a flaky failure
commit-queue@webkit.org [Fri, 17 Nov 2017 20:43:11 +0000 (20:43 +0000)]
LayoutTest http/tests/inspector/network/har/har-page.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=179781

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-17
Reviewed by Alexey Proskuryakov.

* http/tests/inspector/network/har/har-page-expected.txt:
* http/tests/inspector/network/har/har-page.html:
Filter out the protocol value since it might not be available if the resource was cached.

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

22 months agoWeb Inspector: ButtonNavigationItem should support image and text button style
mattbaker@apple.com [Fri, 17 Nov 2017 20:38:26 +0000 (20:38 +0000)]
Web Inspector: ButtonNavigationItem should support image and text button style
https://bugs.webkit.org/show_bug.cgi?id=179625
<rdar://problem/35512238>

Reviewed by Joseph Pecoraro.

* UserInterface/Main.html:

* UserInterface/Views/ButtonNavigationItem.css:
(.navigation-bar .item.button):
(.navigation-bar .item.button.image-only):
(.navigation-bar .item.button.image-and-text):
(.navigation-bar .item.button.image-and-text > span):
(.navigation-bar .item.button.text-only):
(.navigation-bar .item.button.text-only.checkbox): Deleted.
(.navigation-bar .item.button.text-only.checkbox label): Deleted.
Checkbox styles have been moved to a separate CSS file.

* UserInterface/Views/ButtonNavigationItem.js:
Add backing data members for the image and label, allowing the DOM
representation of the button to change as needed.

(WI.ButtonNavigationItem):
Remove duplicate role logic. The base class sets the role.

(WI.ButtonNavigationItem.prototype.set label):
(WI.ButtonNavigationItem.prototype.set image):
(WI.ButtonNavigationItem.prototype.get buttonStyle):
(WI.ButtonNavigationItem.prototype.set buttonStyle):
(WI.ButtonNavigationItem.prototype.get additionalClassNames):
(WI.ButtonNavigationItem.prototype._mouseClicked):
(WI.ButtonNavigationItem.prototype._update):
(WI.ButtonNavigationItem.prototype.updateButtonText): Deleted.

* UserInterface/Views/CheckboxNavigationItem.css: Added.
(.navigation-bar .item.checkbox):
(.navigation-bar .item.checkbox label):

* UserInterface/Views/CheckboxNavigationItem.js:
Change base class to NavigationItem, since this item lacks an image
and makes use of an actual label element instead of a span for its text.

(WI.CheckboxNavigationItem):
(WI.CheckboxNavigationItem.prototype._checkboxChanged):
(WI.CheckboxNavigationItem.prototype.updateButtonText): Deleted.

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

22 months agoFETurbulence const and inline cleanup
simon.fraser@apple.com [Fri, 17 Nov 2017 19:39:58 +0000 (19:39 +0000)]
FETurbulence const and inline cleanup
https://bugs.webkit.org/show_bug.cgi?id=179832

Reviewed by Dean Jackson.

Pass the PaintingData& around as const, and remove some 'inline', letting the compiler
decide. Also declare a few variables closer to first use.

Speeds up FETurbulence by about 1%.

* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::initPaint):
(WebCore::FETurbulence::noise2D):
(WebCore::FETurbulence::calculateTurbulenceValueForPoint):
(WebCore::FETurbulence::fillRegion):
* platform/graphics/filters/FETurbulence.h:

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

22 months agoMove destroyLeftoverChildren call to RenderObject::destroy
antti@apple.com [Fri, 17 Nov 2017 19:34:32 +0000 (19:34 +0000)]
Move destroyLeftoverChildren call to RenderObject::destroy
https://bugs.webkit.org/show_bug.cgi?id=179819

Reviewed by Zalan Bujtas.

This is currently called inconsistenly from various willBeDestroyed implementations.
We should always call it before invoking willBeDestroyed.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderElement.h:
(WebCore::RenderElement::setLastChild):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::~RenderLayer):

    Add some release asserts verifying layer has been detached before destruction.
    This would reveal cases where destroyLeftoverChildren was called too late.

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

    Call destroyLeftoverChildren.

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

22 months agoWeb Inspector: Remove FIXMEs for GTK+ missing icons
commit-queue@webkit.org [Fri, 17 Nov 2017 19:29:34 +0000 (19:29 +0000)]
Web Inspector: Remove FIXMEs for GTK+ missing icons
https://bugs.webkit.org/show_bug.cgi?id=155282
<rdar://problem/25076615>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-17
Reviewed by Michael Catanzaro.

* UserInterface/Views/PathComponentIcons.css:
(.source-icon .icon):
(body:not(.mac-platform, .windows-platform) .heap-snapshot-record .icon,): Deleted.
* UserInterface/Views/ResourceIcons.css:
(.large .resource-icon.resource-type-websocket .icon):
(body:not(.mac-platform, .windows-platform) .resource-icon.resource-type-ping .icon,): Deleted.
(body:not(.mac-platform, .windows-platform) .large .resource-icon.resource-type-ping .icon,): Deleted.
All ports now share the same images.

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

22 months agoMark imported/w3c/web-platform-tests/fetch/api/abort/serviceworker-intercepted.https...
ryanhaddad@apple.com [Fri, 17 Nov 2017 19:16:59 +0000 (19:16 +0000)]
Mark imported/w3c/web-platform-tests/fetch/api/abort/serviceworker-intercepted.https.html as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=179773

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

22 months agoSVG scrolling anchor should be reset if the fragmentIdentifier does not exist or...
commit-queue@webkit.org [Fri, 17 Nov 2017 18:40:09 +0000 (18:40 +0000)]
SVG scrolling anchor should be reset if the fragmentIdentifier does not exist or is not provided
https://bugs.webkit.org/show_bug.cgi?id=176577

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-11-17
Reviewed by Simon Fraser.

Source/WebCore:

Because the SVGImage can be cached only once but used multiple times with
different fragmentIdentifiers, SVGImage has to call FrameView::scrollToFragment()
before the image is displayed. If the fragmentIdentifier is not provided
in the URL or it does not exist in the SVGImage, FrameView::scrollToFragment()
has to reset the scrolling anchor of the SVG as if it was not displayed before.
We do not want the previous scrolling anchor to be used when the FrameView
of SVGImage can't scroll to the current fragmentIdentifier for any reason.

Test: http/tests/svg/svg-fragment-url-special-cases.html

* page/FrameView.cpp:
(WebCore::FrameView::scrollToFragment):
(WebCore::FrameView::scrollToAnchor):
(WebCore::FrameView::resetScrollAnchor):
* page/FrameView.h:
* platform/URL.cpp:
(WebCore::URL::fragmentIdentifier const): Call hasFragmentIdentifier()
instead of repeating the same condition.
(WebCore::decodeURLEscapeSequences):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::findViewAnchor const):
(WebCore::SVGSVGElement::findRootAnchor const):
(WebCore::SVGSVGElement::scrollToAnchor): We want to know whether the SVG
root element could scroll to the fragmentIdentifier or not. If it could not,
FrameView::scrollToAnchor() can still try one last time to do the scrolling
only if anchorElement is not nullptr.
(WebCore::SVGSVGElement::resetScrollAnchor): Reset the FrameView scrolling
state to its initial value.
* svg/SVGSVGElement.h:

LayoutTests:

* http/tests/svg/svg-fragment-url-special-cases-expected.html: Added.
* http/tests/svg/svg-fragment-url-special-cases.html: Added.

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

22 months agoServiceWorker intercepted FetchRequest should have their referrer set appropriately.
commit-queue@webkit.org [Fri, 17 Nov 2017 18:33:57 +0000 (18:33 +0000)]
ServiceWorker intercepted FetchRequest should have their referrer set appropriately.
https://bugs.webkit.org/show_bug.cgi?id=179803

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

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/referer.https-expected.txt:
* web-platform-tests/service-workers/service-worker/request-end-to-end.https-expected.txt:

Source/WebCore:

Covered by updated tests.

* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):

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

22 months agoAX: [GTK] Regression: accessibility/gtk/aria-keyshortcuts.html fails after r224953
jdiggs@igalia.com [Fri, 17 Nov 2017 18:27:29 +0000 (18:27 +0000)]
AX: [GTK] Regression: accessibility/gtk/aria-keyshortcuts.html fails after r224953
https://bugs.webkit.org/show_bug.cgi?id=179824

Reviewed by Chris Fleizach.

The failure was due to AXPropertyName::KeyShortcuts not being included in
the group of properties whose value is a string. As a result, the new method
to get string values, AccessibleNode::effectiveStringValueForElement(), was
returning an empty String. This was not caught by the shared set of tests
because at the present time, only WebKitGtk supports aria-keyshortcuts.

No new tests needed. The regression was caught by an existing test.

* accessibility/AccessibleNode.cpp:
(WebCore::isPropertyValueString):

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

22 months agoUnreviewed, rolling out r224952.
ryanhaddad@apple.com [Fri, 17 Nov 2017 18:02:27 +0000 (18:02 +0000)]
Unreviewed, rolling out r224952.

This change introduced LayoutTest failures on WK1.

Reverted changeset:

"Use RunLoop and Mode from NetworkingContext if they are
given"
https://bugs.webkit.org/show_bug.cgi?id=179800
https://trac.webkit.org/changeset/224952

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

22 months ago[Web Animations] Force a stacking context during animations that animate properties...
graouts@webkit.org [Fri, 17 Nov 2017 17:42:35 +0000 (17:42 +0000)]
[Web Animations] Force a stacking context during animations that animate properties that will force a stacking context
https://bugs.webkit.org/show_bug.cgi?id=179811

Reviewed by Dean Jackson.

Source/WebCore:

The Web Animations specification mandates in section 4.7 (w3c.github.io/web-animations/#side-effects-section) that
"for every property targeted by at least one animation effect that is current or in effect, the user agent must act
as if the will-change property ([css-will-change-1]) on the target element includes the property."

After parsing new keyframes, we check if any of the CSS properties that get animated would end up forcing a stacking
context, and if so, enforce a stacking context during the entire active lifetime of the animation.

Test: webanimations/animation-opacity-animation-crash.html

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::processKeyframes):
(WebCore::KeyframeEffect::computeStackingContextImpact):
(WebCore::KeyframeEffect::applyAtLocalTime):
* animation/KeyframeEffect.h:

LayoutTests:

Adding a new test that would crash otherwise because we wouldn't adequately force a stacking
context as the animation would begin.

* webanimations/animation-opacity-animation-crash-expected.txt: Added.
* webanimations/animation-opacity-animation-crash.html: Added.

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

22 months agoUpdate feature status for Visual Viewport API to "In Development"
commit-queue@webkit.org [Fri, 17 Nov 2017 16:25:15 +0000 (16:25 +0000)]
Update feature status for Visual Viewport API to "In Development"
https://bugs.webkit.org/show_bug.cgi?id=179818

Patch by Ali Juma <ajuma@chromium.org> on 2017-11-17
Reviewed by Frédéric Wang.

Work on this feature has started, tracked by bug 170982.

No new tests since there's no change in behavior.

* features.json:

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

22 months agoUnreviewed, mark regress-178385.js as memory exhausting
utatane.tea@gmail.com [Fri, 17 Nov 2017 06:33:11 +0000 (06:33 +0000)]
Unreviewed, mark regress-178385.js as memory exhausting

* stress/regress-178385.js:

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

22 months agoUnreviewed, rolling out r224921.
commit-queue@webkit.org [Fri, 17 Nov 2017 06:17:45 +0000 (06:17 +0000)]
Unreviewed, rolling out r224921.
https://bugs.webkit.org/show_bug.cgi?id=179813

We shouldn't be doing this (Requested by ap on #webkit).

Reverted changeset:

"Remove the outdated and unmaintained copies of the tests in
wpt/2dcontext/the-canvas-state/."
https://bugs.webkit.org/show_bug.cgi?id=179769
https://trac.webkit.org/changeset/224921

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

22 months ago[WinCairo] Add network (curl) files for wincairo webkit
commit-queue@webkit.org [Fri, 17 Nov 2017 06:14:28 +0000 (06:14 +0000)]
[WinCairo] Add network (curl) files for wincairo webkit
https://bugs.webkit.org/show_bug.cgi?id=179474

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2017-11-16
Reviewed by Alex Christensen.

Source/WebCore:

No new behvaior, no new tests.

* PlatformWinCairo.cmake:
* platform/Curl.cmake:
* platform/network/curl/CookieStorageCurl.cpp: Added.
(WebCore::startObservingCookieChanges):
(WebCore::stopObservingCookieChanges):
* platform/network/curl/NetworkStorageSessionCurl.cpp: Added.
(WebCore::NetworkStorageSession::~NetworkStorageSession):
(WebCore::NetworkStorageSession::context const):
(WebCore::defaultSession):
(WebCore::NetworkStorageSession::ensureSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::setCookies):
(WebCore::NetworkStorageSession::setCookie):
(WebCore::NetworkStorageSession::deleteCookie):
(WebCore::NetworkStorageSession::getAllCookies):
(WebCore::NetworkStorageSession::getCookies):
(WebCore::NetworkStorageSession::flushCookieStore):

Source/WebKit:

* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<CertificateInfo>::decode): Fidex return value since currently no operation is needed for wincairo webkit.
(IPC::ArgumentCoder<ResourceError>::decodePlatformData): Fidex return value since currently no operation is needed for wincairo webkit.
* WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp.
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
* WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h.

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

22 months agoFix occasional crash when adding and removing videos
achristensen@apple.com [Fri, 17 Nov 2017 05:49:55 +0000 (05:49 +0000)]
Fix occasional crash when adding and removing videos
https://bugs.webkit.org/show_bug.cgi?id=179792

Reviewed by Geoffrey Garen.

In taskCompleted we null out session, and in resume we call _restart on the main thread.
If _restart is called after taskCompleted, we want to do nothing.
Right now we are calling a method on self.session.loader which is a PlatformMediaResourceLoader&
but in ObjC if session is null it will call PlatformMediaResourceLoader::requestResource with a
null this pointer, which crashes.  Let's not crash.

* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask _restart]):
Early return if we don't have a session.

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

22 months ago[WinCairo] Update WinCairoRequirements
don.olmstead@sony.com [Fri, 17 Nov 2017 03:36:59 +0000 (03:36 +0000)]
[WinCairo] Update WinCairoRequirements
https://bugs.webkit.org/show_bug.cgi?id=179790

Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsWinCairo.cmake:

Source/WebCore:

No new tests. No change in behavior.

* PlatformWin.cmake:

Source/WebKit:

* PlatformWin.cmake:

Tools:

* TestWebKitAPI/PlatformWin.cmake:

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

22 months agoUnreviewed, rebaseline skipped / flaky service worker tests
cdumez@apple.com [Fri, 17 Nov 2017 03:28:06 +0000 (03:28 +0000)]
Unreviewed, rebaseline skipped / flaky service worker tests

* web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https-expected.txt:
* web-platform-tests/service-workers/service-worker/respond-with-body-accessed-response.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt:

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

22 months ago[Web Animations] Allow KeyframeEffect to support CSS property animation blending
graouts@webkit.org [Fri, 17 Nov 2017 03:25:07 +0000 (03:25 +0000)]
[Web Animations] Allow KeyframeEffect to support CSS property animation blending
https://bugs.webkit.org/show_bug.cgi?id=179810

Reviewed by Tim Horton.

We used to pass nullptr instead of a valid AnimationBase when calling CSSPropertyAnimation::blendProperties()
in KeyframeEffect::applyAtLocalTime() when blending CSS styles during a keyframe animation. Without this
AnimationBase, some blending functions would crash as certain supporting calls couldn't be made.

We now add a new CSSPropertyBlendingClient virtual interface that both KeyframeEffect and AnimationBase
implement and that CSSPropertyAnimation::blendProperties() take as a parameter in order to support
blending code.

* WebCore.xcodeproj/project.pbxproj:
* animation/CSSPropertyBlendingClient.h: Added.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::applyAtLocalTime):
(WebCore::KeyframeEffect::renderer const):
(WebCore::KeyframeEffect::currentStyle const):
* animation/KeyframeEffect.h:
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::isAccelerated const):
(WebCore::AnimationBase::transformFunctionListsMatch const):
(WebCore::AnimationBase::filterFunctionListsMatch const):
(WebCore::AnimationBase::backdropFilterFunctionListsMatch const):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::blendFilterOperations):
(WebCore::blendFilter):
(WebCore::crossfadeBlend):
(WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const):
(WebCore::PropertyWrapperShadow::blendSimpleOrMatchedShadowLists const):
(WebCore::PropertyWrapperShadow::blendMismatchedShadowLists const):
(WebCore::CSSPropertyAnimation::blendProperties):
* page/animation/CSSPropertyAnimation.h:

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

22 months agoService Worker should get the body of intercepted requests
commit-queue@webkit.org [Fri, 17 Nov 2017 02:36:03 +0000 (02:36 +0000)]
Service Worker should get the body of intercepted requests
https://bugs.webkit.org/show_bug.cgi?id=179776

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-16
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* imported/w3c/web-platform-tests/fetch/api/request/request-consume-empty-expected.txt:
* imported/w3c/web-platform-tests/fetch/api/request/request-init-002-expected.txt:
* imported/w3c/web-platform-tests/fetch/api/response/response-consume-empty-expected.txt:
* imported/w3c/web-platform-tests/fetch/api/response/response-consume-expected.txt:
* imported/w3c/web-platform-tests/fetch/api/response/response-init-002-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-xhr.https-expected.txt:

Source/WebCore:

Test: http/tests/workers/service/service-worker-request-with-body.https.html

Make use of FetchBodyConsumer to store raw data for FetchRequest.
This is used when setting FetchRequest body from a FormData.
If FormData is only bytes (no blob, no file), FetchBodyConsumer will store that data.
This allows Service Worker to get access to simple request bodies.

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::fromFormData):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::bodyAsFormData const): Making sure body is set appropriately when used to make fetch load.
* Modules/fetch/FetchBody.h: Making some methods private.
* Modules/fetch/FetchBodyConsumer.h: Adding accessors.
(WebCore::FetchBodyConsumer::hasData const):
(WebCore::FetchBodyConsumer::data const):
* Modules/fetch/FetchRequest.h:
(WebCore::FetchRequest::FetchRequest):
* platform/network/FormData.cpp:
(WebCore::FormData::asSharedBuffer const):
* platform/network/FormData.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent): Setting FetchRequest body based on given FormData.

Source/WebKit:

Pass a FormDataReference when starting fetch IPC.
Convert this FormDataReference in a FormData and using it to set the FetchRequest body properly in Service Worker process.
Forbid fetch interception when URL is not HTTP/HTTPS.

* Platform/IPC/FormDataReference.h:
(IPC::FormDataReference::FormDataReference):
(IPC::FormDataReference::takeData):
(IPC::FormDataReference::encode const):
(IPC::FormDataReference::decode):
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::startFetch):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::handleFetch):

LayoutTests:

* http/tests/workers/service/resources/service-worker-fetch.js:
* http/tests/workers/service/service-worker-fetch.https-expected.txt:
* http/tests/workers/service/resources/service-worker-request-with-body-worker.js: Added.
* http/tests/workers/service/service-worker-request-with-body.https-expected.txt: Added.
* http/tests/workers/service/service-worker-request-with-body.https.html: Added.

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

22 months agoMake sure service workers get terminated between tests
cdumez@apple.com [Fri, 17 Nov 2017 02:32:12 +0000 (02:32 +0000)]
Make sure service workers get terminated between tests
https://bugs.webkit.org/show_bug.cgi?id=179774

Reviewed by Alex Christensen.

Make sure service workers get terminated between tests. Previously, we
would merely clear all registrations and job queues but it would not
cause the registrations' service workers to get terminated.

* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::updateExtendedEventsSet):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clearAll):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
(WebCore::SWServerJobQueue::scriptContextFailedToStart):
(WebCore::SWServerJobQueue::didFinishInstall):
(WebCore::SWServerJobQueue::tryClearRegistration):
(WebCore::SWServerJobQueue::clearRegistration):
* workers/service/server/SWServerJobQueue.h:

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

22 months agoFetchLoader should unregister its blob URL
commit-queue@webkit.org [Fri, 17 Nov 2017 02:29:04 +0000 (02:29 +0000)]
FetchLoader should unregister its blob URL
https://bugs.webkit.org/show_bug.cgi?id=179768

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-16
Reviewed by Alex Christensen.

No observable change.

Keep the blob URL used for reading and unregister it in destructor.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::~FetchLoader):
(WebCore::FetchLoader::start):
* Modules/fetch/FetchLoader.h:

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

22 months agoAX: AOM: Implement string type properties
n_wang@apple.com [Fri, 17 Nov 2017 02:24:53 +0000 (02:24 +0000)]
AX: AOM: Implement string type properties
https://bugs.webkit.org/show_bug.cgi?id=179495

Reviewed by Chris Fleizach.

Source/WebCore:

Implemented the rest of the string type properties for Accessibility
Object Model.

Test: accessibility/mac/AOM-string-properties.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleLiveRegionCreated):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::childrenChanged):
(WebCore::AccessibilityNodeObject::isPressed const):
(WebCore::AccessibilityNodeObject::isChecked const):
(WebCore::AccessibilityNodeObject::valueDescription const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
(WebCore::AccessibilityObject::supportsAutoComplete const):
(WebCore::AccessibilityObject::autoCompleteValue const):
(WebCore::AccessibilityObject::invalidStatus const):
(WebCore::AccessibilityObject::supportsCurrent const):
(WebCore::AccessibilityObject::currentState const):
(WebCore::AccessibilityObject::currentValue const):
(WebCore::AccessibilityObject::roleDescription const):
(WebCore::AccessibilityObject::keyShortcutsValue const):
(WebCore::AccessibilityObject::placeholderValue const):
(WebCore::AccessibilityObject::isInsideLiveRegion const):
(WebCore::AccessibilityObject::liveRegionAncestor const):
(WebCore::AccessibilityObject::supportsARIAAttributes const):
(WebCore::AccessibilityObject::supportsLiveRegion const):
(WebCore::AccessibilityObject::sortDirection const):
(WebCore::AccessibilityObject::supportsHasPopup const):
(WebCore::AccessibilityObject::hasPopupValue const):
(WebCore::AccessibilityObject::supportsPressed const):
(WebCore::AccessibilityObject::checkboxOrRadioValue const):
(WebCore::AccessibilityObject::pressedIsPresent const):
(WebCore::AccessibilityObject::buttonRoleType const):
(WebCore::AccessibilityObject::supportsARIAAutoComplete const): Deleted.
(WebCore::AccessibilityObject::ariaAutoCompleteValue const): Deleted.
(WebCore::AccessibilityObject::supportsARIACurrent const): Deleted.
(WebCore::AccessibilityObject::ariaCurrentState const): Deleted.
(WebCore::AccessibilityObject::ariaCurrentValue const): Deleted.
(WebCore::AccessibilityObject::ariaKeyShortcutsValue const): Deleted.
(WebCore::AccessibilityObject::isInsideARIALiveRegion const): Deleted.
(WebCore::AccessibilityObject::ariaLiveRegionAncestor const): Deleted.
(WebCore::AccessibilityObject::supportsARIALiveRegion const): Deleted.
(WebCore::AccessibilityObject::supportsARIAHasPopup const): Deleted.
(WebCore::AccessibilityObject::ariaPopupValue const): Deleted.
(WebCore::AccessibilityObject::supportsARIAPressed const): Deleted.
(WebCore::AccessibilityObject::ariaPressedIsPresent const): Deleted.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::hasPopup const):
(WebCore::AccessibilityObject::liveRegionStatus const):
(WebCore::AccessibilityObject::liveRegionRelevant const):
(WebCore::AccessibilityObject::liveRegionAtomic const):
(WebCore::AccessibilityObject::ariaHasPopup const): Deleted.
(WebCore::AccessibilityObject::ariaLiveRegionStatus const): Deleted.
(WebCore::AccessibilityObject::ariaLiveRegionRelevant const): Deleted.
(WebCore::AccessibilityObject::ariaLiveRegionAtomic const): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::hasPopup const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::orientation const):
(WebCore::AccessibilityRenderObject::textChanged):
(WebCore::AccessibilityRenderObject::liveRegionStatus const):
(WebCore::AccessibilityRenderObject::liveRegionRelevant const):
(WebCore::AccessibilityRenderObject::liveRegionAtomic const):
(WebCore::AccessibilityRenderObject::ariaHasPopup const): Deleted.
(WebCore::AccessibilityRenderObject::ariaLiveRegionStatus const): Deleted.
(WebCore::AccessibilityRenderObject::ariaLiveRegionRelevant const): Deleted.
(WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibleNode.cpp:
(WebCore::ariaAttributeMap):
(WebCore::isPropertyValueString):
(WebCore::AccessibleNode::notifyAttributeChanged):
(WebCore::AccessibleNode::autocomplete const):
(WebCore::AccessibleNode::setAutocomplete):
(WebCore::AccessibleNode::checked const):
(WebCore::AccessibleNode::setChecked):
(WebCore::AccessibleNode::current const):
(WebCore::AccessibleNode::setCurrent):
(WebCore::AccessibleNode::hasPopUp const):
(WebCore::AccessibleNode::setHasPopUp):
(WebCore::AccessibleNode::invalid const):
(WebCore::AccessibleNode::setInvalid):
(WebCore::AccessibleNode::keyShortcuts const):
(WebCore::AccessibleNode::setKeyShortcuts):
(WebCore::AccessibleNode::live const):
(WebCore::AccessibleNode::setLive):
(WebCore::AccessibleNode::setLabel):
(WebCore::AccessibleNode::orientation const):
(WebCore::AccessibleNode::setOrientation):
(WebCore::AccessibleNode::placeholder const):
(WebCore::AccessibleNode::setPlaceholder):
(WebCore::AccessibleNode::pressed const):
(WebCore::AccessibleNode::setPressed):
(WebCore::AccessibleNode::relevant const):
(WebCore::AccessibleNode::setRelevant):
(WebCore::AccessibleNode::role const):
(WebCore::AccessibleNode::setRole):
(WebCore::AccessibleNode::roleDescription const):
(WebCore::AccessibleNode::setRoleDescription):
(WebCore::AccessibleNode::sort const):
(WebCore::AccessibleNode::setSort):
(WebCore::AccessibleNode::valueText const):
(WebCore::AccessibleNode::setValueText):
* accessibility/AccessibleNode.h:
(WebCore::AXPropertyHashTraits::constructDeletedValue):
(WebCore::AXPropertyHashTraits::isDeletedValue):
* accessibility/AccessibleNode.idl:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(atkRole):
(setAtkStateSetFromCoreObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
(-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionStatus]):
(-[WebAccessibilityObjectWrapper accessibilityARIARelevantStatus]):
(-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
(-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
(-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

LayoutTests:

* accessibility/accessibility-object-model.html:
* accessibility/mac/AOM-string-properties-expected.txt: Added.
* accessibility/mac/AOM-string-properties.html: Added.

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

22 months agoUse RunLoop and Mode from NetworkingContext if they are given
achristensen@apple.com [Fri, 17 Nov 2017 01:34:41 +0000 (01:34 +0000)]
Use RunLoop and Mode from NetworkingContext if they are given
https://bugs.webkit.org/show_bug.cgi?id=179800
<rdar://problem/35519421>

Reviewed by Brady Eidson.

We used to call [NSURLConnection scheduleInRunLoop:forMode:] before r224267.
That change broke WebKitLegacy clients using custom run loop modes, which I partially fixed in r224687 and r224896,
but that hangs if there are any non-scheduled calls to callOnMainThread and it ignores the CFRunLoop part of the SchedulePair.
This is a more elegant solution that fixes all known bugs with custom run loop modes and makes the
behavior as close to the pre-r224267 behavior as possible by using all parameters in a good way.

I verified the bug in the radar is fixed, the API test WebKitLegacy.ScheduleInRunLoop still passes,
and UIWebView still works on iOS.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(callOnMainThreadOrSchedule):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

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

22 months agoAdd feature define for alternative presentation button element
dbates@webkit.org [Fri, 17 Nov 2017 01:17:25 +0000 (01:17 +0000)]
Add feature define for alternative presentation button element
https://bugs.webkit.org/show_bug.cgi?id=179692
Part of <rdar://problem/34917108>

Reviewed by Andy Estes.

Only enabled on Cocoa platforms by default.

.:

* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

22 months agoVersioning.
jmarcell@apple.com [Fri, 17 Nov 2017 01:15:21 +0000 (01:15 +0000)]
Versioning.

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

22 months agoMark test262/test/language/statements/class/definition/fn-name-static-precedence...
ryanhaddad@apple.com [Fri, 17 Nov 2017 01:04:11 +0000 (01:04 +0000)]
Mark test262/test/language/statements/class/definition/fn-name-static-precedence.js as passing after r224927.

Unreviewed test gardening.

* test262.yaml:

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

22 months ago[Service Worker] Implement "Try Clear Registration" algorithm
cdumez@apple.com [Fri, 17 Nov 2017 00:59:10 +0000 (00:59 +0000)]
[Service Worker] Implement "Try Clear Registration" algorithm
https://bugs.webkit.org/show_bug.cgi?id=179791

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline several WPT tests that are now passing or failing later.

* web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https-expected.txt:
* web-platform-tests/service-workers/service-worker/getregistrations.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ready.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register.https-expected.txt:

Source/WebCore:

Implement "Try Clear Registration" algorithm:
- https://w3c.github.io/ServiceWorker/#try-clear-registration-algorithm

In particular, a SWServerRegistration now knows if it is "in use" by a given
service worker client (i.e. The registration's active service worker is
controlling the service worker client). See:
- https://w3c.github.io/ServiceWorker/#selection (last paragraph)

No new tests, rebaselined existing tests.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::setActiveServiceWorker):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::serviceWorkerStartedControllingClient):
(WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient):
(WebCore::SWServer::serviceWorkerStartedControllingClient):
(WebCore::SWServer::serviceWorkerStoppedControllingClient):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::tryClearRegistration):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::hasClientsUsingRegistration const):
(WebCore::SWServerRegistration::addClientUsingRegistration):
(WebCore::SWServerRegistration::removeClientUsingRegistration):

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
(WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
* WebProcess/Storage/WebSWClientConnection.h:

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

22 months agoMark imported/w3c/web-platform-tests/fetch/api/abort/serviceworker-intercepted.https...
ryanhaddad@apple.com [Fri, 17 Nov 2017 00:52:51 +0000 (00:52 +0000)]
Mark imported/w3c/web-platform-tests/fetch/api/abort/serviceworker-intercepted.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=179773

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

22 months agoREGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availabil...
mcatanzaro@igalia.com [Fri, 17 Nov 2017 00:48:21 +0000 (00:48 +0000)]
REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState
https://bugs.webkit.org/show_bug.cgi?id=179797

Reviewed by Simon Fraser.

Source/WebCore:

Editor::canUndo and Editor::CanRedo no longer need to be exported.

* editing/Editor.h:

Source/WebKit:

r224179 introduced a performance regression. The newly-added code in WebPage::editorState is
part of a performance-critical path. (The editor state is computed and sent to the UI
process during the layer flush.) Calls to Editor::canUndo and Editor::canRedo were added,
but these calls are both implemented with sync IPC calls to WebPageProxy in the UI process.
WebPageProxy passes them along to PageClientImpl to compute the availability of the
commands.

That's all pointless because this code only exists for the purpose of getting editing
command availability to the UI process. In the case of undo and redo, it's not needed at
all. I did not realize that when writing the code. So canUndo and canRedo should be removed
from EditorState. This ought to be sufficient to avoid the perf regression.

No changes are needed to the GTK/WPE WebKitEditorState API. The API is reimplemented using
WebPageProxy::canUndoRedo instead of EditorState. There should be no changes in behavior,
only performance.

* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:
* UIProcess/API/glib/WebKitEditorState.cpp:
(webkitEditorStateCreate):
(webkitEditorStateChanged):
* UIProcess/API/glib/WebKitEditorStatePrivate.h:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_get_editor_state):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canUndo):
(WebKit::WebPageProxy::canRedo):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState const):

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

22 months agoDispatching an event on a ServiceWorkerRegistration may fail or crash due to GC
cdumez@apple.com [Fri, 17 Nov 2017 00:45:06 +0000 (00:45 +0000)]
Dispatching an event on a ServiceWorkerRegistration may fail or crash due to GC
https://bugs.webkit.org/show_bug.cgi?id=179751

Reviewed by Geoffrey Garen.

Source/WebCore:

Dispatching an event on a ServiceWorkerRegistration may fail or crash due to GC. We
need to make sure that a ServiceWorkerRegistration's wrapper stays alive as long as
we may dispatch events on it.

Keep the wrapper alive by making ServiceWorker an ActiveDOMObject and making sure the
implementation object keeps a PendingActivity alive while it may dispatch JS events.
The only event dispatched on ServiceWorkerRegistration objects is the "updatefound"
one. We may dispatch updatefound events on a ServiceWorkerRegistration until the
registration gets cleared on server side, in which case the ServiceWorkerRegistration
object ends up with no service worker. We therefore take a PendingActivity when the
ServiceWorkerRegistration is constructed and we release it once the registration has
no more associated ServiceWorker or the ActiveDOMObject is stopped (to avoid leaks on
navigation).

Test: http/tests/workers/service/service-worker-registration-gc-event.html

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::getOrCreate):
(WebCore::ServiceWorkerRegistration::updateStateFromServer):
(WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
(WebCore::ServiceWorkerRegistration::stop):
(WebCore::ServiceWorkerRegistration::updatePendingActivityForEventDispatch):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistration.idl:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/service-worker-registration-gc-event-expected.txt: Added.
* http/tests/workers/service/service-worker-registration-gc-event.html: Added.

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

22 months agoCrash in WebCore::SWServerJobQueue::scriptFetchFinished(WebCore::SWServer::Connection...
cdumez@apple.com [Fri, 17 Nov 2017 00:35:51 +0000 (00:35 +0000)]
Crash in WebCore::SWServerJobQueue::scriptFetchFinished(WebCore::SWServer::Connection&, WebCore::ServiceWorkerFetchResult const&) + 77
https://bugs.webkit.org/show_bug.cgi?id=179394
<rdar://problem/35478190>

Reviewed by Youenn Fablet.

In SWServerJobQueue::scriptFetchFinished(), make sure the job queue is still processing the
job that triggered the fetch. If it is not, ignore the callback.

This could happen when calling SWServer::clear() while a script fetch was pending.

No new tests, already covered by existing tests that sometimes crash on the bots.

* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::isCurrentlyProcessingJob const):
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerJobQueue.h:

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

22 months agoFix a bug with cpuid in the FTL.
sbarati@apple.com [Fri, 17 Nov 2017 00:35:49 +0000 (00:35 +0000)]
Fix a bug with cpuid in the FTL.

Rubber stamped by Mark Lam.

Before uploading the previous patch, I tried to condense the code. I
accidentally removed a crucial line saying that CPUID clobbers various
registers.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCPUIntrinsic):

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

22 months agoCrash in worker tests handling the m_stoppedCallback.
beidson@apple.com [Fri, 17 Nov 2017 00:28:30 +0000 (00:28 +0000)]
Crash in worker tests handling the m_stoppedCallback.
<rdar://problem/35590875> and https://bugs.webkit.org/show_bug.cgi?id=179798

Reviewed by Chris Dumez.

No new tests (Covered by existing tests).

Protect manipulation of m_stoppedCallback with m_threadCreationAndWorkerGlobalScopeMutex.

* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
(WebCore::WorkerThread::stop):

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

22 months agoMarked svg/wicd/test-rightsizing-a.xhtml as flaky.
jlewis3@apple.com [Fri, 17 Nov 2017 00:26:30 +0000 (00:26 +0000)]
Marked svg/wicd/test-rightsizing-a.xhtml as flaky.
https://bugs.webkit.org/show_bug.cgi?id=179176

Unreviewed test gardening.

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

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

22 months ago[Web Animations] Express time in milliseconds through the API
commit-queue@webkit.org [Thu, 16 Nov 2017 23:56:13 +0000 (23:56 +0000)]
[Web Animations] Express time in milliseconds through the API
https://bugs.webkit.org/show_bug.cgi?id=179799

Patch by Antoine Quint <graouts@apple.com> on 2017-11-16
Reviewed by Simon Fraser.

Source/WebCore:

While internally we use seconds to specify times and durations, the Web Animations API
uses milliseconds, so we have to convert times and durations from and to milliseconds.

* animation/AnimationEffectTiming.h:
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::bindingsCurrentTime):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::bindingsStartTime const):
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::bindingsCurrentTime const):
(WebCore::WebAnimation::setBindingsCurrentTime):
* testing/Internals.cpp:
(WebCore::Internals::setTimelineCurrentTime):

LayoutTests:

Update tests to use milliseconds rather than seconds.

* http/wpt/wk-web-animations/timing-model/animation-current-time.html:
* http/wpt/wk-web-animations/timing-model/animation-interface-start-time-property.html:
* http/wpt/wk-web-animations/timing-model/animation-playback-rate.html:
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html:
* http/wpt/wk-web-animations/timing-model/timeline-current-time.html:

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

22 months agoAdd some X86 intrinsics to $vm to help with some perf testing
sbarati@apple.com [Thu, 16 Nov 2017 23:44:12 +0000 (23:44 +0000)]
Add some X86 intrinsics to $vm to help with some perf testing
https://bugs.webkit.org/show_bug.cgi?id=179693

Reviewed by Mark Lam.

I've been doing some local perf testing of various ideas and have
had these come in handy. I'm going to land them to dollarVM to prevent
having to add them to my local build every time I do perf testing.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::mfence):
(JSC::MacroAssemblerX86Common::rdtsc):
(JSC::MacroAssemblerX86Common::pause):
(JSC::MacroAssemblerX86Common::cpuid):
* assembler/X86Assembler.h:
(JSC::X86Assembler::rdtsc):
(JSC::X86Assembler::pause):
(JSC::X86Assembler::cpuid):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGNode.h:
(JSC::DFG::Node::intrinsic):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileCPUIntrinsic):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* tools/JSDollarVM.cpp:
(JSC::functionCpuMfence):
(JSC::functionCpuRdtsc):
(JSC::functionCpuCpuid):
(JSC::functionCpuPause):
(JSC::functionCpuClflush):
(JSC::JSDollarVM::finishCreation):

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

22 months agoREGRESSION(r224887): GCC 5 build broken
mcatanzaro@igalia.com [Thu, 16 Nov 2017 23:27:59 +0000 (23:27 +0000)]
REGRESSION(r224887): GCC 5 build broken
https://bugs.webkit.org/show_bug.cgi?id=179750

Reviewed by Jer Noble.

Add a legacy FourCC constructor that will be used only when building with GCC 5. This is
bad, but it seems acceptable for use with a fallback codepath.

Unfortunately, this requires adjusting some initializations to avoid ambiguity with the
uint32_t constructor.

* platform/graphics/FourCC.h:
(WebCore::FourCC::FourCC):
* platform/graphics/iso/ISOBox.cpp:
(WebCore::ISOBox::peekBox):
* platform/graphics/iso/ISOBox.h:
* platform/graphics/iso/ISOOriginalFormatBox.h:
* platform/graphics/iso/ISOSchemeTypeBox.h:

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

22 months agoMarked multiple http/tests/cache/disk-cache/ tests as flaky.
jlewis3@apple.com [Thu, 16 Nov 2017 22:27:46 +0000 (22:27 +0000)]
Marked multiple http/tests/cache/disk-cache/ tests as flaky.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

22 months ago[Payment Request] Update feature status to "Supported In Preview"
aestes@apple.com [Thu, 16 Nov 2017 21:59:39 +0000 (21:59 +0000)]
[Payment Request] Update feature status to "Supported In Preview"
https://bugs.webkit.org/show_bug.cgi?id=179793

Reviewed by Tim Horton.

* features.json:

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

22 months agoClean up KeyframeEffect
commit-queue@webkit.org [Thu, 16 Nov 2017 20:38:25 +0000 (20:38 +0000)]
Clean up KeyframeEffect
https://bugs.webkit.org/show_bug.cgi?id=179777

Patch by Antoine Quint <graouts@apple.com> on 2017-11-16
Reviewed by Daniel Bates.

A few review comments came in after https://bugs.webkit.org/show_bug.cgi?id=179707 landed,
addressing them with this follow-up patch.

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create): Use "keyframeEffect" instead of "result" for clarity.
(WebCore::KeyframeEffect::processKeyframes): Use consistent index and length types while iterating
over properties in PropertyNameArray and explicitly size the properties array since we already
know its final size.
* dom/Element.cpp:
(WebCore::Element::getAnimations):

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

22 months agoAlways invoke RenderObject::insertedIntoTree/willBeRemovedFromTree
zalan@apple.com [Thu, 16 Nov 2017 20:26:37 +0000 (20:26 +0000)]
Always invoke RenderObject::insertedIntoTree/willBeRemovedFromTree
https://bugs.webkit.org/show_bug.cgi?id=178007

Reviewed by Antti Koivisto.

Based on Antti Koivisto's patch:
These call are currently skipped in some cases making them bug prone and difficult to reason about.
This is done as an optimization that doesn't appear to be valuable anymore.

Covered by existing tests.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::makeChildrenNonInline):
(WebCore::RenderBlock::dropAnonymousBoxChild):
(WebCore::RenderBlock::takeChild):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
(WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::splitAnonymousBoxesAroundChild):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo):
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::moveChildTo):
(WebCore::RenderBoxModelObject::moveAllChildrenTo):
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChild):
(WebCore::RenderElement::takeChild):
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
(WebCore::RenderElement::handleDynamicFloatPositionChange):
* rendering/RenderElement.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::splitInlines):
(WebCore::RenderInline::splitFlow):
(WebCore::RenderInline::childBecameNonInline):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveInlineChildren):
(WebCore::RenderRubyBase::moveBlockChildren):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows):
* style/RenderTreeUpdaterMultiColumn.cpp:
(WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):

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

22 months agoimported/w3c/web-platform-tests/2dcontext/the-canvas-state/canvas_state_restore_001...
commit-queue@webkit.org [Thu, 16 Nov 2017 20:02:28 +0000 (20:02 +0000)]
imported/w3c/web-platform-tests/2dcontext/the-canvas-state/canvas_state_restore_001.htm is an ImageOnlyFailure
https://bugs.webkit.org/show_bug.cgi?id=179786

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-16

* TestExpectations: Temporarily marking test as failing.

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

22 months agoRemove allowBlockSelection as block selection is not supported anymore
megan_gardner@apple.com [Thu, 16 Nov 2017 19:33:57 +0000 (19:33 +0000)]
Remove allowBlockSelection as block selection is not supported anymore
https://bugs.webkit.org/show_bug.cgi?id=179738

Reviewed by Tim Horton.

Remove all instances of the alloweBlockSelection flag. Blocks selection is fully disabled
and thus this flag will do nothing. This was only added as a debug measure last year, and nothing
ever actually used it.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _allowsBlockSelection]): Deleted.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _allowsBlockSelection]): Deleted.
(-[WKWebViewConfiguration _setAllowsBlockSelection:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::allowsBlockSelection): Deleted.
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:

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

22 months agoAdd a base class for HTMLCanvasElement and OffscreenCanvas
dino@apple.com [Thu, 16 Nov 2017 19:19:39 +0000 (19:19 +0000)]
Add a base class for HTMLCanvasElement and OffscreenCanvas
https://bugs.webkit.org/show_bug.cgi?id=179701
<rdar://problem/35545195>

Reviewed by Sam Weinig.

In order for OffscreenCanvas to be able to create a WebGLRenderingContext,
there needs to be a shared base class with HTMLCanvasElement. Add such a
class called CanvasBase.

There is a lot of potential for functionality to move into the base class, but
unfortunately HTMLCanvasElement is a bit messy. It implements a lot of the 2d
rendering context functionality, and also many const functions that actually
cause changes. Thus, things like the canvas size have to remain in the subclasses
for now.

The existence of the new base class meant the canvas() accessor in CanvasRenderingContext
had to move out into the subclasses, and do the correct casting. Eventually, at least
for WebGLRenderingContext, this will have a change in behaviour, but for now we only
ever use HTMLCanvasElements, so most of these changes are just for the sake of
compilation.

No behaviour change - covered by existing tests.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/CanvasBase.cpp: Copied from Source/WebCore/html/canvas/GPUBasedCanvasRenderingContext.h.
(WebCore::CanvasBase::CanvasBase): New base class.
(WebCore::CanvasBase::asHTMLCanvasElement): Casts to an HTMLCanvasElement*, which many of the
rendering context code uses.
* html/CanvasBase.h: Copied from Source/WebCore/html/canvas/GPUBasedCanvasRenderingContext.h.
(WebCore::CanvasBase::isHTMLCanvasElement const):
(WebCore::CanvasBase::isOffscreenCanvas const):
(WebCore::CanvasBase::setOriginClean):
(WebCore::CanvasBase::setOriginTainted):
(WebCore::CanvasBase::originClean const):
(WebCore::CanvasBase::securityOrigin const):
(WebCore::CanvasBase::scriptExecutionContext const):

* html/HTMLCanvasElement.cpp: Use the base class methods where possible.
(WebCore::HTMLCanvasElement::HTMLCanvasElement):
(WebCore::HTMLCanvasElement::toDataURL):
(WebCore::HTMLCanvasElement::toBlob):
(WebCore::HTMLCanvasElement::createImageBuffer const): Be explict as to
which of the derived classes scriptExecutionContext() method we are calling.

* html/HTMLCanvasElement.h: Use the base class, mark a few things as virtual,
and remove the parts that are now in CanvasBase.

* html/OffscreenCanvas.cpp: Use the base class.
(WebCore::OffscreenCanvas::OffscreenCanvas):
(WebCore::OffscreenCanvas::size const):
(WebCore::OffscreenCanvas::setSize):
* html/OffscreenCanvas.h:

* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::CanvasRenderingContext):
(WebCore::CanvasRenderingContext::ref): Call the correct ref/deref functions, depending
on the base class type.
(WebCore::CanvasRenderingContext::deref):
(WebCore::CanvasRenderingContext::wouldTaintOrigin): We no longer have a canvas() method.
(WebCore::CanvasRenderingContext::checkOrigin):

* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::canvasBase const): Add this accessor to the base canvas object
to replace the canvas() call.
(WebCore::CanvasRenderingContext::checkOrigin):
(WebCore::CanvasRenderingContext::ref): Deleted.
(WebCore::CanvasRenderingContext::deref): Deleted.
(WebCore::CanvasRenderingContext::canvas const): Deleted.

* html/canvas/CanvasRenderingContext2D.cpp: Use the base class.
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/GPUBasedCanvasRenderingContext.h:
(WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext):
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
(WebCore::ImageBitmapRenderingContext::canvas const):
(WebCore::ImageBitmapRenderingContext::setOutputBitmap):
* html/canvas/ImageBitmapRenderingContext.h:
* html/canvas/PlaceholderRenderingContext.cpp:
(WebCore::PlaceholderRenderingContext::PlaceholderRenderingContext):
* html/canvas/PlaceholderRenderingContext.h:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext):

* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create): Assume that we're still getting an HTMLCanvasElement,
but protect some of the logic just in case we don't.
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::canvas):
(WebCore::WebGLRenderingContextBase::checkForContextLossHandling):
(WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
(WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
(WebCore::WebGLRenderingContextBase::markContextChanged):
(WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver):
(WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
(WebCore::WebGLRenderingContextBase::reshape):
(WebCore::WebGLRenderingContextBase::compileShader):
(WebCore::WebGLRenderingContextBase::isContextLostOrPending):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::printToConsole):
(WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
(WebCore::WebGLRenderingContextBase::clampedCanvasSize):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::create):
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
(WebCore::WebGPURenderingContext::canvas const):
(WebCore::WebGPURenderingContext::clampedCanvasSize const):
* html/canvas/WebGPURenderingContext.h:
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::recordCanvasAction):
(WebCore::InspectorInstrumentation::didEnableExtension):
(WebCore::InspectorInstrumentation::didCreateProgram):
(WebCore::InspectorInstrumentation::willDeleteProgram):
(WebCore::InspectorInstrumentation::isShaderProgramDisabled):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::recordCanvasAction):
(WebCore::InspectorCanvasAgent::didEnableExtension):
(WebCore::InspectorCanvasAgent::didCreateProgram):

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

22 months agoSource/WebCore:
commit-queue@webkit.org [Thu, 16 Nov 2017 19:13:42 +0000 (19:13 +0000)]
Source/WebCore:
Added mime type check to the picture source preloader to avoid downloading incompatible resources.
https://bugs.webkit.org/show_bug.cgi?id=179231

Patch by Colin Bendell <colin@bendell.ca> on 2017-11-16
Reviewed by Alex Christensen.

Test: http/tests/loading/preload-picture-type.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching

LayoutTests:
Add tests to ensure that <source> tags are only preloaded when the `type`
attribute matches.
https://bugs.webkit.org/show_bug.cgi?id=179231

Patch by Colin Bendell <colin@bendell.ca> on 2017-11-16
Reviewed by Alex Christensen.

* http/tests/preload/picture-type-expected.txt: Added.
* http/tests/preload/picture-type.html: Added.

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

22 months agoIt should be easier to reify lazy property names
jfbastien@apple.com [Thu, 16 Nov 2017 19:08:37 +0000 (19:08 +0000)]
It should be easier to reify lazy property names
https://bugs.webkit.org/show_bug.cgi?id=179734
<rdar://problem/35492521>

Reviewed by Keith Miller.

We reify lazy property names in a few different ways, each
specific to the JSCell implementation, in put() instead of having
a special function to do reification. Let's make that simpler.

This patch makes it easier to reify property names in a uniform
manner, and does so in JSFunction. As a follow up I'll use the
same mechanics for:

ClonedArguments   callee, iteratorSymbol (Symbol.iterator)
ErrorConstructor  stackTraceLimit
ErrorInstance     line, column, sourceURL, stack
GenericArguments  length, callee, iteratorSymbol (Symbol.iterator)
GetterSetter      RELEASE_ASSERT_NOT_REACHED()
JSArray           length
RegExpObject      lastIndex
StringObject      length

* runtime/ClassInfo.h: Add reifyPropertyNameIfNeeded to method table.
* runtime/JSCell.cpp:
(JSC::JSCell::reifyPropertyNameIfNeeded): by default, don't reify.
* runtime/JSCell.h:
* runtime/JSFunction.cpp: `name` and `length` can be reified.
(JSC::JSFunction::reifyPropertyNameIfNeeded):
(JSC::JSFunction::put):
(JSC::JSFunction::reifyLength):
(JSC::JSFunction::reifyName):
(JSC::JSFunction::reifyLazyPropertyIfNeeded):
(JSC::JSFunction::reifyLazyPropertyForHostOrBuiltinIfNeeded):
(JSC::JSFunction::reifyLazyLengthIfNeeded):
(JSC::JSFunction::reifyLazyNameIfNeeded):
(JSC::JSFunction::reifyLazyBoundNameIfNeeded):
* runtime/JSFunction.h:
(JSC::JSFunction::isLazy):
(JSC::JSFunction::isReified):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal): do the reification here.

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

22 months ago[WPE] Expose ENABLE_JIT and USE_SYSTEM_MALLOC options
mcatanzaro@igalia.com [Thu, 16 Nov 2017 19:07:35 +0000 (19:07 +0000)]
[WPE] Expose ENABLE_JIT and USE_SYSTEM_MALLOC options
https://bugs.webkit.org/show_bug.cgi?id=179730

Reviewed by Carlos Alberto Lopez Perez.

* Source/cmake/OptionsWPE.cmake:

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

22 months agoWhitelist additional IOKit properties based on customer feedback
bfulgham@apple.com [Thu, 16 Nov 2017 18:47:50 +0000 (18:47 +0000)]
Whitelist additional IOKit properties based on customer feedback
https://bugs.webkit.org/show_bug.cgi?id=179782
<rdar://problem/35508246>

Reviewed by Dean Jackson.

Expand the IOKit property whitelist to recognize a few more properties as valid based on review of logs
from customer systems and our test infrastructure.

* WebProcess/com.apple.WebProcess.sb.in:

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

22 months agoDispatching an event on a ServiceWorker may fail or crash due to GC
cdumez@apple.com [Thu, 16 Nov 2017 18:21:44 +0000 (18:21 +0000)]
Dispatching an event on a ServiceWorker may fail or crash due to GC
https://bugs.webkit.org/show_bug.cgi?id=179745

Reviewed by Geoffrey Garen.

Source/WebCore:

Dispatching an event on a ServiceWorker may fail or crash due to GC. We need to make sure
that a ServiceWorker's wrapper stays alive as long as we may dispatch events on it.

Keep the wrapper alive by making ServiceWorker an ActiveDOMObject and making sure the
implementation object keeps a PendingActivity alive while it may dispatch JS events.
The only event dispatched on ServiceWorker objects is the "statechange" one. We may
dispatch statechange events on a ServiceWorker until its state becomes "redundant".
We therefore take a PendingActivity when the ServiceWorker's state is or becomes
non-redundant (becoming non redundant can only happen when switching initially from
redundant to installing, at which point the ServiceWorker object is not exposed to
the JS yet). We release the PendingActivity when the ServiceWorker's state becomes
redundant or the ActiveDOMObject is stopped (to avoid leaks on navigation).

Test: http/tests/workers/service/service-worker-gc-event.html

* workers/service/ServiceWorker.cpp:
(WebCore::mutableAllWorkers):
(WebCore::ServiceWorker::removeFromAllWorkers):
(WebCore::ServiceWorker::getOrCreate):
(WebCore::ServiceWorker::ServiceWorker):
(WebCore::ServiceWorker::~ServiceWorker):
(WebCore::ServiceWorker::scheduleTaskToUpdateState):
(WebCore::ServiceWorker::activeDOMObjectName const):
(WebCore::ServiceWorker::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorker::stop):
(WebCore::ServiceWorker::updatePendingActivityForEventDispatch):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorker.idl:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/resources/sw-test-pre.js:
* http/tests/workers/service/service-worker-gc-event.html: Added.
* http/tests/workers/service/service-worker-gc-event-expected.txt: Added.

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

22 months agoUnreviewed, rebaseline skipped and flaky service workers tests.
cdumez@apple.com [Thu, 16 Nov 2017 18:05:29 +0000 (18:05 +0000)]
Unreviewed, rebaseline skipped and flaky service workers tests.

* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt:
* web-platform-tests/service-workers/service-worker/respond-with-body-accessed-response.https-expected.txt:
* web-platform-tests/service-workers/service-worker/uncontrolled-page.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt:
* web-platform-tests/service-workers/service-worker/update-bytecheck.https-expected.txt:
* web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt:

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

22 months agoLayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors...
commit-queue@webkit.org [Thu, 16 Nov 2017 17:37:22 +0000 (17:37 +0000)]
LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=179771

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-16

* TestExpectations: Marking test as flaky until we have full support of SW opaque responses.

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

22 months agoLayoutTests/imported/w3c:
Ms2ger@igalia.com [Thu, 16 Nov 2017 17:30:03 +0000 (17:30 +0000)]
LayoutTests/imported/w3c:
Import 2dcontext/the-canvas-state/ from wpt.
https://bugs.webkit.org/show_bug.cgi?id=179769

Reviewed by Youenn Fablet.

Also remove the outdated and unmaintained copies of those tests.

The only substantive changes are changes from _assertEqual to _assertSame;
that is, from comparing with == to comparing with ===. (I made this
change upstream in 2014.)

* resources/import-expectations.json:
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.bitmap-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.bitmap-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.bitmap.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.bitmap.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.clip-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.clip-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.clip.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.clip.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.fillStyle-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.fillStyle-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.fillStyle.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.fillStyle.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.font-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.font-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.font.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.font.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.globalAlpha-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.globalAlpha-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.globalAlpha.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.globalAlpha.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.globalCompositeOperation-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.globalCompositeOperation-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.globalCompositeOperation.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.globalCompositeOperation.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.imageSmoothingEnabled-expected.txt: Added.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.imageSmoothingEnabled.html: Added.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.lineCap-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.lineCap-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.lineCap.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.lineCap.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.lineJoin-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.lineJoin-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.lineJoin.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.lineJoin.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.lineWidth-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.lineWidth-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.lineWidth.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.lineWidth.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.miterLimit-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.miterLimit-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.miterLimit.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.miterLimit.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.path-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.path-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.path.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.path.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.shadowBlur-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.shadowBlur-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.shadowBlur.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.shadowBlur.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.shadowColor-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.shadowColor-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.shadowColor.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.shadowColor.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.shadowOffsetX-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.shadowOffsetX-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.shadowOffsetX.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.shadowOffsetX.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.shadowOffsetY-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.shadowOffsetY-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.shadowOffsetY.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.shadowOffsetY.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.stack-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.stack-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.stack.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.stack.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.stackdepth-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.stackdepth-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.stackdepth.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.stackdepth.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.strokeStyle-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.strokeStyle-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.strokeStyle.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.strokeStyle.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.textAlign-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.textAlign-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.textAlign.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.textAlign.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.textBaseline-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.textBaseline-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.textBaseline.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.textBaseline.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.transformation-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.transformation-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.transformation.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.transformation.html.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.underflow-expected.txt: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.underflow-expected.txt.
* web-platform-tests/2dcontext/the-canvas-state/2d.state.saverestore.underflow.html: Renamed from LayoutTests/imported/w3c/canvas/2d.state.saverestore.underflow.html.
* web-platform-tests/2dcontext/the-canvas-state/canvas_state_restore_001-expected.htm: Added.
* web-platform-tests/2dcontext/the-canvas-state/canvas_state_restore_001.htm: Added.
* web-platform-tests/2dcontext/the-canvas-state/w3c-import.log: Added.

LayoutTests:
Remove the outdated and unmaintained copies of the tests in wpt/2dcontext/the-canvas-state/.
https://bugs.webkit.org/show_bug.cgi?id=179769

Reviewed by Youenn Fablet.

* canvas/philip/tests/2d.state.saverestore.bitmap-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.bitmap.html: Removed.
* canvas/philip/tests/2d.state.saverestore.clip-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.clip.html: Removed.
* canvas/philip/tests/2d.state.saverestore.fillStyle-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.fillStyle.html: Removed.
* canvas/philip/tests/2d.state.saverestore.font-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.font.html: Removed.
* canvas/philip/tests/2d.state.saverestore.globalAlpha-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.globalAlpha.html: Removed.
* canvas/philip/tests/2d.state.saverestore.globalCompositeOperation-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.globalCompositeOperation.html: Removed.
* canvas/philip/tests/2d.state.saverestore.lineCap-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.lineCap.html: Removed.
* canvas/philip/tests/2d.state.saverestore.lineJoin-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.lineJoin.html: Removed.
* canvas/philip/tests/2d.state.saverestore.lineWidth-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.lineWidth.html: Removed.
* canvas/philip/tests/2d.state.saverestore.miterLimit-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.miterLimit.html: Removed.
* canvas/philip/tests/2d.state.saverestore.path-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.path.html: Removed.
* canvas/philip/tests/2d.state.saverestore.shadowBlur-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.shadowBlur.html: Removed.
* canvas/philip/tests/2d.state.saverestore.shadowColor-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.shadowColor.html: Removed.
* canvas/philip/tests/2d.state.saverestore.shadowOffsetX-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.shadowOffsetX.html: Removed.
* canvas/philip/tests/2d.state.saverestore.shadowOffsetY-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.shadowOffsetY.html: Removed.
* canvas/philip/tests/2d.state.saverestore.stack-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.stack.html: Removed.
* canvas/philip/tests/2d.state.saverestore.stackdepth-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.stackdepth.html: Removed.
* canvas/philip/tests/2d.state.saverestore.strokeStyle-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.strokeStyle.html: Removed.
* canvas/philip/tests/2d.state.saverestore.textAlign-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.textAlign.html: Removed.
* canvas/philip/tests/2d.state.saverestore.textBaseline-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.textBaseline.html: Removed.
* canvas/philip/tests/2d.state.saverestore.transformation-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.transformation.html: Removed.
* canvas/philip/tests/2d.state.saverestore.underflow-expected.txt: Removed.
* canvas/philip/tests/2d.state.saverestore.underflow.html: Removed.

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

22 months agoWin EWS bots should reboot after N webkit-patch iterations.
pvollan@apple.com [Thu, 16 Nov 2017 15:52:28 +0000 (15:52 +0000)]
Win EWS bots should reboot after N webkit-patch iterations.
https://bugs.webkit.org/show_bug.cgi?id=177970

Reviewed by Brent Fulgham.

* EWSTools/start-queue-win.sh:

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

22 months agoMark http/wpt/offscreen-canvas/getContext-webgl.html as failing on Windows.
pvollan@apple.com [Thu, 16 Nov 2017 15:49:22 +0000 (15:49 +0000)]
Mark http/wpt/offscreen-canvas/getContext-webgl.html as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179767

Unreviewed test gardening.

* platform/win/TestExpectations:

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

22 months agoProvide a runtime option for disabling the optimization of recursive tail calls
rmorisset@apple.com [Thu, 16 Nov 2017 15:48:11 +0000 (15:48 +0000)]
Provide a runtime option for disabling the optimization of recursive tail calls
https://bugs.webkit.org/show_bug.cgi?id=179765

Reviewed by Mark Lam.

* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEnter):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
* runtime/Options.h:

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

22 months agoMark accessibility/accessibility-object-model.html as failing on Windows.
pvollan@apple.com [Thu, 16 Nov 2017 15:41:00 +0000 (15:41 +0000)]
Mark accessibility/accessibility-object-model.html as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179766

Unreviewed test gardening.

* platform/win/TestExpectations:

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

22 months agoFix null pointer dereference in bytecodeDumper
rmorisset@apple.com [Thu, 16 Nov 2017 15:08:10 +0000 (15:08 +0000)]
Fix null pointer dereference in bytecodeDumper
https://bugs.webkit.org/show_bug.cgi?id=179764

Reviewed by Mark Lam.

The problem was just a call to lastSeenCallee() that was unguarded by haveLastSeenCallee().

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::printCallOp):

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

22 months agoREGRESSION (r224592): oss-fuzz: jsc: Null-dereference READ in JSC::JSCell::isObject...
rmorisset@apple.com [Thu, 16 Nov 2017 15:04:37 +0000 (15:04 +0000)]
REGRESSION (r224592): oss-fuzz: jsc: Null-dereference READ in JSC::JSCell::isObject (4216)
https://bugs.webkit.org/show_bug.cgi?id=179763
<rdar://problem/35550513>

Reviewed by Keith Miller.

JSTests:

Just adding a slightly cleaned-up version of the original fuzzer-found test.

* stress/tdz-this-in-try-catch.js: Added.
(__v_6388):
(__v_6392):

Source/JavaScriptCore:

Fix null pointer dereference caused by an eliminated tdz_check

The problem was when doing an OSR entry in DFG while |this| was null
(because super() had not yet been called in the constructor of this
subclass), it would be marked as non-null, and the tdz_check eliminated.

* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::initialize):

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

22 months agoConsider non-main frames for frameViewRootLayerDidChange
fred.wang@free.fr [Thu, 16 Nov 2017 13:49:02 +0000 (13:49 +0000)]
Consider non-main frames for frameViewRootLayerDidChange
https://bugs.webkit.org/show_bug.cgi?id=178508

Patch by Frederic Wang <fwang@igalia.com> on 2017-11-16
Reviewed by Antonio Gomes.

No new tests, behavior unchanged.

AsyncScrollingCoordinator::frameViewRootLayerDidChange assumes that frameView is always a
main-frame. It calls ensureRootStateNodeForFrameView, which always attaches a frame node with
null parent ID. It also has an ASSERT to check m_scrollingStateTree->rootStateNode(), instead
of m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()). This patch makes the
ASSERT more generic. It also adds an early return into ensureRootStateNodeForFrameView when the
node already exists so that the call to attachToStateTree can be skipped. It turns out that that
call is actually only necessary for main frame, so another ASSERT is added to verify it.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange): Modify the ASSERT to
verify the availability of a scrolling node for the frame, not just the root node.
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): Add an early return to
skip the call to attachToStateTree when the node is actually already available. Add an ASSERT to
ensure that attaching a new node is only necessary for main frames.

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

22 months ago[WPE] Add initial support for WebDriver
carlosgc@webkit.org [Thu, 16 Nov 2017 12:48:22 +0000 (12:48 +0000)]
[WPE] Add initial support for WebDriver
https://bugs.webkit.org/show_bug.cgi?id=179727

Reviewed by Michael Catanzaro.

.:

Enable WebDriver by default in WPE.

* Source/cmake/OptionsWPE.cmake:

Source/WebDriver:

Add WPE implementation for platform-specific methods. Move the version handling to a common file
WebDriverServiceGLib.cpp.

* Capabilities.h:
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* glib/WebDriverServiceGLib.cpp: Added.
(WebDriver::parseVersion):
(WebDriver::WebDriverService::platformCompareBrowserVersions):
* gtk/WebDriverServiceGtk.cpp:
* wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp.
(WebDriver::WebDriverService::platformCapabilities):
(WebDriver::WebDriverService::platformValidateCapability const):
(WebDriver::WebDriverService::platformMatchCapability const):
(WebDriver::WebDriverService::platformParseCapabilities const):

Tools:

Make it possible to run WebDriver tests with WPE.

* Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe.
* Scripts/webkitpy/port/wpe.py:
(WPEPort.__init__): Initialize _display_server from options.
(WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option.
* Scripts/webkitpy/webdriver_tests/webdriver_driver.py:
(WebDriver.browser_env): Add virtual method to get the environment that should be used.
* Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py.
(WebDriverWPE):
(WebDriverWPE.__init__):
(WebDriverWPE.binary_path):
(WebDriverWPE.browser_name):
(WebDriverWPE.capabilities):
(WebDriverWPE.browser_env):
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver.
* wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation.

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

22 months ago[TexMap] Remove use of GraphicsContext3D
magomez@igalia.com [Thu, 16 Nov 2017 12:22:47 +0000 (12:22 +0000)]
[TexMap] Remove use of GraphicsContext3D
https://bugs.webkit.org/show_bug.cgi?id=174860

Reviewed by Žan Doberšek.

Remove remaining uses of GC3D that are not WebGL related:
- Remove the option to create a GC3D to render to the curren OpenGL context.
- Remove the remaining usage of GC3D inside MediaPlayerPrivateGStreamerBase.
- Replace the usage inside TextureMapper with direct OpenGL calls, and use a
VAO when the OpenGL version is higher than 3.2.

This also modifies TextureMapperContextAttributes so all the tested features are
supported when using OpenGL, and we only check for the extensions when using GLES2.

No new tests as there's no behavior change.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
* platform/graphics/GraphicsContext3DPrivate.h:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::initialize):
* platform/graphics/texmap/TextureMapperContextAttributes.h:
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
(WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
(WebCore::TextureMapperGC3DPlatformLayer::makeContextCurrent):
(WebCore::TextureMapperGC3DPlatformLayer::platformContext):
(WebCore::TextureMapperGC3DPlatformLayer::swapBuffersIfNeeded):
(WebCore::TextureMapperGC3DPlatformLayer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
(WebCore::TextureMapperGLData::TextureMapperGLData):
(WebCore::TextureMapperGLData::~TextureMapperGLData):
(WebCore::TextureMapperGLData::initializeStencil):
(WebCore::TextureMapperGLData::getStaticVBO):
(WebCore::TextureMapperGLData::getVAO):
(WebCore::TextureMapperGLData::getShaderProgram):
(WebCore::TextureMapperGL::TextureMapperGL):
(WebCore::TextureMapperGL::beginPainting):
(WebCore::TextureMapperGL::endPainting):
(WebCore::TextureMapperGL::drawBorder):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::TextureMapperGL::drawSolidColor):
(WebCore::TextureMapperGL::clearColor):
(WebCore::TextureMapperGL::drawEdgeTriangles):
(WebCore::TextureMapperGL::drawUnitRect):
(WebCore::TextureMapperGL::draw):
(WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
(WebCore::TextureMapperGL::drawFiltered):
(WebCore::TextureMapperGL::bindDefaultSurface):
(WebCore::TextureMapperGL::beginClip):
(WebCore::TextureMapperGL::createTexture):
* platform/graphics/texmap/TextureMapperGL.h:

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

22 months agoUnreviewed GTK+ and WPE gardening after r224910.
magomez@igalia.com [Thu, 16 Nov 2017 11:20:41 +0000 (11:20 +0000)]
Unreviewed GTK+ and WPE gardening after r224910.

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

22 months agoASSERTION FAILED: !isAnonymous() in WebCore::RenderMathMLOperator::updateTokenContent
fred.wang@free.fr [Thu, 16 Nov 2017 08:14:33 +0000 (08:14 +0000)]
ASSERTION FAILED: !isAnonymous() in WebCore::RenderMathMLOperator::updateTokenContent
https://bugs.webkit.org/show_bug.cgi?id=166011

Patch by Frederic Wang <fwang@igalia.com> on 2017-11-16
Reviewed by Alejandro G. Castro.

Source/WebCore:

RenderMathMLFencedOperator does not support mathvariant or displaystyle transforms. This is
one of several issues of the mfenced element (see bug 160509). However,
MathMLStyle::updateStyleIfNeeded() still tries to use the implementation of the parent
RenderMathMLOperator class, which only works for non-anonymous operators. This patch skips
the updateTokenContent() calls for anonymous mfenced operators in order to avoid ASSERTION
failures.

Test: mathml/mfenced-displaystyle-and-mathvariant-crash.html

* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::updateStyleIfNeeded): Skip anonymous token elements.

LayoutTests:

Add a crash test checking displaystyle and mathvariant on mfenced operators.

* mathml/mfenced-displaystyle-and-mathvariant-crash-expected.txt: Added.
* mathml/mfenced-displaystyle-and-mathvariant-crash.html: Added.

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

22 months agoImplement basics of "Terminate Service Worker" algorithm.
beidson@apple.com [Thu, 16 Nov 2017 03:05:02 +0000 (03:05 +0000)]
Implement basics of "Terminate Service Worker" algorithm.
https://bugs.webkit.org/show_bug.cgi?id=179551

Reviewed by Chris Dumez.

Source/WebCore:

No new tests (No observable behavior change yet).

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::stopIndexedDatabase):

* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::workerThreadCreated):
(WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):

* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
(WebCore::WorkerThread::stop):
* workers/WorkerThread.h:

* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::terminateWorker):
* workers/service/context/SWContextManager.h:

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::workerContextTerminated):
(WebCore::SWServer::terminateWorker):
* workers/service/server/SWServer.h:

* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::workerTerminated):
* workers/service/server/SWServerToContextConnection.h:

* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::terminate):
(WebCore::SWServerWorker::contextTerminated):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::terminateWorker):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::terminateWorker):
(WebKit::WebSWContextManagerConnection::workerTerminated):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

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

22 months agoRemove access to 'com.apple.mediaaccessibility.public' preferences in WebContent...
bfulgham@apple.com [Thu, 16 Nov 2017 01:17:02 +0000 (01:17 +0000)]
Remove access to 'com.apple.mediaaccessibility.public' preferences in WebContent sandbox
https://bugs.webkit.org/show_bug.cgi?id=179747
<rdar://problem/35367346>

Reviewed by Dean Jackson.

The 'mediaaccessibilityd' process handles access to MediaAccessibility preferences. We don't need
to grant the WebContent Process sandbox access to them.

* WebProcess/com.apple.WebProcess.sb.in:

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

22 months agoFix fast/events/message-port-postMessage-recursive.html after r224896
achristensen@apple.com [Thu, 16 Nov 2017 00:36:30 +0000 (00:36 +0000)]
Fix fast/events/message-port-postMessage-recursive.html after r224896
https://bugs.webkit.org/show_bug.cgi?id=179749

Reviewed by Jer Noble.

* wtf/mac/MainThreadMac.mm:
(WTF::currentRunLoopInCommonMode):
We sometimes run the runloop in kCFRunLoopDefaultMode, which should also have the responsiveness optimization.
This allows the runloop to continue to iterate when we are doing lots of things on the main thread.
CFRunLoop.h has a special definition of these two constants.

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

22 months agoWeb Inspector: Styles Redesign: typing colon in property name should advance to value...
nvasilyev@apple.com [Thu, 16 Nov 2017 00:31:00 +0000 (00:31 +0000)]
Web Inspector: Styles Redesign: typing colon in property name should advance to value field
https://bugs.webkit.org/show_bug.cgi?id=178795
<rdar://problem/35174674>

Reviewed by Devin Rousso.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._update):
(WI.SpreadsheetStyleProperty.prototype._handleNameBeforeInput):
Unlike pressing Tab or Enter, typing ":" in the property name should discard suggestion hint.

(WI.SpreadsheetStyleProperty.prototype._valueCompletionDataProvider):
We use 250ms debounce before updating this._property.name.
When typing "font-f:", we want to discard suggestion hint (i.e. "font-family"),
and immediately show autocomplete for "font-f" (in this case, invalid property).

* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField):
(WI.SpreadsheetTextField.prototype.stopEditing):
(WI.SpreadsheetTextField.prototype.discardCompletion):
Call spreadsheetTextFieldDidChange when discarding non-empty suggestion hint.

(WI.SpreadsheetTextField.prototype.detached):
(WI.SpreadsheetTextField.prototype.completionSuggestionsClickedCompletion):
(WI.SpreadsheetTextField.prototype._handleBlur):
(WI.SpreadsheetTextField.prototype._handleKeyDownForSuggestionView):
(WI.SpreadsheetTextField.prototype._updateCompletions):
(WI.SpreadsheetTextField.prototype._applyCompletionHint):
(WI.SpreadsheetTextField.prototype._hideCompletions): Deleted.

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

22 months agoWeb Inspector: REGRESSION (r217750): Navigation sidebar broken after closing and...
mattbaker@apple.com [Wed, 15 Nov 2017 23:39:54 +0000 (23:39 +0000)]
Web Inspector: REGRESSION (r217750): Navigation sidebar broken after closing and re-opening tab
https://bugs.webkit.org/show_bug.cgi?id=179717
<rdar://problem/35551541>

Reviewed by Devin Rousso.

NavigationSidebarPanels should not be created with WI.instanceForClass.

* UserInterface/Views/DebuggerSidebarPanel.js:
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel):
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel):
* UserInterface/Views/StorageSidebarPanel.js:
(WI.StorageSidebarPanel):
* UserInterface/Views/TabContentView.js:
(WI.TabContentView.prototype.get navigationSidebarPanel):

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

22 months agoLog media readyState and networkState as strings
eric.carlson@apple.com [Wed, 15 Nov 2017 23:25:34 +0000 (23:25 +0000)]
Log media readyState and networkState as strings
https://bugs.webkit.org/show_bug.cgi?id=179732

Reviewed by Youenn Fablet.

* html/HTMLMediaElement.cpp:
(WebCore::convertEnumerationToString):
(WebCore::HTMLMediaElement::scheduleDelayedAction): Fix logic error.
(WebCore::HTMLMediaElement::pendingActionTimerFired): Fix incorrect log string.
(WebCore::HTMLMediaElement::setNetworkState): Don't cast to int for logging.
(WebCore::HTMLMediaElement::setReadyState): Ditto. Log when autoplay is blocked.

* html/HTMLMediaElementEnums.h:
(PAL::LogArgument<WebCore::HTMLMediaElementEnums::ReadyState>::toString): New.
(PAL::LogArgument<WebCore::HTMLMediaElementEnums::NetworkState>::toString): New.

* platform/graphics/MediaPlayer.cpp:
(WebCore::convertEnumerationToString):
* platform/graphics/MediaPlayerEnums.h:
(PAL::LogArgument<WebCore::MediaPlayerEnums::ReadyState>::toString):
(PAL::LogArgument<WebCore::MediaPlayerEnums::NetworkState>::toString):

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::updateStates): Log strings.

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

22 months agoService Worker fetch should handle empty responses
commit-queue@webkit.org [Wed, 15 Nov 2017 23:05:41 +0000 (23:05 +0000)]
Service Worker fetch should handle empty responses
https://bugs.webkit.org/show_bug.cgi?id=179740

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-15
Reviewed by Alex Christensen.

Source/WebCore:

Covered by updated test.

* Modules/streams/ReadableStreamSink.cpp:
(WebCore::ReadableStreamToSharedBufferSink::enqueue): Not create a buffer until actually needed.
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse): Check for null buffers.

LayoutTests:

* http/tests/workers/service/resources/service-worker-fetch-worker.js:
(event.event.request.url.endsWith):
* http/tests/workers/service/resources/service-worker-fetch.js:
(async.test):
* http/tests/workers/service/service-worker-fetch.https-expected.txt:

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

22 months agoReloadFromOrigin loads should not select any service worker
commit-queue@webkit.org [Wed, 15 Nov 2017 22:56:59 +0000 (22:56 +0000)]
ReloadFromOrigin loads should not select any service worker
https://bugs.webkit.org/show_bug.cgi?id=179736

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-15
Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/workers/service/shift-reload-navigation.html

In case of ReloadFromOrigin (equivalent of shift reload), do not select any service worker.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/FrameLoader.h:
(WebCore::FrameLoader::isReloadingFromOrigin const):

LayoutTests:

* http/tests/workers/service/resources/shift-reload-navigation.js: Added.
(async.test):
* http/tests/workers/service/shift-reload-navigation-expected.txt: Added.
* http/tests/workers/service/shift-reload-navigation.html: Added.

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

22 months agoRevert r224885
achristensen@apple.com [Wed, 15 Nov 2017 22:07:10 +0000 (22:07 +0000)]
Revert r224885
https://bugs.webkit.org/show_bug.cgi?id=179719

* UIProcess/API/APIContentRuleListStore.cpp:
(API::compiledToFile):
r224885 was a speculative fix that did not fix anything on the bots.

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

22 months agoAX triggers sync layout while building the render tree on www.macrumors.com.
zalan@apple.com [Wed, 15 Nov 2017 21:50:04 +0000 (21:50 +0000)]
AX triggers sync layout while building the render tree on macrumors.com.
https://bugs.webkit.org/show_bug.cgi?id=179741
rdar://problem/35462531

Reviewed by Antti Koivisto.

It's unsafe to issue layout while mutating the render tree. If a mutation
requires AX to issue a layout, it needs to be issued in a delayed manner (which the render
tree mutation will trigger anyway).

Unable to reproduce.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):

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

22 months ago[Web Animations] Implement basic to-from animations
graouts@webkit.org [Wed, 15 Nov 2017 21:35:38 +0000 (21:35 +0000)]
[Web Animations] Implement basic to-from animations
https://bugs.webkit.org/show_bug.cgi?id=179707
<rdar://problem/34932456>

Source/WebCore:

We can now actually perform an animation, in software only, when provided two keyframes on an AnimationEffect.
To parse a keyframes object from JS, we use the StyleResolver to create RenderStyle objects based on the strings
provided for the property names and values. Then, when the DocumentTimeline indicates that animations are ready
to be updated, we invalidate the style of elements with animations, so that during style resolution we can perform
blending between the RenderStyles for each keyframe.

Reviewed by Dean Jackson.

* animation/AnimationEffect.h:
(WebCore::AnimationEffect::~AnimationEffect): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::elementToAnimationsMap const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animationResolutionTimerFired):
(WebCore::DocumentTimeline::updateAnimations): Renamed from resolveAnimations() since we're not
actually resolving animations, merely invalidating styles in preparation for resolution.
(WebCore::DocumentTimeline::resolveAnimations): Deleted.
* animation/DocumentTimeline.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create): Pass the keyframes argument to setKeyframes() and forward the
exception in case one was raised in the setter.
(WebCore::KeyframeEffect::setKeyframes): Pass the keyframes argument to processKeyframes() and
forward the exception in case one was raised during processing.
(WebCore::KeyframeEffect::processKeyframes): Deal with exactly two keyframes, set at 0 and 1 offsets,
specified in array forms for the keyframes object. As we parse the content of the provided JS object,
we create RenderStyle objects using the element's StyleResolver from a CSS text string we create
based on the property and values as strings.
(WebCore::KeyframeEffect::applyAtLocalTime): Compute the progress based on the local time and duration,
using the existing CSSPropertyAnimation::blendProperties() mechanics to perform the blend between the
from and to keyframes.
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::resolve):
* animation/WebAnimation.h:
* bindings/IDLTypes.h:
(WebCore::IDLObject::nullValue): Make JSC::Strong an optional type.
* dom/Document.h:
(WebCore::Document::existingTimeline const): Provide an explicit method for call sites to check existence
of a timeline before forcing one to be created if missing by calling timeline().
* dom/Element.cpp:
(WebCore::Element::getAnimations): Do not force the creation of a timeline if one isn't already created.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate): When applying styles, account for any Web
Animation applied to the provided element.

LayoutTests:

Reviewed by Dean Jackson.

Update existing tests to explicitly pass null for keyframes and update WPT expectations.

* http/wpt/web-animations/interfaces/AnimationTimeline/document-timeline-expected.txt:
* http/wpt/web-animations/interfaces/KeyframeEffect/constructor-expected.txt:
* http/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001-expected.txt:
* http/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002-expected.txt:
* http/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt:
* http/wpt/wk-web-animations/interfaces/element-get-animations.html:
* http/wpt/wk-web-animations/timing-model/animation-creation-basic.html:
* http/wpt/wk-web-animations/timing-model/animation-effect-unique-relationship.html:
* http/wpt/wk-web-animations/timing-model/animation-interface-effect-property.html:
* http/wpt/wk-web-animations/timing-model/keyframe-effect-expected.txt:
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html:
* http/wpt/wk-web-animations/timing-model/keyframe-effect.html:

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

22 months agoWebViews scheduled in custom run loop modes should be able to do more than 50ms of...
achristensen@apple.com [Wed, 15 Nov 2017 21:28:15 +0000 (21:28 +0000)]
WebViews scheduled in custom run loop modes should be able to do more than 50ms of work at a time
https://bugs.webkit.org/show_bug.cgi?id=179742
<rdar://problem/35519421>

Reviewed by Jer Noble.
Source/WTF:

In r224687 I fixed loading from scheduled WebViews with custom run loop modes, but in
dispatchFunctionsFromMainThread we have an optimization to yield the run loop if we have already
done more than 50ms of work on the main thread in this run loop iteration.  When this happens
and we are running in a custom run loop mode, we disable this responsiveness optimization.
We are calling CFRunLoopRunInMode or [NSRunLoop acceptInputForMode:beforeDate:] in a while loop anyways,
so we would not benefit from a responsiveness optimization.  We definitely don't want to reschedule
on the main thread in the common run loop mode in this case.

* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread):
* wtf/MainThread.h:
* wtf/generic/MainThreadGeneric.cpp:
(WTF::currentRunLoopInCommonMode):
* wtf/mac/MainThreadMac.mm:
(WTF::currentRunLoopInCommonMode):
* wtf/win/MainThreadWin.cpp:
(WTF::currentRunLoopInCommonMode):

Tools:

* TestWebKitAPI/Tests/mac/WebViewScheduleInRunLoop.mm:
(-[ScheduleInRunLoopDelegate webView:didFinishLoadForFrame:]):
(TestWebKitAPI::TEST):
Load more than one scheduled WebView to test work that typically takes more than 50 ms.

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

22 months agoASSERTION FAILED: !renderer->needsLayout() in WebCore::RenderBlock::checkPositionedOb...
fred.wang@free.fr [Wed, 15 Nov 2017 20:07:51 +0000 (20:07 +0000)]
ASSERTION FAILED: !renderer->needsLayout() in WebCore::RenderBlock::checkPositionedObjectsNeedLayout with MathML
https://bugs.webkit.org/show_bug.cgi?id=178865

Patch by Frederic Wang <fwang@igalia.com> on 2017-11-15
Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

MathML token elements can contain HTML elements and hence MathML elements can contain
out-of-flow positioned descendants. Also all MathML elements can be containing block and hence
should position their out-of-flow positioned descendants before calling clearNeedsLayout().
This patch does that in all places in the MathML renderer classes, except a few of them:
- RenderMathMLSpace, which can not have descendants.
- RenderMathMLToken and RenderMathMLOperator, since they will use the layout implementation
  of RenderMathMLBlock when they contain non-text children.
The patch also fixes an ASSERTION failure in WebCore::RenderBlock::checkPositionedObjectsNeedLayout
due to some descendants that are not laid out.

Test: mathml/out-of-flow-in-token-crash.html

* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::layoutBlock): Call layoutPositionedObjects.
(WebCore::RenderMathMLBlock::layoutInvalidMarkup): Ditto and pass the relayoutChildren boolean.
* rendering/mathml/RenderMathMLBlock.h: Add a relayoutChildren boolean to layoutInvalidMarkup.
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::layoutBlock): Pass the relayoutChildren boolean to layoutInvalidMarkup
and call layoutPositionedObjects.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::layoutBlock): Ditto.
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::layoutBlock): Ditto.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::layoutBlock): Ditto.
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::layoutBlock): Call layoutPositionedObjects.
* rendering/mathml/RenderMathMLPadded.cpp:
(WebCore::RenderMathMLPadded::layoutBlock): Ditto.
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::layoutBlock): Ditto.

LayoutTests:

Add a test to trigger various clearNeedsLayout() in a MathML containing block with
out-of-flow positioned descendants.

* mathml/out-of-flow-in-token-crash-expected.txt: Added.
* mathml/out-of-flow-in-token-crash.html: Added.

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

22 months ago[GTK] accessibility/accessibility-object-model.html fails
n_wang@apple.com [Wed, 15 Nov 2017 20:02:04 +0000 (20:02 +0000)]
[GTK] accessibility/accessibility-object-model.html fails
https://bugs.webkit.org/show_bug.cgi?id=179723

Reviewed by Chris Fleizach.

Updated the test to support different platforms.

* accessibility/accessibility-object-model-expected.txt:
* accessibility/accessibility-object-model.html:

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

22 months agoUnreviewed, fix tests introduced in r224880.
cdumez@apple.com [Wed, 15 Nov 2017 19:50:41 +0000 (19:50 +0000)]
Unreviewed, fix tests introduced in r224880.

This is needed because of the changes in r224876.

* http/tests/workers/service/Client-properties.html:

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

22 months agoSome service worker tests are flaky due to console log messages
commit-queue@webkit.org [Wed, 15 Nov 2017 19:40:47 +0000 (19:40 +0000)]
Some service worker tests are flaky due to console log messages
https://bugs.webkit.org/show_bug.cgi?id=179601

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-15
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https-expected.txt:

LayoutTests:

* TestExpectations:

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

22 months agoUnreviewed build fix after r224830.
bfulgham@apple.com [Wed, 15 Nov 2017 19:36:17 +0000 (19:36 +0000)]
Unreviewed build fix after r224830.

* WebProcess/com.apple.WebProcess.sb.in: Add missing sysctl-read permissions needed
to support testing on Mac Mini hardware.

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

22 months agoAdd ServiceWorker to WebProcess plumbery for FormData fetch responses
commit-queue@webkit.org [Wed, 15 Nov 2017 19:28:03 +0000 (19:28 +0000)]
Add ServiceWorker to WebProcess plumbery for FormData fetch responses
https://bugs.webkit.org/show_bug.cgi?id=179694

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-15
Reviewed by Alex Christensen.

Source/WebCore:

No observable changes since we are not actually loading FormData right now.

* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
* workers/service/context/ServiceWorkerFetch.h:

Source/WebKit:

Added plumbery from Service Worker up to Web Process to pass form data response bodies.
A follow-up patch should read the data from Network Process and send it to the ResourceLoader.

* Platform/IPC/FormDataReference.h: Added.
(IPC::FormDataReference::FormDataReference):
(IPC::FormDataReference::takeData):
(IPC::FormDataReference::encode const):
(IPC::FormDataReference::decode):
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::didReceiveFetchFormData):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didReceiveFetchFormData):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveFormData):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

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

22 months agoUnreviewed, sort async iteration feature.
keith_miller@apple.com [Wed, 15 Nov 2017 19:22:44 +0000 (19:22 +0000)]
Unreviewed, sort async iteration feature.

* Source/cmake/WebKitFeatures.cmake:

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

22 months agoAdd a compile-time-checked string literal initializer for FourCC.
jer.noble@apple.com [Wed, 15 Nov 2017 19:06:53 +0000 (19:06 +0000)]
Add a compile-time-checked string literal initializer for FourCC.
https://bugs.webkit.org/show_bug.cgi?id=179706

Reviewed by Alex Christensen.

Add a contexpr constructor for FourCC that takes a string literal and static_asserts that it
is exactly 4 chars long. Use this string literal constructor everywhere instead of multi-
character literals.

* platform/graphics/FourCC.h:
(WebCore::FourCC::FourCC):
* platform/graphics/iso/ISOBox.cpp:
(WebCore::ISOBox::parse):
* platform/graphics/iso/ISOOriginalFormatBox.h:
(WebCore::ISOOriginalFormatBox::boxTypeName):
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
(WebCore::ISOProtectionSchemeInfoBox::boxTypeName):
* platform/graphics/iso/ISOSchemeInformationBox.h:
(WebCore::ISOSchemeInformationBox::boxTypeName):
* platform/graphics/iso/ISOSchemeTypeBox.h:
(WebCore::ISOSchemeTypeBox::boxTypeName):
* platform/graphics/iso/ISOTrackEncryptionBox.h:
(WebCore::ISOTrackEncryptionBox::boxTypeName):
* platform/graphics/iso/ISOVTTCue.h:
(WebCore::ISOWebVTTCue::boxTypeName):

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