Clear Node renderer pointer when destroying RenderObject
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-11-02  Antti Koivisto  <antti@apple.com>
2
3         Clear Node renderer pointer when destroying RenderObject
4         https://bugs.webkit.org/show_bug.cgi?id=179112
5
6         Reviewed by Zalan Bujtas.
7
8         Make sure we don't leave renderer pointers behind in Nodes.
9         This could be done with WeakPtr but that would add extra indirection between DOM and render tree.
10
11         * rendering/RenderObject.cpp:
12         (WebCore::RenderObject::willBeDestroyed):
13
14             Null the node renderer pointer.
15             With continuations we have a case where renderer points to a node that has a different renderer.
16             This is is ok as we know no node points to a continuation (they should really be anonymous renderers).
17
18 2017-11-02  Antti Koivisto  <antti@apple.com>
19
20         Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
21         https://bugs.webkit.org/show_bug.cgi?id=179014
22
23         Remove overly optimistic non-critical assertion that is hit on WK1 debug.
24
25         * rendering/RenderBoxModelObject.cpp:
26         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
27
28 2017-11-02  Frederic Wang  <fwang@igalia.com>
29
30         Add references to bug 179167 in FIXME comments
31         https://bugs.webkit.org/show_bug.cgi?id=179168
32
33         Reviewed by Daniel Bates.
34
35         * Configurations/FeatureDefines.xcconfig:
36
37 2017-11-02  Antti Koivisto  <antti@apple.com>
38
39         Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
40         https://bugs.webkit.org/show_bug.cgi?id=179014
41
42         Reviewed by Geoff Garen.
43
44         Treat continuation similarly to other anonymous wrappers. This makes things more understandable
45         and allows removal of some questionable code in RenderBlock::takeChild.
46
47         The patch also makes continuation chain a double linked so we can efficiently remove single
48         continuations from the chain. It also gets rid of algorithms that recurse in continuation chain.
49
50         * accessibility/AccessibilityRenderObject.cpp:
51         (WebCore::firstChildInContinuation):
52         * rendering/RenderBlock.cpp:
53         (WebCore::RenderBlock::styleDidChange):
54
55             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
56             the chain only in the (non-continuation) head renderer.
57
58         (WebCore::RenderBlock::dropAnonymousBoxChild):
59
60             Make a member function.
61
62         (WebCore::RenderBlock::takeChild):
63
64             Remove code that destroyed empty continuations and caused the parent to destroy itself.
65             Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers.
66
67         * rendering/RenderBlock.h:
68         * rendering/RenderBoxModelObject.cpp:
69         (WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode):
70         (WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode):
71         (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):
72
73             Track continuations with double linked lists.
74
75         (WebCore::continuationChainNodeMap):
76         (WebCore::RenderBoxModelObject::willBeDestroyed):
77
78             Don't recurse to destroy continuation chain. 
79             Destroy all continuations iteratively if this is the head of the chain.
80             When destroying a continuation renderer simply remove it from the chain.
81
82         (WebCore::RenderBoxModelObject::continuation const):
83         (WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter):
84         (WebCore::RenderBoxModelObject::removeFromContinuationChain):
85         (WebCore::RenderBoxModelObject::ensureContinuationChainNode):
86         (WebCore::continuationMap): Deleted.
87         (WebCore::RenderBoxModelObject::setContinuation): Deleted.
88         * rendering/RenderBoxModelObject.h:
89         * rendering/RenderElement.cpp:
90         (WebCore::RenderElement::RenderElement):
91         (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):
92
93             Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and
94             then using it.
95             Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain).
96
97         (WebCore::RenderElement::styleDidChange):
98
99             removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.
100
101         (WebCore::RenderElement::updateOutlineAutoAncestor):
102         * rendering/RenderElement.h:
103         (WebCore::RenderElement::hasContinuationChainNode const):
104         (WebCore::RenderElement::setHasContinuationChainNode):
105         (WebCore::RenderElement::hasContinuation const): Deleted.
106         (WebCore::RenderElement::setHasContinuation): Deleted.
107         * rendering/RenderInline.cpp:
108         (WebCore::RenderInline::styleDidChange):
109
110             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
111             the chain only in the (non-continuation) head renderer.
112
113         (WebCore::RenderInline::addChildIgnoringContinuation):
114
115             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
116
117         (WebCore::RenderInline::splitInlines):
118         (WebCore::RenderInline::addChildToContinuation):
119         (WebCore::RenderInline::childBecameNonInline):
120
121             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
122
123         * rendering/RenderInline.h:
124         * rendering/RenderObject.cpp:
125         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
126         (WebCore::RenderObject::outputRenderObject const):
127         (WebCore::findDestroyRootIncludingAnonymous):
128
129             Allow anonymous continuations as destroy roots.
130
131         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
132
133             Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
134             Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.
135             If takeChild/removeAnonymousWrappersForInlinesIfNecessary leaves us with empty anonymous parent destroy that too.
136
137         * rendering/RenderRubyRun.cpp:
138         (WebCore::RenderRubyRun::takeChild):
139
140             Similar to RenderBlock::takeChild, remove the code that would make the renderer destroy itself.
141             Cleaning up RenderRubyRuns is now handled by removeFromParentAndDestroyCleaningUpAnonymousWrappers.
142
143 2017-11-02  Ryosuke Niwa  <rniwa@webkit.org>
144
145         REGRESSION(r224053): Crash in WebCore::Node::moveTreeToNewScope
146         https://bugs.webkit.org/show_bug.cgi?id=179158
147
148         Reviewed by Antti Koivisto.
149
150         Call decrementReferencingNodeCount after checking the release assertion
151         since that could delete oldDocument.
152
153         * dom/Node.cpp:
154         (WebCore::Node::moveTreeToNewScope):
155
156 2017-11-02  Antti Koivisto  <antti@apple.com>
157
158         First letter text renderer should be anonymous
159         https://bugs.webkit.org/show_bug.cgi?id=179114
160
161         Reviewed by Darin Adler.
162
163         Currently both RenderTextFragment and RenderText for first letter point to the same Text node.
164         There should only be one non-anonymous renderer per node.
165
166         * accessibility/AccessibilityRenderObject.cpp:
167         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
168
169             Skip the first letter text renderer instead of the fragment.
170
171         * rendering/RenderBoxModelObject.cpp:
172         (WebCore::firstLetterRemainingTextMap):
173
174             Use WeakPtr.
175             Modernize.
176
177         (WebCore::RenderBoxModelObject::willBeDestroyed):
178         (WebCore::RenderBoxModelObject::firstLetterRemainingText const):
179
180             Avoid hash lookup with the new isFirstLetter bit.
181
182         (WebCore::RenderBoxModelObject::setFirstLetterRemainingText):
183
184         * rendering/RenderElement.cpp:
185         (WebCore::RenderElement::RenderElement):
186         * rendering/RenderElement.h:
187         (WebCore::RenderElement::isFirstLetter const):
188         (WebCore::RenderElement::setIsFirstLetter):
189
190             Add a bit for more explicit code.
191
192         * rendering/RenderTextFragment.cpp:
193         (WebCore::RenderTextFragment::setText):
194
195             Assert that RenderTextFragment is always the non-anonymous renderer.
196
197         * style/RenderTreeUpdaterFirstLetter.cpp:
198         (WebCore::updateFirstLetterStyle):
199
200             Set the isFirstLetter bit.
201
202         (WebCore::createFirstLetterRenderer):
203
204             Set the isFirstLetter bit.
205             Remove the old text renderer before adding a new one.
206
207 2017-11-01  Frederic Wang  <fwang@igalia.com>
208
209         Remove ScrollableArea::isTouchScrollable and ScrollableArea::isOverflowScroll
210         https://bugs.webkit.org/show_bug.cgi?id=179121
211
212         Reviewed by Alex Christensen.
213
214         These functions were introduced in r161589 and r160236 but it seems that they have never
215         been used.
216
217         No new tests, behavior unchanged.
218
219         * platform/ScrollableArea.h:
220         (WebCore::ScrollableArea::isTouchScrollable const): Deleted.
221         (WebCore::ScrollableArea::isOverflowScroll const): Deleted.
222         * rendering/RenderLayer.h:
223
224 2017-11-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
225
226         [Curl] Make the order of scheduler job handling sequential 
227         https://bugs.webkit.org/show_bug.cgi?id=179127
228
229         Reviewed by Alex Christensen.
230
231         * platform/network/curl/CurlRequestScheduler.cpp:
232         (WebCore::CurlRequestScheduler::add):
233         (WebCore::CurlRequestScheduler::cancel):
234         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
235         (WebCore::CurlRequestScheduler::executeTasks):
236         (WebCore::CurlRequestScheduler::workerThread):
237         (WebCore::CurlRequestScheduler::startTransfer):
238         (WebCore::CurlRequestScheduler::completeTransfer):
239         (WebCore::CurlRequestScheduler::cancelTransfer):
240         (WebCore::CurlRequestScheduler::finalizeTransfer):
241         (WebCore::CurlJobList::isEmpty const): Deleted.
242         (WebCore::CurlJobList::startJobs): Deleted.
243         (WebCore::CurlJobList::finishJobs): Deleted.
244         (WebCore::CurlRequestScheduler::updateJobList): Deleted.
245         * platform/network/curl/CurlRequestScheduler.h:
246
247 2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>
248
249         NavigatorBase::onLine() accesses NetworkStateNotifier's singleton in a worker thread
250         https://bugs.webkit.org/show_bug.cgi?id=179149
251         <rdar://problem/35307552>
252
253         Reviewed by Jiewen Tan.
254
255         Fixed the bug making NavigatorBase::onLine a pure virtual function, and having two separate
256         implementations for Navigator and WorkerNavigator. The former uses the singleton directly,
257         and the latter returns the boolean stored in its instance. The boolean value is updated
258         via WorkerMessagingProxy when the online status changes.
259
260         No new tests.
261
262         * page/Navigator.cpp:
263         (WebCore::Navigator::onLine const):
264         * page/Navigator.h:
265         * page/NavigatorBase.cpp:
266         (WebCore::NavigatorBase::onLine): Deleted.
267         * page/NavigatorBase.h:
268         * page/WorkerNavigator.cpp:
269         (WebCore::WorkerNavigator::WorkerNavigator):
270         (WebCore::WorkerNavigator::onLine const):
271         * page/WorkerNavigator.h:
272         * platform/network/NetworkStateNotifier.cpp:
273         (WebCore::NetworkStateNotifier::singleton):
274         * workers/DedicatedWorkerGlobalScope.cpp:
275         (WebCore::DedicatedWorkerGlobalScope::create):
276         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
277         * workers/DedicatedWorkerGlobalScope.h:
278         * workers/DedicatedWorkerThread.cpp:
279         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
280         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
281         * workers/DedicatedWorkerThread.h:
282         * workers/Worker.cpp:
283         (WebCore::Worker::notifyFinished):
284         * workers/WorkerGlobalScope.cpp:
285         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
286         (WebCore::WorkerGlobalScope::navigator):
287         (WebCore::WorkerGlobalScope::setIsOnline):
288         * workers/WorkerGlobalScope.h:
289         * workers/WorkerGlobalScopeProxy.h:
290         * workers/WorkerMessagingProxy.cpp:
291         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
292         (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
293         * workers/WorkerMessagingProxy.h:
294         * workers/WorkerThread.cpp:
295         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
296         (WebCore::WorkerThread::WorkerThread):
297         (WebCore::WorkerThread::workerThread):
298         * workers/WorkerThread.h:
299         * workers/service/ServiceWorkerGlobalScope.cpp:
300         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
301         * workers/service/ServiceWorkerGlobalScope.h:
302         * workers/service/context/ServiceWorkerThread.cpp:
303         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
304         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
305         * workers/service/context/ServiceWorkerThread.h:
306
307 2017-11-01  Jiewen Tan  <jiewen_tan@apple.com>
308
309         Let is<T>() accept RefPtrs
310         https://bugs.webkit.org/show_bug.cgi?id=178612
311         <rdar://problem/35102004>
312
313         Reviewed by Ryosuke Niwa.
314
315         Get rid of .get() for all is<T>() calls.
316
317         No changes in behaviors.
318
319         * bindings/js/JSElementCustom.cpp:
320         (WebCore::createNewElementWrapper):
321         * bindings/js/JSMediaStreamTrackCustom.cpp:
322         (WebCore::toJSNewlyCreated):
323         * bindings/js/JSNodeCustom.cpp:
324         (WebCore::createWrapperInline):
325         * bindings/js/JSTextCustom.cpp:
326         (WebCore::toJSNewlyCreated):
327         * css/CSSFilterImageValue.cpp:
328         (WebCore::CSSFilterImageValue::loadSubimages):
329         * css/CSSFontFaceSet.cpp:
330         (WebCore::CSSFontFaceSet::matchingFaces):
331         * css/CSSFontSelector.cpp:
332         (WebCore::CSSFontSelector::addFontFaceRule):
333         * css/CSSToStyleMap.cpp:
334         (WebCore::CSSToStyleMap::mapNinePieceImage):
335         * css/FontFace.cpp:
336         (WebCore::FontFace::create):
337         * css/StyleBuilderConverter.h:
338         (WebCore::StyleBuilderConverter::createGridTrackList):
339         * css/StyleBuilderCustom.h:
340         (WebCore::StyleBuilderCustom::applyValueCursor):
341         (WebCore::StyleBuilderCustom::applyValueContent):
342         (WebCore::StyleBuilderCustom::applyValueWillChange):
343         * css/StyleProperties.cpp:
344         (WebCore::StyleProperties::propertyAsColor const):
345         (WebCore::StyleProperties::propertyAsValueID const):
346         * css/StyleResolver.cpp:
347         (WebCore::StyleResolver::createFilterOperations):
348         * css/TransformFunctions.cpp:
349         (WebCore::transformsForValue):
350         * css/ViewportStyleResolver.cpp:
351         (WebCore::ViewportStyleResolver::getViewportArgumentValue const):
352         * dom/Document.cpp:
353         (WebCore::Document::setBodyOrFrameset):
354         (WebCore::Document::setFocusedElement):
355         (WebCore::Document::updateHoverActiveState):
356         * dom/Element.cpp:
357         (WebCore::Element::setOuterHTML):
358         * dom/Range.cpp:
359         (WebCore::Range::insertNode):
360         * editing/ApplyStyleCommand.cpp:
361         (WebCore::toIdentifier):
362         (WebCore::ApplyStyleCommand::applyBlockStyle):
363         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
364         * editing/EditingStyle.cpp:
365         (WebCore::identifierForStyleProperty):
366         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle const):
367         (WebCore::EditingStyle::extractFontSizeDelta):
368         (WebCore::EditingStyle::textDirection const):
369         (WebCore::textDecorationValueList):
370         (WebCore::EditingStyle::prepareToApplyAt):
371         (WebCore::EditingStyle::legacyFontSize const):
372         (WebCore::EditingStyle::textDirectionForSelection):
373         (WebCore::StyleChange::StyleChange):
374         (WebCore::StyleChange::extractTextStyles):
375         (WebCore::diffTextDecorations):
376         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
377         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
378         * html/FormAssociatedElement.cpp:
379         (WebCore::FormAssociatedElement::findAssociatedForm):
380         * html/HTMLAreaElement.cpp:
381         (WebCore::HTMLAreaElement::imageElement const):
382         * html/HTMLElement.cpp:
383         (WebCore::HTMLElement::setOuterText):
384         (WebCore::HTMLElement::dirAttributeChanged):
385         * html/HTMLEmbedElement.cpp:
386         (WebCore::HTMLEmbedElement::rendererIsNeeded):
387         * html/HTMLFormControlElement.cpp:
388         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
389         * html/HTMLInputElement.cpp:
390         (WebCore::HTMLInputElement::dataList const):
391         * html/HTMLOptionElement.cpp:
392         (WebCore::HTMLOptionElement::setText):
393         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
394         * html/HTMLPlugInElement.cpp:
395         (WebCore::HTMLPlugInElement::isKeyboardFocusable const):
396         (WebCore::HTMLPlugInElement::isUserObservable const):
397         * html/HTMLSelectElement.cpp:
398         (WebCore::HTMLSelectElement::selectOption):
399         * html/HTMLSummaryElement.cpp:
400         (WebCore::isClickableControl):
401         * html/HTMLTextFormControlElement.cpp:
402         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
403         * html/RadioInputType.cpp:
404         (WebCore::RadioInputType::isKeyboardFocusable const):
405         * html/parser/HTMLConstructionSite.cpp:
406         (WebCore::HTMLConstructionSite::attachLater):
407         (WebCore::HTMLConstructionSite::insertTextNode):
408         * html/shadow/MediaControlElements.cpp:
409         (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
410         * html/track/TextTrackList.cpp:
411         (TextTrackList::append):
412         * inspector/InspectorDOMAgent.cpp:
413         (WebCore::InspectorDOMAgent::setNodeName):
414         * inspector/PageScriptDebugServer.cpp:
415         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
416         * page/FocusController.cpp:
417         (WebCore::shouldClearSelectionWhenChangingFocusedElement):
418         * page/FrameView.cpp:
419         (WebCore::FrameView::hasCustomScrollbars const):
420         * page/Page.cpp:
421         (WebCore::Page::pluginViews):
422         * page/mac/EventHandlerMac.mm:
423         (WebCore::EventHandler::platformPrepareForWheelEvents):
424         * rendering/RenderBoxModelObject.cpp:
425         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
426         * testing/Internals.cpp:
427         (WebCore::deferredStyleRulesCountForList):
428         (WebCore::deferredGroupRulesCountForList):
429         (WebCore::deferredKeyframesRulesCountForList):
430
431 2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
432
433         [curl] Fix build after r224299
434         https://bugs.webkit.org/show_bug.cgi?id=179155
435
436         Unreviewed.
437
438         Bug 175597 added the 6th argument of ResourceHandle constructor.
439         Apply the same change of ResourceHandleCFNet.cpp to
440         platformLoadResourceSynchronously of ResourceHandleCurl.cpp.
441
442         No new tests since there should be no behavioral change other
443
444         * platform/network/curl/ResourceHandleCurl.cpp:
445         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
446         Added the 6th arguemnt shouldContentEncodingSniff.
447
448 2017-11-01  Simon Fraser  <simon.fraser@apple.com>
449
450         Fix iOS build after r224312.
451
452         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
453         (WebCore::GraphicsContext::drawFocusRing):
454
455 2017-11-01  Daniel Bates  <dabates@apple.com>
456
457         Change Element::didAddUserAgentShadowRoot() to take a reference instead of a pointer
458         https://bugs.webkit.org/show_bug.cgi?id=179153
459
460         Reviewed by Ryosuke Niwa.
461
462         Element::didAddUserAgentShadowRoot() is always passed a non-null pointer to the added
463         ShadowRoot. Therefore we should have didAddUserAgentShadowRoot() take a lvalue reference
464         to a ShadowRoot.
465
466         No functionality changed. So, no new tests.
467
468         * dom/Element.cpp:
469         (WebCore::Element::addShadowRoot):
470         * dom/Element.h:
471         (WebCore::Element::didAddUserAgentShadowRoot):
472         * html/HTMLDetailsElement.cpp:
473         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
474         * html/HTMLDetailsElement.h:
475         * html/HTMLInputElement.cpp:
476         (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
477         * html/HTMLInputElement.h:
478         * html/HTMLMediaElement.cpp:
479         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
480         * html/HTMLMediaElement.h:
481         * html/HTMLMeterElement.cpp:
482         (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
483         * html/HTMLMeterElement.h:
484         * html/HTMLPlugInElement.cpp:
485         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
486         * html/HTMLPlugInElement.h:
487         * html/HTMLPlugInImageElement.cpp:
488         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
489         * html/HTMLPlugInImageElement.h:
490         * html/HTMLProgressElement.cpp:
491         (WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
492         * html/HTMLProgressElement.h:
493         * html/HTMLSummaryElement.cpp:
494         (WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
495         * html/HTMLSummaryElement.h:
496         * html/HTMLTextAreaElement.cpp:
497         (WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot):
498         * html/HTMLTextAreaElement.h:
499
500 2017-11-01  Jeremy Jones  <jeremyj@apple.com>
501
502         Implement WKFullscreenWindowController for iOS.
503         https://bugs.webkit.org/show_bug.cgi?id=178924
504         rdar://problem/34697120
505
506         Reviewed by Simon Fraser.
507
508         Enable ENABLE_FULLSCREEN_API for iOS.
509
510         * Configurations/FeatureDefines.xcconfig:
511
512 2017-11-01  Simon Fraser  <simon.fraser@apple.com>
513
514         Misc display list and other cleanup
515         https://bugs.webkit.org/show_bug.cgi?id=179150
516
517         Reviewed by Tim Horton.
518
519         A few functions in GraphicsContext would assert when using display lists, because they
520         had no recording clause. Fix them (ellipse drawing, and focus ring drawing).
521         
522         Use #pragma once in more places.
523
524         Add system trace points for display list recording.
525
526         No behavior change for non-display list code.
527
528         * platform/graphics/GraphicsContext.cpp:
529         (WebCore::GraphicsContext::fillEllipse):
530         (WebCore::GraphicsContext::strokeEllipse):
531         * platform/graphics/PlatformLayer.h:
532         * platform/graphics/ca/GraphicsLayerCA.cpp:
533         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
534         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h:
535         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
536         * platform/graphics/cg/GraphicsContextCG.h:
537         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
538         (WebCore::GraphicsContext::drawFocusRing):
539         * platform/graphics/displaylists/DisplayList.h:
540         * platform/graphics/displaylists/DisplayListItems.h:
541         (WebCore::DisplayList::DrawFocusRingPath::create):
542         (WebCore::DisplayList::DrawFocusRingPath::width const):
543         (WebCore::DisplayList::DrawFocusRingPath::offset const):
544         (WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath):
545         (WebCore::DisplayList::DrawFocusRingRects::create):
546         (WebCore::DisplayList::DrawFocusRingRects::width const):
547         (WebCore::DisplayList::DrawFocusRingRects::offset const):
548         (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects):
549         * platform/graphics/displaylists/DisplayListRecorder.cpp:
550         (WebCore::DisplayList::Recorder::restore):
551         (WebCore::DisplayList::Recorder::drawFocusRing):
552         * platform/graphics/displaylists/DisplayListRecorder.h:
553         * platform/graphics/displaylists/DisplayListReplayer.h:
554         * platform/graphics/mac/WebLayer.h:
555
556 2017-11-01  Per Arne Vollan  <pvollan@apple.com>
557
558         [Win] Fix compile errors in MediaPlayerPrivateAVFoundationCF.cpp
559         https://bugs.webkit.org/show_bug.cgi?id=179148
560
561         Reviewed by Ryosuke Niwa.
562
563         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
564         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURLChanged):
565
566 2017-11-01  Tim Horton  <timothy_horton@apple.com>
567
568         Adjust RenderElement size assertion to be more accurate
569         https://bugs.webkit.org/show_bug.cgi?id=179146
570
571         Reviewed by Simon Fraser.
572
573         * rendering/RenderElement.cpp:
574         Alignment rules for bitfields differ on different platforms. If we're
575         more truthful in our mimicing the layout of RenderElement, we can avoid
576         the assertion firing on more configurations.
577
578 2017-11-01  Mark Lam  <mark.lam@apple.com>
579
580         Add support to throw OOM if MarkedArgumentBuffer may overflow.
581         https://bugs.webkit.org/show_bug.cgi?id=179092
582         <rdar://problem/35116160>
583
584         Reviewed by Saam Barati.
585
586         No new tests.  The test for overflowing a MarkedArgumentBuffer will run for a
587         ridiculously long time, which renders it unsuitable for automated tests.
588
589         * Modules/plugins/QuickTimePluginReplacement.mm:
590         (WebCore::QuickTimePluginReplacement::installReplacement):
591         * bindings/js/JSCustomElementInterface.cpp:
592         (WebCore::constructCustomElementSynchronously):
593         (WebCore::JSCustomElementInterface::upgradeElement):
594         (WebCore::JSCustomElementInterface::invokeCallback):
595         * bindings/js/JSCustomXPathNSResolver.cpp:
596         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
597         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
598         (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
599         * bindings/js/JSDOMConvertSequences.h:
600         (WebCore::JSConverter<IDLSequence<T>>::convert):
601         (WebCore::JSConverter<IDLFrozenArray<T>>::convert):
602         * bindings/js/JSDOMConvertWebGL.cpp:
603         (WebCore::convertToJSValue):
604         * bindings/js/JSDOMIterator.h:
605         (WebCore::jsPair):
606         (WebCore::iteratorForEach):
607         * bindings/js/JSDOMMapLike.cpp:
608         (WebCore::forwardFunctionCallToBackingMap):
609         (WebCore::forwardForEachCallToBackingMap):
610         * bindings/js/JSDOMPromiseDeferred.cpp:
611         (WebCore::DeferredPromise::callFunction):
612         (WebCore::createRejectedPromiseWithTypeError):
613         * bindings/js/JSErrorHandler.cpp:
614         (WebCore::JSErrorHandler::handleEvent):
615         * bindings/js/JSEventListener.cpp:
616         (WebCore::JSEventListener::handleEvent):
617         * bindings/js/JSLazyEventListener.cpp:
618         (WebCore::JSLazyEventListener::initializeJSFunction const):
619         * bindings/js/JSPluginElementFunctions.cpp:
620         (WebCore::callPlugin):
621         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
622         (WebCore::constructJSReadableStreamReaderGeneric):
623         * bindings/js/ReadableStream.cpp:
624         (WebCore::ReadableStream::create):
625         (WebCore::ReadableStream::pipeTo):
626         (WebCore::ReadableStream::tee):
627         (WebCore::ReadableStream::lock):
628         (WebCore::checkReadableStream):
629         * bindings/js/ReadableStreamDefaultController.cpp:
630         (WebCore::ReadableStreamDefaultController::invoke):
631         * bindings/js/ScheduledAction.cpp:
632         (WebCore::ScheduledAction::executeFunctionInContext):
633         * bindings/js/SerializedScriptValue.cpp:
634         (WebCore::CloneSerializer::recordObject):
635         (WebCore::CloneSerializer::serialize):
636         (WebCore::CloneDeserializer::readTerminal):
637         (WebCore::CloneDeserializer::deserialize):
638         * bindings/scripts/CodeGeneratorJS.pm:
639         (GenerateCallbackImplementationContent):
640         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
641         (WebCore::JSTestCallbackFunction::handleEvent):
642         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
643         (WebCore::JSTestCallbackFunctionRethrow::handleEvent):
644         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
645         (WebCore::JSTestCallbackFunctionWithThisObject::handleEvent):
646         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
647         (WebCore::JSTestCallbackFunctionWithTypedefs::handleEvent):
648         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
649         (WebCore::JSTestCallbackInterface::callbackWithNoParam):
650         (WebCore::JSTestCallbackInterface::callbackWithArrayParam):
651         (WebCore::JSTestCallbackInterface::callbackWithSerializedScriptValueParam):
652         (WebCore::JSTestCallbackInterface::callbackWithStringList):
653         (WebCore::JSTestCallbackInterface::callbackWithBoolean):
654         (WebCore::JSTestCallbackInterface::callbackRequiresThisToPass):
655         (WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
656         (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
657         (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
658         (WebCore::JSTestCallbackInterface::callbackWithThisObject):
659         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
660         (WebCore::JSTestVoidCallbackFunction::handleEvent):
661         * bridge/NP_jsobject.cpp:
662         * bridge/objc/WebScriptObject.mm:
663         (-[WebScriptObject callWebScriptMethod:withArguments:]):
664         * html/HTMLMediaElement.cpp:
665         (WebCore::HTMLMediaElement::updateCaptionContainer):
666         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
667         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
668         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
669         * html/HTMLPlugInImageElement.cpp:
670         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
671         * testing/Internals.cpp:
672         (WebCore::Internals::cloneArrayBuffer):
673
674 2017-11-01  Andy Estes  <aestes@apple.com>
675
676         [Apple Pay] Update the enum traits for PaymentError::ContactField
677         https://bugs.webkit.org/show_bug.cgi?id=179145
678         <rdar://problem/35303108>
679
680         Reviewed by Tim Horton.
681
682         Account for the values added to PaymentError::ContactField in r220718 and r223580.
683
684         * Modules/applepay/ApplePaySessionPaymentRequest.h:
685
686 2017-11-01  Daniel Bates  <dabates@apple.com>
687
688         Remove unused Element::alwaysCreateUserAgentShadowRoot()
689         https://bugs.webkit.org/show_bug.cgi?id=179141
690
691         Reviewed by Ryosuke Niwa.
692
693         In changeset r208135 Element::createShadowRoot() was removed. And Element::createShadowRoot()
694         was the only caller of Element::alwaysCreateUserAgentShadowRoot(). We should remove
695         Element::alwaysCreateUserAgentShadowRoot() as it is unused.
696
697         * dom/Element.h:
698         (WebCore::Element::didAddUserAgentShadowRoot):
699         (WebCore::Element::alwaysCreateUserAgentShadowRoot const): Deleted.
700         * html/HTMLButtonElement.h:
701         * html/HTMLFormControlElement.h:
702         * html/HTMLMediaElement.h:
703
704 2017-11-01  Chris Dumez  <cdumez@apple.com>
705
706         Drop running Service Worker Jobs on a background thread
707         https://bugs.webkit.org/show_bug.cgi?id=179142
708
709         Reviewed by Youenn Fablet.
710
711         Drop running Service Worker Jobs on a background thread. We don't really need to
712         and this simplifies the logic a lot.
713
714         * workers/service/server/SWServer.cpp:
715         (WebCore::SWServer::getRegistration):
716         (WebCore::SWServer::addRegistration):
717         (WebCore::SWServer::removeRegistration):
718         * workers/service/server/SWServerJobQueue.cpp:
719         (WebCore::SWServerJobQueue::scriptContextStarted):
720         (WebCore::SWServerJobQueue::startNextJob):
721         (WebCore::SWServerJobQueue::runRegisterJob):
722         (WebCore::SWServerJobQueue::runUnregisterJob):
723         (WebCore::SWServerJobQueue::runUpdateJob):
724         (WebCore::SWServerJobQueue::finishCurrentJob):
725         * workers/service/server/SWServerJobQueue.h:
726
727 2017-11-01  Per Arne Vollan  <pvollan@apple.com>
728
729         Unreviewed, try to fix Windows build.
730
731         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
732         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL):
733
734 2017-11-01  Chris Dumez  <cdumez@apple.com>
735
736         Split JobQueue logic out of SWServerRegistration
737         https://bugs.webkit.org/show_bug.cgi?id=179126
738
739         Reviewed by Brady Eidson.
740
741         Split JobQueue logic out of SWServerRegistration and into a SWServerJobQueue class to match the Service Workers
742         specification more closely.
743
744         * Sources.txt:
745         * WebCore.xcodeproj/project.pbxproj:
746         * workers/service/ServiceWorkerContainer.cpp:
747         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
748         * workers/service/ServiceWorkerRegistrationData.cpp:
749         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
750         * workers/service/ServiceWorkerRegistrationData.h:
751         (WebCore::ServiceWorkerRegistrationData::encode const):
752         (WebCore::ServiceWorkerRegistrationData::decode):
753         * workers/service/server/SWServer.cpp:
754         (WebCore::SWServer::~SWServer):
755         (WebCore::SWServer::getRegistration):
756         (WebCore::SWServer::addRegistration):
757         (WebCore::SWServer::removeRegistration):
758         (WebCore::SWServer::Connection::scriptContextStarted):
759         (WebCore::SWServer::scheduleJob):
760         (WebCore::SWServer::scriptFetchFinished):
761         (WebCore::SWServer::scriptContextFailedToStart):
762         (WebCore::SWServer::scriptContextStarted):
763         * workers/service/server/SWServer.h:
764         * workers/service/server/SWServerJobQueue.cpp: Added.
765         (WebCore::SWServerJobQueue::SWServerJobQueue):
766         (WebCore::SWServerJobQueue::~SWServerJobQueue):
767         (WebCore::SWServerJobQueue::enqueueJob):
768         (WebCore::SWServerJobQueue::scriptFetchFinished):
769         (WebCore::SWServerJobQueue::scriptContextFailedToStart):
770         (WebCore::SWServerJobQueue::scriptContextStarted):
771         (WebCore::SWServerJobQueue::startNextJob):
772         (WebCore::SWServerJobQueue::runRegisterJob):
773         (WebCore::SWServerJobQueue::runUnregisterJob):
774         (WebCore::SWServerJobQueue::runUpdateJob):
775         (WebCore::SWServerJobQueue::rejectWithExceptionOnMainThread):
776         (WebCore::SWServerJobQueue::resolveWithRegistrationOnMainThread):
777         (WebCore::SWServerJobQueue::resolveCurrentRegistrationJobOnMainThead):
778         (WebCore::SWServerJobQueue::resolveWithUnregistrationResultOnMainThread):
779         (WebCore::SWServerJobQueue::startScriptFetchFromMainThread):
780         (WebCore::SWServerJobQueue::rejectCurrentJob):
781         (WebCore::SWServerJobQueue::resolveCurrentRegistrationJob):
782         (WebCore::SWServerJobQueue::resolveCurrentUnregistrationJob):
783         (WebCore::SWServerJobQueue::startScriptFetchForCurrentJob):
784         (WebCore::SWServerJobQueue::finishCurrentJob):
785         * workers/service/server/SWServerJobQueue.h: Added.
786         * workers/service/server/SWServerRegistration.cpp:
787         (WebCore::SWServerRegistration::SWServerRegistration):
788         (WebCore::SWServerRegistration::~SWServerRegistration):
789         (WebCore::SWServerRegistration::data const):
790         * workers/service/server/SWServerRegistration.h:
791         (WebCore::SWServerRegistration::key const):
792         (WebCore::SWServerRegistration::isUninstalling const):
793         (WebCore::SWServerRegistration::setIsUninstalling):
794         (WebCore::SWServerRegistration::setLastUpdateTime):
795         (WebCore::SWServerRegistration::updateViaCache const):
796         (WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier):
797
798 2017-11-01  Daniel Bates  <dabates@apple.com>
799
800         XMLHttpRequest should not sniff content encoding
801         https://bugs.webkit.org/show_bug.cgi?id=175597
802         <rdar://problem/34912624>
803
804         Reviewed by Alex Christensen.
805
806         Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and
807         "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped
808         decompressed. Specifically, such a response would be treated analogous to a response with headers
809         "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the
810         behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior
811         breaks the Epic Zen Garden demo: <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.
812
813         On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
814         selectively opt out of content encoding sniffing for other network requests. This will be done
815         in subsequent commits to make it straightforward to identify site breakage (if any).
816
817         * loader/ResourceLoader.cpp:
818         (WebCore::ResourceLoader::start): Pass content encoding policy.
819         * loader/ResourceLoader.h:
820         (WebCore::ResourceLoader::shouldSniffContentEncoding const): Added.
821         * loader/ResourceLoaderOptions.h:
822         * loader/appcache/ApplicationCacheGroup.cpp:
823         (WebCore::ApplicationCacheGroup::createResourceHandle): Enable content encoding sniff to match existing behavior.
824         * platform/network/BlobResourceHandle.cpp:
825         (WebCore::BlobResourceHandle::BlobResourceHandle): Ditto. We should look to disable content encoding sniffing in
826         a subsequent change.
827         * platform/network/PingHandle.h: Ditto.
828         * platform/network/ResourceHandle.cpp:
829         (WebCore::ResourceHandle::ResourceHandle): Modified to take a boolean as to whether to enable content encoding sniffing.
830         (WebCore::ResourceHandle::create): Ditto.
831         (WebCore::ResourceHandle::shouldContentEncodingSniff const): Added.
832         * platform/network/ResourceHandle.h:
833         * platform/network/ResourceHandleInternal.h:
834         (WebCore::ResourceHandleInternal::ResourceHandleInternal): Modified to take a boolean as to whether to enable content
835         encoding sniffing.
836         * platform/network/cf/ResourceHandleCFNet.cpp:
837         (WebCore::ResourceHandle::createCFURLConnection): Modified to take a boolean as to whether to enable content encoding
838         sniffing and apply this policy to the CFMutableURLRequestRef object when building on macOS 10.13.2.
839         (WebCore::ResourceHandle::start):
840         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Enable content encoding sniff to match existing behavior.
841         * platform/network/mac/ResourceHandleMac.mm:
842         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Added helper function to apply sniffing policies
843         and storage partition, if applicable. 
844         (WebCore::ResourceHandle::createNSURLConnection): Modified to take a boolean as to whether to enable content encoding
845         sniffing. Calls adjustNSRequestApplyingPolicies() to apply this policy.
846         (WebCore::ResourceHandle::start):
847         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Enable content encoding sniff to match existing behavior.
848         * platform/network/soup/ResourceHandleSoup.cpp:
849         (WebCore::ResourceHandle::create): Modified to take a boolean as to whether to enable content encoding sniffing.
850         (WebCore::ResourceHandle::ResourceHandle): Ditto.
851         (WebCore::ResourceHandle::releaseForDownload): Pass content encoding policy.
852         * xml/XMLHttpRequest.cpp:
853         (WebCore::XMLHttpRequest::createRequest): Do not enable content encoding sniffing for the request.
854
855 2017-11-01  Jer Noble  <jer.noble@apple.com>
856
857         [Performance] Painting <video> to canvas spends a lot of time in URL getting and parsing
858         https://bugs.webkit.org/show_bug.cgi?id=179131
859
860         Reviewed by Eric Carlson.
861
862         Every time a <video> backed by MediaPlayerPrivateAVFoundation is asked to paint, it is first
863         queried whether it has a single security origin. To do this, the media player asks
864         AVFoundation what the "resolvedURL" of the asset is. This answer never changes after
865         metadata is first fetched, so the answer should be cached. To do so, add a m_resolvedURL
866         ivar to MediaPlayerPrivateAVFoundation, and add a setResolvedURL() and resolvedURLChanged()
867         method to re-query the value. Also create ivars for the security origin rather than re-
868         parsing them every time.
869
870         Drive-by fix: clean up all the instances where we pass a String rather than a URL (and thus
871         have to re-parse the URL at each point).
872
873         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
874         (WebCore::MediaPlayerPrivateAVFoundation::load):
875         (WebCore::MediaPlayerPrivateAVFoundation::hasSingleSecurityOrigin const):
876         (WebCore::MediaPlayerPrivateAVFoundation::setResolvedURL):
877         (WebCore::MediaPlayerPrivateAVFoundation::metadataLoaded):
878         (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
879         (WebCore::MediaPlayerPrivateAVFoundation::resolvedURL const): Deleted.
880         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
881         (WebCore::MediaPlayerPrivateAVFoundation::resolvedURL const):
882         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
883         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURLChanged):
884         (WebCore::AVFWrapper::createAssetForURL):
885         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL const): Deleted.
886         (WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin const): Deleted.
887         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
888         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
889         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
890         (WebCore::canonicalURL):
891         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
892         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
893         (WebCore::canonicalURL):
894         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin const): Deleted.
895
896 2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>
897
898         innerText->renderBox() can be null in HTMLTextFormControlElement::setSelectionRange
899         https://bugs.webkit.org/show_bug.cgi?id=179103
900
901         Reviewed by Antti Koivisto.
902
903         Added a missing null check.
904
905         Unfortunately, no new tests since we don't have a working reproduction for trunk code.
906
907         * html/HTMLTextFormControlElement.cpp:
908         (WebCore::HTMLTextFormControlElement::setSelectionRange): Added a null check.
909
910 2017-11-01  Brady Eidson  <beidson@apple.com>
911
912         Plumbing for handling SW scripts failing to evaluate
913         https://bugs.webkit.org/show_bug.cgi?id=178926
914
915         Reviewed by Chris Dumez.
916
917         No new tests (Currently no observable behavior change).
918
919         In an upcoming patch we'll actually run the appropriate observable steps for when
920         a ServiceWorker script fails to evaluate.
921
922         This is a standalone refactoring + plumbing patch that will make the observable changes
923         easier to review.
924
925         * bindings/js/WorkerScriptController.cpp:
926         (WebCore::WorkerScriptController::evaluate):
927         * bindings/js/WorkerScriptController.h:
928         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
929         (WebCore::WorkerScriptController::vm):
930         (WebCore::WorkerScriptController::initScriptIfNeeded):
931
932         * workers/WorkerMessagingProxy.cpp:
933         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
934
935         * workers/WorkerThread.cpp:
936         (WebCore::WorkerThread::start):
937         (WebCore::WorkerThread::workerThread):
938         * workers/WorkerThread.h:
939
940         * workers/service/context/SWContextManager.cpp:
941         (WebCore::SWContextManager::registerServiceWorkerThreadForUpdate):
942         (WebCore::SWContextManager::registerServiceWorkerThread): Deleted.
943         * workers/service/context/SWContextManager.h:
944
945         * workers/service/context/ServiceWorkerThread.h:
946         (WebCore::ServiceWorkerThread::serverConnectionIdentifier const):
947         (WebCore::ServiceWorkerThread::contextData const):
948
949         * workers/service/context/ServiceWorkerThreadProxy.cpp:
950         (WebCore::ServiceWorkerThreadProxy::create):
951         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
952
953         * workers/service/server/SWServer.cpp:
954         (WebCore::SWServer::updateWorker):
955         (WebCore::SWServer::createWorker): Deleted.
956         * workers/service/server/SWServer.h:
957
958         * workers/service/server/SWServerRegistration.cpp:
959         (WebCore::SWServerRegistration::scriptFetchFinished):
960         (WebCore::SWServerRegistration::scriptContextFailedToStart):
961
962 2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>
963
964         Assert that NoEventDispatchAssertion is not in the stack when executing a script
965         https://bugs.webkit.org/show_bug.cgi?id=179107
966
967         Reviewed by Simon Fraser.
968
969         Assert that NoEventDispatchAssertion::isEventAllowedInMainThread() is true when we're about to execute a script
970         by adding the assertion in ScriptController::canExecuteScripts which gets called with AboutToExecuteScript
971         whenever we're about to run scripts in event handlers, etc...
972
973         We don't assert the construction of event handlers in JSLazyEventListener since this happens while copying
974         the DOM tree inside a SVG use element and creating a event handler's JS function won't execute arbitrary scripts.
975
976         No new tests since there should be no behavioral change other 
977
978         * bindings/js/JSLazyEventListener.cpp:
979         (WebCore::JSLazyEventListener::initializeJSFunction const): Use newly added AboutToCreateEventListener.
980         (WebCore::JSLazyEventListener::create): Ditto.
981         * bindings/js/ScriptController.cpp:
982         (WebCore::ScriptController::canExecuteScripts): Added the assertion.
983         * bindings/js/ScriptController.h:
984
985 2017-11-01  Chris Dumez  <cdumez@apple.com>
986
987         Regression(r219659): Can no longer log into ifttt.com using Google account
988         https://bugs.webkit.org/show_bug.cgi?id=179117
989
990         Reviewed by Geoffrey Garen.
991
992         After r219659, it is no longer possible to log into ifttt.com using a Google
993         account:
994         - Signed into a Google account already
995         - Visit https://ifttt.com/login
996         - Click "Continue with Google"
997         - Select the signed in account
998
999         It turns out that this change to the HTML specification was not Web-compatible:
1000         See https://bugzilla.mozilla.org/show_bug.cgi?id=1412741 & https://github.com/whatwg/html/issues/3183
1001
1002         This patch reverts r219659 for now until we agree on what behavior should get
1003         specified.
1004
1005         No new tests, rebaselined existing tests.
1006
1007         * bindings/js/JSDOMWindowCustom.cpp:
1008         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1009         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1010         (WebCore::JSDOMWindow::getOwnPropertyNames):
1011         * bindings/js/JSLocationCustom.cpp:
1012         (WebCore::getOwnPropertySlotCommon):
1013         (WebCore::JSLocation::getOwnPropertyNames):
1014
1015 2017-10-31  Dean Jackson  <dino@apple.com>
1016
1017         transferFromImageBitmap should update canvas dimensions
1018         https://bugs.webkit.org/show_bug.cgi?id=179096
1019         <rdar://problem/35285218>
1020
1021         Reviewed by Sam Weinig.
1022
1023         When transferFromImageBitmap is called, the dimensions of the HTMLCanvasElement
1024         should be updated to reflect the size of the passed ImageBitmap.
1025
1026         Update an existing WPT result.
1027
1028         * html/HTMLCanvasElement.cpp:
1029         (WebCore::HTMLCanvasElement::setImageBuffer const): Update the
1030         size of the element based on the incoming buffer.
1031         * html/HTMLCanvasElement.h: Mark m_size as mutable so we can
1032         call it from the const function setImageBuffer.
1033
1034 2017-11-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1035
1036         [JSC] Introduce @toObject
1037         https://bugs.webkit.org/show_bug.cgi?id=178726
1038
1039         Reviewed by Saam Barati.
1040
1041         Use @isObject instead. It is more efficient.
1042
1043         * Modules/mediastream/NavigatorUserMedia.js:
1044         (getUserMedia):
1045
1046 2017-11-01  Commit Queue  <commit-queue@webkit.org>
1047
1048         Unreviewed, rolling out r224273 and r224278.
1049         https://bugs.webkit.org/show_bug.cgi?id=179120
1050
1051         Some crashes under guard malloc (Requested by anttik on
1052         #webkit).
1053
1054         Reverted changesets:
1055
1056         "Remove empty continuations in
1057         RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers"
1058         https://bugs.webkit.org/show_bug.cgi?id=179014
1059         https://trac.webkit.org/changeset/224273
1060
1061         "Fix ContinuationChainNode::insertAfter assertion."
1062         https://bugs.webkit.org/show_bug.cgi?id=179115
1063         https://trac.webkit.org/changeset/224278
1064
1065 2017-11-01  Emilio Cobos Álvarez  <emilio@crisal.io>
1066
1067         Fix ContinuationChainNode::insertAfter assertion.
1068         https://bugs.webkit.org/show_bug.cgi?id=179115
1069
1070         Reviewed by Antti Koivisto.
1071
1072         The assertion was writing instead of reading next->previous.
1073
1074         Hopefully it's harmless because it was clobbered on the same line, but
1075         it's worth asserting what it was intending to assert.
1076
1077         No new tests (no behaviour change).
1078
1079         * rendering/RenderBoxModelObject.cpp:
1080         (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):
1081
1082 2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
1083
1084         Use LazyNeverDestroyed instead of DEFINE_GLOBAL
1085         https://bugs.webkit.org/show_bug.cgi?id=174979
1086
1087         Reviewed by Yusuke Suzuki.
1088
1089         No new tests since there should be no behavioral change.
1090
1091         * DerivedSources.cpp: Remove the warning of StaticConstructors.h.
1092         * WebCore.order: Removed
1093         * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
1094         * dom/QualifiedName.cpp:
1095         (WebCore::createQualifiedName): Deleted.
1096         * dom/QualifiedName.h: Removed createQualifiedName.
1097         * dom/make_names.pl:
1098         (printCppHead): Do not include StaticConstructors.h.
1099
1100 2017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>
1101
1102         [GTK] Always include TextureMapper.cmake
1103         https://bugs.webkit.org/show_bug.cgi?id=179060
1104
1105         Reviewed by Carlos Garcia Campos.
1106
1107         * PlatformGTK.cmake:
1108
1109 2017-11-01  Antti Koivisto  <antti@apple.com>
1110
1111         Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
1112         https://bugs.webkit.org/show_bug.cgi?id=179014
1113
1114         Reviewed by Geoff Garen.
1115
1116         Treat continuation similarly to other anonymous wrappers. This makes things more understandable
1117         and allows removal of some questionable code in RenderBlock::takeChild.
1118
1119         The patch also makes continuation chain a double linked so we can efficiently remove single
1120         continuations from the chain. It also gets rid of algorithms that recurse in continuation chain.
1121
1122         * accessibility/AccessibilityRenderObject.cpp:
1123         (WebCore::firstChildInContinuation):
1124         * rendering/RenderBlock.cpp:
1125         (WebCore::RenderBlock::styleDidChange):
1126
1127             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
1128             the chain only in the (non-continuation) head renderer.
1129
1130         (WebCore::RenderBlock::dropAnonymousBoxChild):
1131
1132             Make a member function.
1133
1134         (WebCore::RenderBlock::takeChild):
1135
1136             Remove code that destroyed empty continuations and caused the parent to destroy itself.
1137             Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers.
1138
1139         * rendering/RenderBlock.h:
1140         * rendering/RenderBoxModelObject.cpp:
1141         (WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode):
1142         (WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode):
1143         (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):
1144
1145             Track continuations with double linked lists.
1146
1147         (WebCore::continuationChainNodeMap):
1148         (WebCore::RenderBoxModelObject::willBeDestroyed):
1149
1150             Don't recurse to destroy continuation chain. 
1151             Destroy all continuations iteratively if this is the head of the chain.
1152             When destroying a continuation renderer simply remove it from the chain.
1153
1154         (WebCore::RenderBoxModelObject::continuation const):
1155         (WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter):
1156         (WebCore::RenderBoxModelObject::removeFromContinuationChain):
1157         (WebCore::RenderBoxModelObject::ensureContinuationChainNode):
1158         (WebCore::continuationMap): Deleted.
1159         (WebCore::RenderBoxModelObject::setContinuation): Deleted.
1160         * rendering/RenderBoxModelObject.h:
1161         * rendering/RenderElement.cpp:
1162         (WebCore::RenderElement::RenderElement):
1163         (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):
1164
1165             Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and
1166             then using it.
1167             Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain).
1168
1169         (WebCore::RenderElement::styleDidChange):
1170
1171             removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.
1172
1173         (WebCore::RenderElement::updateOutlineAutoAncestor):
1174         * rendering/RenderElement.h:
1175         (WebCore::RenderElement::hasContinuationChainNode const):
1176         (WebCore::RenderElement::setHasContinuationChainNode):
1177         (WebCore::RenderElement::hasContinuation const): Deleted.
1178         (WebCore::RenderElement::setHasContinuation): Deleted.
1179         * rendering/RenderInline.cpp:
1180         (WebCore::RenderInline::styleDidChange):
1181
1182             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
1183             the chain only in the (non-continuation) head renderer.
1184
1185         (WebCore::RenderInline::addChildIgnoringContinuation):
1186
1187             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
1188
1189         (WebCore::RenderInline::splitInlines):
1190         (WebCore::RenderInline::addChildToContinuation):
1191         (WebCore::RenderInline::childBecameNonInline):
1192
1193             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
1194
1195         * rendering/RenderInline.h:
1196         * rendering/RenderObject.cpp:
1197         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
1198         (WebCore::RenderObject::outputRenderObject const):
1199         (WebCore::findDestroyRootIncludingAnonymous):
1200
1201             Allow anonymous continuations as destroy roots.
1202
1203         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
1204
1205             Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
1206             Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.
1207
1208 2017-10-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
1209
1210         updateMaskedAncestorShouldIsolateBlending() should check the Nullability of the computedStyle() of the element's ancestors
1211         https://bugs.webkit.org/show_bug.cgi?id=179085
1212         <rdar://problem/30888101>
1213
1214         Reviewed by Ryosuke Niwa.
1215
1216         This is a defensive change. The Element::computedStyle() can be null only
1217         if the element is not a connected to the DOM tree. This may happen if
1218         while the DOM tree is being changed, a different event is handled such
1219         that it requires styleReclac()/layout() to happen. In this case, the render
1220         tree will be in an incorrect state.
1221
1222         * rendering/svg/SVGRenderSupport.cpp:
1223         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
1224
1225 2017-10-31  Alex Christensen  <achristensen@webkit.org>
1226
1227         Use asynchronous ResourceHandleClient calls for WebKit1
1228         https://bugs.webkit.org/show_bug.cgi?id=160677
1229
1230         Reviewed by Brady Eidson.
1231
1232         Covered by existing tests.
1233
1234         * PlatformAppleWin.cmake:
1235         * PlatformMac.cmake:
1236         * WebCore.xcodeproj/project.pbxproj:
1237         * loader/ResourceLoader.cpp:
1238         (WebCore::ResourceLoader::willSendRequestAsync):
1239         (WebCore::ResourceLoader::didReceiveResponseAsync):
1240         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
1241         * loader/ResourceLoader.h:
1242         * loader/appcache/ApplicationCacheGroup.cpp:
1243         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
1244         (WebCore::ApplicationCacheGroup::willSendRequestAsync):
1245         (WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
1246         (WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
1247         * loader/appcache/ApplicationCacheGroup.h:
1248         * platform/network/BlobResourceHandle.cpp:
1249         (WebCore::BlobResourceHandle::continueDidReceiveResponse):
1250         (WebCore::BlobResourceHandle::getSizeForNext):
1251         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
1252         (WebCore::BlobResourceHandle::notifyResponseOnError):
1253         * platform/network/PingHandle.h:
1254         * platform/network/ResourceHandle.cpp:
1255         (WebCore::ResourceHandle::didReceiveResponse):
1256         (WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
1257         * platform/network/ResourceHandle.h:
1258         * platform/network/ResourceHandleClient.cpp:
1259         (WebCore::ResourceHandleClient::~ResourceHandleClient):
1260         (WebCore::ResourceHandleClient::willSendRequest): Deleted.
1261         (WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
1262         (WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
1263         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
1264         * platform/network/ResourceHandleClient.h:
1265         (WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
1266         (WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
1267         (WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
1268         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
1269         * platform/network/ResourceHandleInternal.h:
1270         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1271         * platform/network/SynchronousLoaderClient.cpp:
1272         (WebCore::SynchronousLoaderClient::willSendRequestAsync):
1273         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
1274         (WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
1275         (WebCore::SynchronousLoaderClient::didFinishLoading):
1276         (WebCore::SynchronousLoaderClient::didFail):
1277         (WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
1278         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
1279         (WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
1280         * platform/network/SynchronousLoaderClient.h:
1281         * platform/network/cf/ResourceHandleCFNet.cpp:
1282         (WebCore::ResourceHandle::createCFURLConnection):
1283         (WebCore::ResourceHandle::start):
1284         (WebCore::ResourceHandle::willSendRequest):
1285         (WebCore::ResourceHandle::shouldUseCredentialStorage):
1286         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
1287         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1288         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1289         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
1290         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
1291         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1292         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1293         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1294         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1295         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1296         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1297         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
1298         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1299         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
1300         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1301         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
1302         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1303         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
1304         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
1305         * platform/network/mac/ResourceHandleMac.mm:
1306         (WebCore::ResourceHandle::start):
1307         (WebCore::ResourceHandle::schedule):
1308         (WebCore::ResourceHandle::makeDelegate):
1309         (WebCore::ResourceHandle::delegate):
1310         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1311         (WebCore::ResourceHandle::willSendRequest):
1312         (WebCore::ResourceHandle::continueWillSendRequest):
1313         (WebCore::ResourceHandle::continueDidReceiveResponse):
1314         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
1315         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
1316         (WebCore::ResourceHandle::continueWillCacheResponse):
1317         (WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
1318         * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
1319         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
1320         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1321         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1322         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
1323         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
1324         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
1325         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1326         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
1327         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
1328         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
1329         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
1330
1331 2017-10-31  Simon Fraser  <simon.fraser@apple.com>
1332
1333         Rubber-banding overflow-scrolling-touch shows black
1334         https://bugs.webkit.org/show_bug.cgi?id=179087
1335         rdar://problem/35260253
1336
1337         Reviewed by Sam Weinig.
1338
1339         The "backgroundIsKnownToBeObscured" optimization was kicking in for an overflow:scroll
1340         whose area was completely covered by its contents, which happens with overlay scrollbars.
1341
1342         However, this ignored the fact that you can rubber-band to reveal the background, and,
1343         on iOS, composited scrolling requires that the scroller background is painted since it goes
1344         into its own layer.
1345
1346         Fix by turning off the optimization for layers that scroll overflow, including those
1347         using composited scrolling.
1348
1349         Test: fast/scrolling/rubber-band-shows-background.html
1350
1351         * rendering/RenderBox.cpp:
1352         (WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
1353         (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
1354         * rendering/RenderLayer.cpp:
1355         (WebCore::RenderLayer::scrollTo):
1356         (WebCore::RenderLayer::calculateClipRects const):
1357         * rendering/RenderLayer.h:
1358
1359 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1360
1361         Clean up some drag and drop feature flags
1362         https://bugs.webkit.org/show_bug.cgi?id=179082
1363
1364         Reviewed by Simon Fraser.
1365
1366         * Configurations/FeatureDefines.xcconfig:
1367
1368 2017-10-31  Simon Fraser  <simon.fraser@apple.com>
1369
1370         Make it possible to test rubber-banding in overflow scroll
1371         https://bugs.webkit.org/show_bug.cgi?id=179078
1372
1373         Reviewed by Sam Weinig.
1374
1375         Test: fast/scrolling/unconstrained-scrollto.html
1376         
1377         Add internals.unconstrainedScrollTo(element, x, y) and plumb through ScrollClamping
1378         (which replaces RenderLayer::ScrollOffsetClamping) to support it.
1379
1380         Flip the default from unclamped to clamped for various RenderLayer scrolling-related
1381         functions, since most callers want clamped.
1382
1383         * accessibility/AccessibilityRenderObject.cpp:
1384         (WebCore::AccessibilityRenderObject::scrollTo const):
1385         * dom/Element.cpp:
1386         (WebCore::Element::scrollTo):
1387         * dom/Element.h:
1388         * html/HTMLBodyElement.cpp:
1389         (WebCore::HTMLBodyElement::scrollTo):
1390         * html/HTMLBodyElement.h:
1391         * html/TextFieldInputType.cpp:
1392         (WebCore::TextFieldInputType::elementDidBlur):
1393         * page/DOMWindow.cpp:
1394         (WebCore::DOMWindow::scrollTo const):
1395         * page/DOMWindow.h:
1396         * page/Frame.cpp:
1397         (WebCore::Frame::scrollOverflowLayer):
1398         (WebCore::Frame::checkOverflowScroll):
1399         * platform/ScrollAnimator.cpp:
1400         (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
1401         * platform/ScrollAnimator.h:
1402         * platform/ScrollTypes.h:
1403         * platform/ScrollableArea.cpp:
1404         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
1405         * platform/ScrollableArea.h:
1406         * platform/cocoa/ScrollController.h:
1407         * platform/mac/ScrollAnimatorMac.h:
1408         * platform/mac/ScrollAnimatorMac.mm:
1409         (WebCore::ScrollAnimatorMac::scrollToOffsetWithoutAnimation):
1410         (WebCore::ScrollAnimatorMac::immediateScrollToPosition):
1411         * platform/mock/ScrollAnimatorMock.h:
1412         * rendering/RenderBox.cpp:
1413         (WebCore::RenderBox::setScrollLeft):
1414         (WebCore::RenderBox::setScrollTop):
1415         * rendering/RenderBox.h:
1416         * rendering/RenderLayer.cpp:
1417         (WebCore::RenderLayer::panScrollFromPoint):
1418         (WebCore::RenderLayer::scrollByRecursively):
1419         (WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded):
1420         (WebCore::RenderLayer::scrollToXPosition):
1421         (WebCore::RenderLayer::scrollToYPosition):
1422         (WebCore::RenderLayer::scrollToOffset):
1423         * rendering/RenderLayer.h:
1424         * rendering/RenderListBox.cpp:
1425         (WebCore::RenderListBox::setScrollLeft):
1426         (WebCore::RenderListBox::setScrollTop):
1427         * rendering/RenderListBox.h:
1428         * rendering/RenderTextControlSingleLine.cpp:
1429         (WebCore::RenderTextControlSingleLine::setScrollLeft):
1430         (WebCore::RenderTextControlSingleLine::setScrollTop):
1431         * rendering/RenderTextControlSingleLine.h:
1432         * testing/Internals.cpp:
1433         (WebCore::Internals::unconstrainedScrollTo):
1434         * testing/Internals.h:
1435         * testing/Internals.idl:
1436
1437 2017-10-31  Dean Jackson  <dino@apple.com>
1438
1439         Accept Settings object in ImageBitmapRenderingContext constructor and getContext
1440         https://bugs.webkit.org/show_bug.cgi?id=179075
1441         <rdar://problem/35279965>
1442
1443         Reviewed by Sam Weinig.
1444
1445         Allow getContext("bitmaprenderer") to take a dictionary as another argument, and
1446         pass that on to the ImageBitmapRenderingContext constructor.
1447
1448         Unfortunately this meant having to move ImageBitmapRenderingContext::Settings out into
1449         a stand-alone struct, since it needs to be defined in HTMLCanvasElement, which itself
1450         needs to be defined for ImageBitmapRenderingContext.
1451
1452         * DerivedSources.make: Add new IDL.
1453         * WebCore.xcodeproj/project.pbxproj: New files.
1454
1455         * html/HTMLCanvasElement.cpp:
1456         (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
1457         (WebCore::HTMLCanvasElement::getContextBitmapRenderer):
1458
1459             Accept the ImageBitmapRenderingContextSettings object, and pass it on.
1460
1461         * html/HTMLCanvasElement.h:
1462         * html/canvas/ImageBitmapRenderingContext.cpp:
1463         (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
1464         * html/canvas/ImageBitmapRenderingContext.h:
1465         * html/canvas/ImageBitmapRenderingContext.idl:
1466         * html/canvas/ImageBitmapRenderingContextSettings.h: Copied from Source/WebCore/html/canvas/ImageBitmapRenderingContext.idl.
1467         * html/canvas/ImageBitmapRenderingContextSettings.idl: Added.
1468
1469 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1470
1471         Fix up some content filtering feature flags
1472         https://bugs.webkit.org/show_bug.cgi?id=179079
1473
1474         Reviewed by Simon Fraser.
1475
1476         * Configurations/FeatureDefines.xcconfig:
1477
1478 2017-10-31  Chris Dumez  <cdumez@apple.com>
1479
1480         navigator.serviceWorker should always return the same object
1481         https://bugs.webkit.org/show_bug.cgi?id=179067
1482
1483         Reviewed by Youenn Fablet.
1484
1485         navigator.serviceWorker should always return the same object:
1486         - https://www.w3.org/TR/service-workers-1/#navigator-service-worker
1487
1488         Add visitor to make sure we don't gc() the ServiceWorkerContainer wrapper too early.
1489
1490         Test: http/tests/workers/service/navigator-serviceWorker-same-object.html
1491
1492         * Sources.txt:
1493         * WebCore.xcodeproj/project.pbxproj:
1494         * bindings/js/JSNavigatorCustom.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerContainer.idl.
1495         (WebCore::JSNavigator::visitAdditionalChildren):
1496         * page/Navigator.idl:
1497         * workers/service/ServiceWorkerContainer.idl:
1498
1499 2017-10-31  Antoine Quint  <graouts@apple.com>
1500
1501         [Web Animations] Support AnimationEffect parameter in Animation constructor and read-write timeline property
1502         https://bugs.webkit.org/show_bug.cgi?id=179066
1503
1504         Reviewed by Dean Jackson.
1505
1506         We update the Animation constructor signature and behavior to allow for an AnimationEffect as its first,
1507         null by default, parameter and implement the spec behavior where an omitted AnimationTimeline parameter
1508         should default to the document timeline. We also make the timeline property read-write.
1509
1510         Existing tests are rebaselined and amended for this new behavior.
1511
1512         * animation/WebAnimation.cpp:
1513         (WebCore::WebAnimation::create):
1514         (WebCore::WebAnimation::WebAnimation):
1515         (WebCore::WebAnimation::setEffect):
1516         (WebCore::WebAnimation::setTimeline):
1517         * animation/WebAnimation.h:
1518         * animation/WebAnimation.idl:
1519
1520 2017-10-31  Ali Juma  <ajuma@chromium.org>
1521
1522         Layout viewport rect is too wide after window resize
1523         https://bugs.webkit.org/show_bug.cgi?id=175235
1524
1525         Reviewed by Dave Hyatt.
1526
1527         After a window resize, ScrollView::updateScrollbars adds/removes scrollbars and triggers
1528         layout. Each addition or removal triggers another pass, but at most 2 additional passes
1529         are allowed. If a scrollbar is added or removed in the final allowed pass, layout is
1530         left in an inconsistent state wrt the presence of scrollbars.
1531
1532         To avoid unnecessary passes, don't remove both scrollbars when only one needs to be
1533         removed. This saves the extra pass needed to add the scrollbar back.
1534
1535         Test: fast/dom/Window/window-resize-update-scrollbars.html
1536
1537         * platform/ScrollView.cpp:
1538         (WebCore::ScrollView::updateScrollbars):
1539
1540 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1541
1542         [Attachment Support] Implement WKWebView SPI for inserting attachment elements
1543         https://bugs.webkit.org/show_bug.cgi?id=179013
1544         <rdar://problem/35249668>
1545
1546         Reviewed by Tim Horton.
1547
1548         Adds Editor helper methods to insert an attachment element at the current selection.
1549
1550         Test: WKAttachmentTests.AttachmentElementInsertion
1551
1552         * editing/Editor.cpp:
1553         (WebCore::Editor::insertAttachment):
1554         (WebCore::Editor::insertAttachmentFromFile):
1555         * editing/Editor.h:
1556
1557         Add two new helpers for inserting attachment elements, either from a filename or a data blob. This is a wrapper
1558         around Editor::replaceSelectionWithFragment.
1559
1560         * html/HTMLAttachmentElement.cpp:
1561         (WebCore::HTMLAttachmentElement::HTMLAttachmentElement):
1562         (WebCore::HTMLAttachmentElement::create):
1563         * html/HTMLAttachmentElement.h:
1564
1565         Add a unique identifier string to HTMLAttachmentElement. This unique identifier allows the UI process to
1566         reference and indirectly manipulate attachment elements.
1567
1568 2017-10-31  Alex Christensen  <achristensen@webkit.org>
1569
1570         Fix custom header field setting with reloads and asynchronous navigation action policy decisions
1571         https://bugs.webkit.org/show_bug.cgi?id=179064
1572
1573         Reviewed by Tim Horton.
1574
1575         r223909 had two problems:
1576         1. It called addHTTPHeaderField instead of setHTTPHeaderField, so when a page is reloaded the header field
1577         is added to the resource request to be reloaded, which already had the headers added.
1578         2. It only worked in the synchronous decidePolicyForNavigationAction code path, not for asynchronous completion handlers.
1579
1580         These are both fixed, and both cases are covered with new API tests.
1581
1582         * loader/cache/CachedResourceLoader.cpp:
1583         (WebCore::CachedResourceLoader::requestResource):
1584
1585 2017-10-31  Devin Rousso  <webkit@devinrousso.com>
1586
1587         Web Inspector: make ScriptCallStack::maxCallStackSizeToCapture the default value when capturing backtraces
1588         https://bugs.webkit.org/show_bug.cgi?id=179048
1589
1590         Reviewed by Mark Lam.
1591
1592         No change in functionality.
1593
1594         * bindings/js/JSDOMExceptionHandling.cpp:
1595         (WebCore::reportException):
1596         * dom/RejectedPromiseTracker.cpp:
1597         (WebCore::createScriptCallStackFromReason):
1598         * html/canvas/WebGLRenderingContextBase.cpp:
1599         (WebCore::WebGLRenderingContextBase::compileShader):
1600         (WebCore::WebGLRenderingContextBase::printToConsole):
1601         * inspector/InspectorNetworkAgent.cpp:
1602         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
1603         * inspector/PageDebuggerAgent.cpp:
1604         (WebCore::PageDebuggerAgent::breakpointActionLog):
1605         * inspector/WorkerDebuggerAgent.cpp:
1606         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
1607         * page/DOMWindow.cpp:
1608         (WebCore::DOMWindow::postMessage):
1609
1610 2017-10-31  Michael Catanzaro  <mcatanzaro@igalia.com>
1611
1612         [GTK] Build more files under WebCore as unified sources
1613         https://bugs.webkit.org/show_bug.cgi?id=178968
1614
1615         Reviewed by Keith Miller.
1616
1617         * PlatformGTK.cmake:
1618         * PlatformWPE.cmake:
1619         * SourcesGTK.txt: Added.
1620         * SourcesWPE.txt:
1621
1622 2017-10-30  Ryosuke Niwa  <rniwa@webkit.org>
1623
1624         Assert that no script is executed during LayoutPhase::InRenderTreeLayout
1625         https://bugs.webkit.org/show_bug.cgi?id=179046
1626
1627         Reviewed by Antti Koivisto.
1628
1629         Added NoEventDispatchAssertion to LayoutPhase::InRenderTreeLayout.
1630
1631         * page/LayoutContext.cpp:
1632         (WebCore::LayoutContext::layout):
1633
1634 2017-10-31  Devin Rousso  <webkit@devinrousso.com>
1635
1636         Web Inspector: replace Canvas stack iteration with createScriptCallStack
1637         https://bugs.webkit.org/show_bug.cgi?id=178980
1638
1639         Reviewed by Joseph Pecoraro.
1640
1641         No new tests, updated existing tests.
1642
1643         * inspector/InspectorCanvas.cpp:
1644         (WebCore::InspectorCanvas::buildObjectForCanvas):
1645         (WebCore::InspectorCanvas::buildAction):
1646         (WebCore::iterateCallFrames): Deleted.
1647
1648 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1649
1650         [FreeType] Simple and complex paths are not applied consistently
1651         https://bugs.webkit.org/show_bug.cgi?id=177601
1652
1653         Reviewed by Michael Catanzaro.
1654
1655         Due to bug #100050, when rendering text, the complex path is forced in case kerning or shaping is enabled and
1656         only part of the run is going to be rendered. This happens in the GTK+ port when selecting text (except when
1657         selecting the whole run, of course). The text is initially rendered using the simple path as returned by
1658         FontCascade::codePath() and then the selection is rendered using the complex path, overriding what
1659         FontCascade::codePath() returned in that case. This doesn't happen in mac, because the selection is rendered
1660         differently, so FontCascade::drawText always renders the full run (simple path) when selecting text. Selecting
1661         text is the most noticeable inconsistency, but it's not the only one. Similar exceptions are applied when
1662         calculating the text width, or getting the offset of a given position. The rendered text is the simple one, but
1663         the calculations are performed using the complex path, so depending on the kerning and ligatures we might end up
1664         with wrong results. If the text has been rendered using the simple path, the selections and all other
1665         calculations should be performed with the simple path too. This patch moves the condition to force complex text
1666         to FontCascade::codePath(), and only for non Freetype ports. This ensures that all callers to
1667         FontCascade::codePath() will get a consistent result.
1668
1669         * platform/graphics/FontCascade.cpp:
1670         (WebCore::FontCascade::drawText const): Use the mode returned by codePath().
1671         (WebCore::FontCascade::drawEmphasisMarks const): Ditto.
1672         (WebCore::FontCascade::adjustSelectionRectForText const): Use the mode returned by codePath().
1673         (WebCore::FontCascade::offsetForPosition const): Ditto.
1674         (WebCore::FontCascade::codePath const): Force complex text for partial runs for ports not enabling advance text
1675         rendering mode by default.
1676         * platform/graphics/FontCascade.h: Add to and from optional parameters to codePath().
1677
1678 2017-10-30  Chris Dumez  <cdumez@apple.com>
1679
1680         Fire updatefound event after resolving the registration promise
1681         https://bugs.webkit.org/show_bug.cgi?id=178985
1682
1683         Reviewed by Youenn Fablet.
1684
1685         Fake series of events that are supposed to happen after registering a service worker
1686         that notify the page of the service worker's installation and activation.
1687
1688         Also make sure that registration.installing / waiting / active return proper values.
1689         Make sure that serviceWorker.scriptURL returns a proper value.
1690
1691         This unblocks a lot of web-platform-tests since they were blocked shortly after
1692         registration due to missing events or registration.installing being null.
1693
1694         * dom/ScriptExecutionContext.cpp:
1695         (WebCore::ScriptExecutionContext::activeServiceWorker const):
1696         (WebCore::ScriptExecutionContext::setActiveServiceWorker):
1697         * dom/ScriptExecutionContext.h:
1698         * loader/WorkerThreadableLoader.cpp:
1699         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1700         * loader/cache/CachedResourceLoader.cpp:
1701         (WebCore::CachedResourceLoader::prepareFetch):
1702         * workers/WorkerScriptLoader.cpp:
1703         (WebCore::WorkerScriptLoader::loadSynchronously):
1704         (WebCore::WorkerScriptLoader::loadAsynchronously):
1705         * workers/service/ServiceWorker.cpp:
1706         (WebCore::ServiceWorker::ServiceWorker):
1707         (WebCore::ServiceWorker::setState):
1708         * workers/service/ServiceWorker.h:
1709         * workers/service/ServiceWorkerContainer.cpp:
1710         (WebCore::ServiceWorkerContainer::controller const):
1711         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1712         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
1713         * workers/service/ServiceWorkerContainer.h:
1714         * workers/service/ServiceWorkerRegistration.cpp:
1715         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
1716         (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
1717         (WebCore::ServiceWorkerRegistration::installing):
1718         (WebCore::ServiceWorkerRegistration::waiting):
1719         (WebCore::ServiceWorkerRegistration::active):
1720         * workers/service/ServiceWorkerRegistration.h:
1721         * workers/service/ServiceWorkerRegistrationData.cpp:
1722         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
1723         * workers/service/ServiceWorkerRegistrationData.h:
1724         (WebCore::ServiceWorkerRegistrationData::encode const):
1725         (WebCore::ServiceWorkerRegistrationData::decode):
1726         * workers/service/server/SWClientConnection.cpp:
1727         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
1728         * workers/service/server/SWServerRegistration.cpp:
1729         (WebCore::SWServerRegistration::scriptContextStarted):
1730         (WebCore::SWServerRegistration::runRegisterJob):
1731         (WebCore::SWServerRegistration::data const):
1732         * workers/service/server/SWServerRegistration.h:
1733
1734 2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1735
1736         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
1737         https://bugs.webkit.org/show_bug.cgi?id=175118
1738
1739         Reviewed by Alex Christensen.
1740
1741         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
1742
1743         No new tests since there should be no behavioral change.
1744
1745         * dom/make_names.pl:
1746         (printConstructors):
1747         (printNamesHeaderFile):
1748         (printNamesCppFile):
1749         (printDefinitions):
1750         * accessibility/AccessibilityRenderObject.cpp:
1751         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
1752         * css/StyleResolver.cpp:
1753         (WebCore::hasEffectiveDisplayNoneForDisplayContents):
1754         * dom/CustomElementReactionQueue.cpp:
1755         (WebCore::CustomElementReactionQueue::observesStyleAttribute const):
1756         * dom/Document.cpp:
1757         (WebCore::Document::validateCustomElementName):
1758         * dom/Element.cpp:
1759         (WebCore::isStyleAttribute):
1760         (WebCore::canAttachAuthorShadowRoot):
1761         * dom/ElementData.cpp:
1762         (WebCore::ElementData::findLanguageAttribute const):
1763         * domjit/JSDocumentDOMJIT.cpp:
1764         (WebCore::compileDocumentBodyAttribute):
1765         * editing/Editor.cpp:
1766         (WebCore::Editor::applyEditingStyleToBodyElement const):
1767         * editing/EditorCommand.cpp:
1768         (WebCore::valueDefaultParagraphSeparator):
1769         * editing/MarkupAccumulator.cpp:
1770         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
1771         (WebCore::MarkupAccumulator::appendNamespace):
1772         (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
1773         * editing/ReplaceSelectionCommand.cpp:
1774         (WebCore::isProhibitedParagraphChild):
1775         * html/HTMLBodyElement.cpp:
1776         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
1777         * html/HTMLDocument.cpp:
1778         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
1779         * html/HTMLElement.cpp:
1780         (WebCore::HTMLElement::createEventHandlerNameMap):
1781         * html/parser/HTMLConstructionSite.cpp:
1782         (WebCore::HTMLConstructionSite::findFosterSite):
1783         * html/parser/HTMLElementStack.cpp:
1784         (WebCore::HTMLElementStack::hasTemplateInHTMLScope const):
1785         * html/parser/HTMLPreloadScanner.cpp:
1786         (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
1787         * html/parser/HTMLTreeBuilder.cpp:
1788         (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
1789         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
1790         (WebCore::HTMLTreeBuilder::processTemplateEndTag):
1791         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
1792         (WebCore::HTMLTreeBuilder::processStartTag):
1793         (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
1794         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
1795         (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption):
1796         (WebCore::HTMLTreeBuilder::processTableEndTagForInTable):
1797         (WebCore::HTMLTreeBuilder::processEndTag):
1798         (WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
1799         (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
1800         (WebCore::HTMLTreeBuilder::defaultForBeforeHead):
1801         (WebCore::HTMLTreeBuilder::defaultForInHead):
1802         (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
1803         (WebCore::HTMLTreeBuilder::defaultForAfterHead):
1804         * html/parser/TextDocumentParser.cpp:
1805         (WebCore::TextDocumentParser::insertFakePreElement):
1806         * rendering/svg/SVGPathData.cpp:
1807         (WebCore::pathFromGraphicsElement):
1808         * rendering/svg/SVGResources.cpp:
1809         (WebCore::clipperFilterMaskerTags):
1810         (WebCore::markerTags):
1811         (WebCore::fillAndStrokeTags):
1812         (WebCore::chainableResourceTags):
1813         * svg/SVGAnimatedBoolean.h:
1814         * svg/SVGAnimatedEnumeration.h:
1815         * svg/SVGAnimatedInteger.h:
1816         * svg/SVGAnimatedLength.h:
1817         * svg/SVGAnimatedLengthList.h:
1818         * svg/SVGAnimatedNumber.h:
1819         * svg/SVGAnimatedNumberList.h:
1820         * svg/SVGAnimatedPreserveAspectRatio.h:
1821         * svg/SVGAnimatedRect.h:
1822         * svg/SVGAnimatedString.h:
1823         * svg/SVGAnimatedTransformList.h:
1824         * svg/SVGAnimationElement.cpp:
1825         (WebCore::SVGAnimationElement::isSupportedAttribute):
1826         * svg/SVGCursorElement.cpp:
1827         (WebCore::SVGCursorElement::isSupportedAttribute):
1828         * svg/SVGElement.cpp:
1829         (WebCore::createAttributeNameToCSSPropertyIDMap):
1830         (WebCore::SVGElement::childShouldCreateRenderer const):
1831         (WebCore::SVGElement::animatableAttributeForName):
1832         * svg/SVGFilterElement.cpp:
1833         (WebCore::SVGFilterElement::isSupportedAttribute):
1834         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1835         (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute):
1836         * svg/SVGForeignObjectElement.cpp:
1837         (WebCore::SVGForeignObjectElement::isSupportedAttribute):
1838         * svg/SVGGradientElement.cpp:
1839         (WebCore::SVGGradientElement::isSupportedAttribute):
1840         * svg/SVGImageElement.cpp:
1841         (WebCore::SVGImageElement::isSupportedAttribute):
1842         * svg/SVGLineElement.cpp:
1843         (WebCore::SVGLineElement::isSupportedAttribute):
1844         * svg/SVGMarkerElement.cpp:
1845         (WebCore::SVGMarkerElement::isSupportedAttribute):
1846         * svg/SVGMaskElement.cpp:
1847         (WebCore::SVGMaskElement::isSupportedAttribute):
1848         * svg/SVGPathElement.cpp:
1849         (WebCore::SVGPathElement::dPropertyInfo):
1850         (WebCore::SVGPathElement::isSupportedAttribute):
1851         * svg/SVGPatternElement.cpp:
1852         (WebCore::SVGPatternElement::isSupportedAttribute):
1853         * svg/SVGPolyElement.cpp:
1854         (WebCore::SVGPolyElement::pointsPropertyInfo):
1855         * svg/SVGRadialGradientElement.cpp:
1856         (WebCore::SVGRadialGradientElement::isSupportedAttribute):
1857         * svg/SVGTextContentElement.cpp:
1858         (WebCore::SVGTextContentElement::textLengthPropertyInfo):
1859         (WebCore::SVGTextContentElement::isSupportedAttribute):
1860         * svg/SVGTextPathElement.cpp:
1861         (WebCore::SVGTextPathElement::isSupportedAttribute):
1862         * svg/SVGUseElement.cpp:
1863         (WebCore::createAllowedElementSet):
1864         * xml/NativeXPathNSResolver.cpp:
1865         (WebCore::NativeXPathNSResolver::lookupNamespaceURI):
1866         * xml/parser/XMLDocumentParser.cpp:
1867         (WebCore::XMLDocumentParser::parseDocumentFragment):
1868
1869 2017-10-30  Jer Noble  <jer.noble@apple.com>
1870
1871         [WebGL] Optimization to skip painting if texture and source surface hasn't changed isn't working; re-optimize.
1872         https://bugs.webkit.org/show_bug.cgi?id=178953
1873
1874         Reviewed by Dean Jackson.
1875
1876         The "seed" value of the current bound texture never matches the last saved value in
1877         VideoTextureCopierCV::copyImageToPlatformTexture(). The value is modified by the function
1878         itself, so a fresh value needs to be re-queried after the image's surface is attached to the
1879         texture.
1880
1881         Once this fix is in, however, the <canvas> being painted will flash when no new image is
1882         available. This is because the wrong texture target is being restored by the GC3DStateSaver
1883         at the end of copyImageToPlatformTexture(). While we're fixing that, we may as well use the
1884         texture state saved by the GraphicsContext3D itself to restore the correct texture unit,
1885         texture target, and texture.
1886
1887         * platform/graphics/GraphicsContext3D.h:
1888         (WebCore::GraphicsContext3D::activeTextureUnit const):
1889         (WebCore::GraphicsContext3D::currentBoundTexture const):
1890         (WebCore::GraphicsContext3D::currentBoundTarget const):
1891         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture const):
1892         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture const):
1893         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTarget const):
1894         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget const):
1895         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture): Deleted.
1896         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture): Deleted.
1897         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget): Deleted.
1898         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1899         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
1900         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
1901         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
1902         * platform/graphics/cv/VideoTextureCopierCV.h:
1903         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1904         (WebCore::GraphicsContext3D::prepareTexture):
1905         (WebCore::GraphicsContext3D::activeTexture):
1906         (WebCore::GraphicsContext3D::bindTexture):
1907
1908 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1909
1910         WKBundlePageWillSendSubmitEventCallback is called with incorrect frame parameter
1911         https://bugs.webkit.org/show_bug.cgi?id=176719
1912
1913         Reviewed by Chris Dumez.
1914
1915         WKBundlePageWillSendSubmitEventCallback is clearly intended to parallel
1916         WKBundlePageWillSubmitFormCallback, since almost all the parameters are the same. Now, in
1917         WKBundlePageWillSubmitFormCallback, the first WKBundleFrameRef, "frame", is the frame of the
1918         form target, and the second WKBundleFrameRef, sourceFrame, is the frame containing the form.
1919         That's correct. But in WKBundlePageWillSendSubmitEventCallback, both frame and sourceFrame
1920         are always identical. The problem is that the FrameLoaderClient delegate is called on the
1921         wrong FrameLoaderClient. It should be called on the FrameLoaderClient of the target frame,
1922         but HTMLFormElement calls it on the FrameLoaderClient of the source frame instead.
1923
1924         Fix this by factoring the target frame computation out of FormSubmission into some helpers.
1925
1926         * html/HTMLFormElement.cpp:
1927         (WebCore::HTMLFormElement::prepareForSubmission):
1928         (WebCore::HTMLFormElement::effectiveTarget const):
1929         (WebCore::HTMLFormElement::findSubmitButton const):
1930         * html/HTMLFormElement.h:
1931         * loader/FormSubmission.cpp:
1932         (WebCore::FormSubmission::create):
1933
1934 2017-10-30  Alex Christensen  <achristensen@webkit.org>
1935
1936         ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
1937         https://bugs.webkit.org/show_bug.cgi?id=178861
1938
1939         Reviewed by Tim Horton.
1940
1941         This is a dark corner of the URL spec that has wildly different behavior in different browsers.
1942         The assertion fired when we have a file URL with a ? or a # after file:// and it was because
1943         m_pathAfterLastSlash was still 0. We definitely shouldn't assert. I'm making us consistent with
1944         other cases where we have nothing there and add an implied missing slash.
1945         
1946         Covered by new API tests.
1947
1948         * platform/URLParser.cpp:
1949         (WebCore::URLParser::parse):
1950
1951 2017-10-27  Megan Gardner  <megan_gardner@apple.com>
1952
1953         Correctly determine affinity when inserting text via Keyboard Suggestions
1954         https://bugs.webkit.org/show_bug.cgi?id=178969
1955
1956         Reviewed by Ryosuke Niwa.
1957
1958         There has been talk about renaming these enums, but in the meantime we should at least have a comment 
1959         clarifying what they actually mean.
1960
1961         No new tests only adding a comment, no tests needed.
1962
1963         * editing/TextAffinity.h:
1964
1965 2017-10-27  Ryosuke Niwa  <rniwa@webkit.org>
1966
1967         Crash in addChildNodesToDeletionQueue
1968         https://bugs.webkit.org/show_bug.cgi?id=178974
1969         <rdar://problem/35234372>
1970
1971         Reviewed by Brent Fulgham.
1972
1973         The bug was caused by HTMLConstructionSite::insertTextNode constructing an ill-formed tree
1974         when fostering parent under a template element by adjusting HTMLConstructionSiteTask's parent
1975         without clearing nextChild. Fixed the crash by simply removing this code since executeTask
1976         already takes care of fostering the parent in static inline insert(HTMLConstructionSiteTask&).
1977
1978         Test: fast/parser/foster-parent-under-template.html
1979
1980         * html/parser/HTMLConstructionSite.cpp:
1981         (WebCore::HTMLConstructionSite::insertTextNode):
1982
1983 2017-10-30  Commit Queue  <commit-queue@webkit.org>
1984
1985         Unreviewed, rolling out r224078.
1986         https://bugs.webkit.org/show_bug.cgi?id=179026
1987
1988         MotionMark regression (Requested by shallawa on #webkit).
1989
1990         Reverted changeset:
1991
1992         "When navigating back to a page, compositing layers may not
1993         use accelerated drawing"
1994         https://bugs.webkit.org/show_bug.cgi?id=178749
1995         https://trac.webkit.org/changeset/224078
1996
1997 2017-10-30  Dean Jackson  <dino@apple.com>
1998
1999         Implement "bitmaprenderer" CanvasRenderingContext
2000         https://bugs.webkit.org/show_bug.cgi?id=178992
2001         <rdar://problem/34147157>
2002
2003         Reviewed by Sam Weinig.
2004
2005         Implement the "bitmaprenderer" context for HTMLCanvasElement.
2006         Use as much of the existing 2d context code as possible, which
2007         means that we are painting the ImageBitmap into the backing
2008         store. This isn't optimal, but it is good enough to get
2009         going while we move buffer ownership from the canvas object
2010         into the rendering contexts.
2011
2012         This patch raised a few issues on the HTML specification:
2013         https://github.com/whatwg/html/issues/3164
2014         https://github.com/whatwg/html/issues/3165
2015         https://github.com/whatwg/html/issues/3166
2016         https://github.com/whatwg/html/issues/3167
2017
2018         Update existing Web Platform Test results.
2019
2020         * html/HTMLCanvasElement.cpp:
2021         (WebCore::HTMLCanvasElement::createContext2d): Drive-by comment fix.
2022         (WebCore::HTMLCanvasElement::createContextWebGL): Ditto.
2023         (WebCore::HTMLCanvasElement::createContextWebGPU): Ditto.
2024         (WebCore::HTMLCanvasElement::createContextBitmapRenderer): We now require
2025         a layer/backing store for a bitmap context.
2026         (WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer const): Add bitmap-renderer
2027         to the type of context that uses the canvas's backing store.
2028         (WebCore::HTMLCanvasElement::createImageBuffer const): Comment fix.
2029         (WebCore::HTMLCanvasElement::setImageBuffer const): Change parameter to a &&.
2030         (WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty): New function to set
2031         the backing store efficiently, as well as make it look like we need to repaint
2032         the entire canvas.
2033         (WebCore::HTMLCanvasElement::drawingContext const): The buffer doesn't actually
2034         need to provide a GraphicsContext if we're a bitmap renderer.
2035         * html/HTMLCanvasElement.h:
2036
2037         * html/ImageBitmap.cpp:
2038         (WebCore::ImageBitmap::transferOwnershipAndClose): New helper to give the ownership
2039         of the ImageBuffer away, and look like close() was called.
2040         * html/ImageBitmap.h:
2041
2042         * html/canvas/ImageBitmapRenderingContext.cpp: Implement the algorithm from the HTML
2043         specification.
2044         (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
2045         (WebCore::ImageBitmapRenderingContext::isAccelerated const):
2046         (WebCore::ImageBitmapRenderingContext::setOutputBitmap):
2047         (WebCore::ImageBitmapRenderingContext::transferFromImageBitmap):
2048         * html/canvas/ImageBitmapRenderingContext.h:
2049         * html/canvas/ImageBitmapRenderingContext.idl:
2050
2051 2017-10-30  Simon Fraser  <simon.fraser@apple.com>
2052
2053         tab-size: 0px asserts
2054         https://bugs.webkit.org/show_bug.cgi?id=176198
2055
2056         Reviewed by Antti Koivisto.
2057
2058         Don't claim to support tab-size values with units. We don't, and they would become 0, rather
2059         than fall back to the default as should happen.
2060
2061         Enhanced fast/css/tab-size.html to test.
2062
2063         * css/parser/CSSPropertyParser.cpp:
2064         (WebCore::consumeTabSize):
2065
2066 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2067
2068         [WPE] Fix build warnings
2069         https://bugs.webkit.org/show_bug.cgi?id=178899
2070
2071         Reviewed by Carlos Alberto Lopez Perez.
2072
2073         These are actually mostly cross-platform issues.
2074
2075         * html/canvas/WebGL2RenderingContext.cpp:
2076         (WebCore::arrayBufferViewElementSize):
2077         * platform/Cairo.cmake:
2078         * platform/Curl.cmake:
2079         * platform/FreeType.cmake:
2080         * platform/GCrypt.cmake:
2081         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2082         (WebCore::TextureMapperShaderProgram::create):
2083         * platform/network/soup/SoupNetworkSession.cpp:
2084         (WebCore::SoupNetworkSession::SoupNetworkSession):
2085
2086 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2087
2088         [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
2089         https://bugs.webkit.org/show_bug.cgi?id=178964
2090
2091         Reviewed by Carlos Alberto Lopez Perez.
2092
2093         This also gets rid of the WebCorePlatformWPE build target to simplify the build. It links to
2094         all the same libraries as the WebCore target, so it doesn't seem to have any purpose. Bye.
2095
2096         Some CMake files under platform are not unified, either because there is not much to gain
2097         (e.g. ImageDecoders, where everything is in a separate directory), or because it is complex
2098         (e.g. GStreamer, where GObject implementations would be tricky to build unified), and
2099         because we're limited to using only features declared in WebKitFeatures.cmake inside the
2100         unified sources lists, which makes some of the platform files a bit tricky (notably,
2101         anything that needs to go into WebCorePlatformGTK for the GTK port). So it's not perfect.
2102
2103         * PlatformWPE.cmake:
2104         * SourcesWPE.txt: Added.
2105         * crypto/gcrypt/GCryptUtilities.h:
2106         * platform/Cairo.cmake:
2107         * platform/GCrypt.cmake:
2108         * platform/SourcesCairo.txt: Added.
2109         * platform/SourcesGCrypt.txt: Added.
2110         * platform/SourcesGLib.txt: Added.
2111         * platform/SourcesSoup.txt: Added.
2112
2113 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2114
2115         Remove more unused ENABLE(GAMEPAD_DEPRECATED) code
2116         https://bugs.webkit.org/show_bug.cgi?id=178364
2117
2118         Reviewed by Carlos Alberto Lopez Perez.
2119
2120         * Modules/gamepad/deprecated/Gamepad.cpp: Removed.
2121         * Modules/gamepad/deprecated/Gamepad.h: Removed.
2122         * Modules/gamepad/deprecated/Gamepad.idl: Removed.
2123         * Modules/gamepad/deprecated/GamepadList.cpp: Removed.
2124         * Modules/gamepad/deprecated/GamepadList.h: Removed.
2125         * Modules/gamepad/deprecated/GamepadList.idl: Removed.
2126         * Modules/gamepad/deprecated/NavigatorGamepad.cpp: Removed.
2127         * Modules/gamepad/deprecated/NavigatorGamepad.h: Removed.
2128         * Modules/gamepad/deprecated/NavigatorGamepad.idl: Removed.
2129
2130 2017-10-30  Daniel Bates  <dabates@apple.com>
2131
2132         Use if conditional function in DerivedSources.make to reduce duplication
2133         https://bugs.webkit.org/show_bug.cgi?id=178989
2134
2135         Reviewed by Darin Adler.
2136
2137         In DerivedSources.make we currently duplicate most of the Makefile recipe for generating HTML/SVG
2138         tags and attributes to support passing the optional command line option --extraDefines when one
2139         or more HTML/SVG compile-time features are enabled. Instead we can make use of a Makefile
2140         conditional function in the recipe itself to avoid code duplication.
2141
2142         * DerivedSources.make:
2143
2144 2017-10-30  Antoine Quint  <graouts@apple.com>
2145
2146         [Web Animations] Expose the playbackRate property on Animation
2147         https://bugs.webkit.org/show_bug.cgi?id=178931
2148
2149         Reviewed by Sam Weinig.
2150
2151         Account for the playback rate when computing and setting an animation's
2152         current time, ensuring that we adjust the start time to preserve the
2153         current time when setting a new playback rate.
2154
2155         Test: http/wpt/wk-web-animations/timing-model/animation-playback-rate.html
2156
2157         * animation/WebAnimation.cpp:
2158         (WebCore::WebAnimation::WebAnimation):
2159         (WebCore::WebAnimation::currentTime const):
2160         (WebCore::WebAnimation::setCurrentTime):
2161         (WebCore::WebAnimation::setPlaybackRate):
2162         * animation/WebAnimation.h:
2163         * animation/WebAnimation.idl:
2164
2165 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2166
2167         [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
2168         https://bugs.webkit.org/show_bug.cgi?id=168219
2169
2170         Reviewed by Ryosuke Niwa.
2171
2172         Make Editor::canUndo and Editor::canRedo const.
2173
2174         Also, remove unused allowsCopy from HitTestResult.
2175
2176         * editing/Editor.cpp:
2177         (WebCore::Editor::canUndo const):
2178         (WebCore::Editor::canRedo const):
2179         (WebCore::Editor::canUndo): Deleted.
2180         (WebCore::Editor::canRedo): Deleted.
2181         * editing/Editor.h:
2182         * rendering/HitTestResult.cpp:
2183         (WebCore::HitTestResult::allowsCopy const): Deleted.
2184         * rendering/HitTestResult.h:
2185         * rendering/SelectionRangeData.cpp:
2186
2187 2017-10-27  Antti Koivisto  <antti@apple.com>
2188
2189         Destroy all unneeded anonymous wrappers in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers()
2190         https://bugs.webkit.org/show_bug.cgi?id=178933
2191
2192         Reviewed by Zalan Bujtas.
2193
2194         Currently it just cleans up table related wrappers.
2195
2196         * rendering/RenderObject.cpp:
2197         (WebCore::findDestroyRootIncludingAnonymous):
2198
2199         Continuations are left as future work.
2200
2201 2017-10-30  Zalan Bujtas  <zalan@apple.com>
2202
2203         Remove reference to RenderTreeInternalMutationScope
2204         https://bugs.webkit.org/show_bug.cgi?id=178998
2205         <rdar://problem/35246464>
2206
2207         Reviewed by Antti Koivisto.
2208
2209         We don't have such class anymore.
2210
2211         No change in functionality.
2212
2213         * rendering/RenderView.h:
2214
2215 2017-10-30  Zan Dobersek  <zdobersek@igalia.com>
2216
2217         [GCrypt] Add support for P-521 EC curves
2218         https://bugs.webkit.org/show_bug.cgi?id=175199
2219
2220         Reviewed by Jiewen Tan.
2221
2222         Add support for 521-bit elliptic curves in the libgcrypt-based
2223         implementation of WebCrypto API.
2224
2225         In the CryptoAlgorithmECDH implementation, the bit-size of the key is now
2226         rounded up to the next byte boundary and passed to the helper
2227         gcryptDerive() function. There the size in bytes is used to zero-pad the
2228         derived key data. This is done to properly handle derivation results for
2229         the P-521 curves, where the leading zero bit could get clipped, resulting
2230         in a derived key that is only 65 byes in length when it is expected to be
2231         66 bytes. Further cleanups are done in gcryptDerive() to use the mpiData()
2232         function where possible.
2233
2234         In the CryptoAlgorithmECDSA implementation, the bit-size of the key is
2235         again rounded up to the nearest byte boundary before being passed to the
2236         helper gcryptSign() and gcryptVerify() functions. This again properly
2237         enforces the requirement of 66 bytes to handle P-521 elliptic curves.
2238
2239         In the CryptoKeyEC implementation, NamedCurve::P521 cases in helper
2240         functions operating on NamedCurve values are now implemented to return
2241         appropriate values. platformSupportedCurve() now returns true for the
2242         NamedCurve::P521 value. Zero-padding of the private key data is used
2243         wherever it is necessary to avoid clipping any leading zero bit in the
2244         P-521 EC key.
2245
2246         No new tests -- affected tests have their baselines updated.
2247
2248         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
2249         (WebCore::gcryptDerive):
2250         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
2251         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
2252         (WebCore::CryptoAlgorithmECDSA::platformSign):
2253         (WebCore::CryptoAlgorithmECDSA::platformVerify):
2254         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2255         (WebCore::curveName):
2256         (WebCore::curveIdentifier):
2257         (WebCore::curveSize):
2258         (WebCore::curveUncompressedFieldElementSize):
2259         (WebCore::CryptoKeyEC::platformSupportedCurve):
2260         (WebCore::curveForIdentifier):
2261         (WebCore::CryptoKeyEC::platformImportPkcs8):
2262         (WebCore::CryptoKeyEC::platformAddFieldElements const):
2263         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
2264
2265 2017-10-29  Fujii Hironori  <Hironori.Fujii@sony.com>
2266
2267         Use of uninitialized value $targetIdlFile in hash element at preprocess-idls.pl line 165.
2268         https://bugs.webkit.org/show_bug.cgi?id=177743
2269
2270         Reviewed by Darin Adler.
2271
2272         GamepadWebVR.idl supplements Gamepad.idl. But, Gamepad.idl is not
2273         processed because ENABLE_GAMEPAD is OFF.
2274
2275         No new tests since there should be no behavioral change.
2276
2277         * CMakeLists.txt: Include GamepadWebVR.idl only if ENABLE_GAMEPAD.
2278         * Sources.txt: Ditto.
2279         * bindings/scripts/preprocess-idls.pl: Die if a supplemented IDL file is not found.
2280
2281 2017-10-29  Sam Weinig  <sam@webkit.org>
2282
2283         [Conic Gradients] Add support for parsing conic gradients
2284         https://bugs.webkit.org/show_bug.cgi?id=178987
2285
2286         Reviewed by Dean Jackson.
2287
2288         Adds initial support, disabled by default, for parsing conic gradients as per
2289         CSS 4 Images - https://www.w3.org/TR/css-images-4/#conic-gradients.
2290
2291         Test: fast/gradients/conic-gradient-parsing.html
2292
2293         * css/CSSGradientValue.cpp:
2294         (WebCore::clone):
2295         (WebCore::CSSGradientValue::isCacheable const):
2296         (WebCore::CSSConicGradientValue::customCSSText const):
2297         (WebCore::CSSConicGradientValue::createGradient):
2298         (WebCore::CSSConicGradientValue::equals const):
2299         * css/CSSGradientValue.h:
2300         
2301             Add CSSConicGradientValue as a subclass of CSSGradientValue and implement
2302             customCSSText() and equals(). Stub out createGradient() as painting is not
2303             yet implemented.
2304         
2305         * css/CSSImageGeneratorValue.cpp:
2306         (WebCore::CSSImageGeneratorValue::image):
2307         (WebCore::CSSImageGeneratorValue::isFixedSize const):
2308         (WebCore::CSSImageGeneratorValue::fixedSize):
2309         (WebCore::CSSImageGeneratorValue::isPending const):
2310         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
2311         (WebCore::CSSImageGeneratorValue::loadSubimages):
2312         * css/CSSValue.cpp:
2313         (WebCore::CSSValue::equals const):
2314         (WebCore::CSSValue::cssText const):
2315         (WebCore::CSSValue::destroy):
2316         
2317             Dispatch to CSSConicGradientValue as needed.
2318         
2319         * css/CSSValue.h:
2320         (WebCore::CSSValue::isImageGeneratorValue const):
2321         (WebCore::CSSValue::isGradientValue const):
2322         (WebCore::CSSValue::isConicGradientValue const):
2323         
2324             Add conic gradient predicate support and update isImageGeneratorValue and 
2325             isGradientValue to include conic gradient.
2326         
2327         * css/CSSValueKeywords.in:
2328         
2329             Add conic-gradient and repeating-conic-gradient.
2330         
2331         * css/parser/CSSParser.cpp:
2332         (WebCore::CSSParserContext::CSSParserContext):
2333         (WebCore::operator==):
2334         * css/parser/CSSParserMode.h:
2335         (WebCore::CSSParserContextHash::hash):
2336         
2337             Add runtime flags to enable conic gradients.
2338         
2339         * css/parser/CSSPropertyParserHelpers.cpp:
2340         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
2341         
2342             Helper, similar to consumeLengthOrPercent, for consumeGradientColorStops. 
2343             Corresponds to https://drafts.csswg.org/css-values-4/#typedef-angle-percentage
2344         
2345         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2346         
2347             Convert to take CSSGradientValue by reference.
2348         
2349         (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):
2350         
2351             Helper, similar to consumeGradientColorStops, but for angular color stops
2352             used in conic gradients. Corresponds to https://www.w3.org/TR/css-images-4/#typedef-angular-color-stop-list
2353             but does not yet support double position syntax.
2354         
2355         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
2356         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
2357         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
2358         
2359             Pass CSSGradientValue by reference.
2360         
2361         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
2362         
2363             Parse conic gradient.
2364         
2365         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
2366         
2367             Dispatch to consumeConicGradient for repeating and non-repeating
2368             conic gradients.
2369         
2370         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
2371         
2372             Put each value on its own line to make it more readable and add CSSValueConicGradient
2373             and CSSValueRepeatingConicGradient.
2374         
2375         * page/Settings.yaml:
2376         
2377             Add a setting to enable conic gradients. Disabled by default.
2378
2379         * features.json:
2380         
2381             Move conic gradients to "In Development".
2382
2383 2017-10-29  Antoine Quint  <graouts@apple.com>
2384
2385         [Web Animations] Expose the currentTime property on Animation
2386         https://bugs.webkit.org/show_bug.cgi?id=178988
2387
2388         Unreviewed.
2389
2390         Style fixes missed in previous patch.
2391
2392         * animation/WebAnimation.cpp:
2393         (WebCore::WebAnimation::setCurrentTime):
2394
2395 2017-10-29  Antoine Quint  <graouts@apple.com>
2396
2397         [Web Animations] Expose the currentTime property on Animation
2398         https://bugs.webkit.org/show_bug.cgi?id=178988
2399
2400         Reviewed by Dean Jackson.
2401
2402         We now expose the currentTime property on Animation objects, our first
2403         step in implementing the Web Animations timing model, specifically section
2404         3.5.4. "The current time of an animation" and section 3.5.5. "Setting the
2405         current time of an animation". Setting the startTime has implications on
2406         currentTime and vice-versa.
2407
2408         Test: webanimations/animation-current-time.html
2409
2410         * animation/WebAnimation.cpp:
2411         (WebCore::WebAnimation::setBindingsStartTime):
2412         (WebCore::WebAnimation::startTime const):
2413         (WebCore::WebAnimation::setStartTime):
2414         (WebCore::WebAnimation::bindingsCurrentTime const):
2415         (WebCore::WebAnimation::setBindingsCurrentTime):
2416         (WebCore::WebAnimation::currentTime const):
2417         (WebCore::WebAnimation::setCurrentTime):
2418         * animation/WebAnimation.h:
2419         * animation/WebAnimation.idl:
2420
2421 2017-10-29  Ryosuke Niwa  <rniwa@webkit.org>
2422
2423         Assert that no script is executed during style recalc
2424         https://bugs.webkit.org/show_bug.cgi?id=178845
2425         <rdar://problem/35106129>
2426
2427         Reviewed by Antti Koivisto.
2428
2429         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
2430         to make sure we don't start mutating DOM in the middle of a style update.
2431
2432         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
2433         shadow tree since that happens while updating the style.
2434
2435         No new tests since there should be no behavioral change.
2436
2437         * dom/Document.cpp:
2438         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
2439         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
2440         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
2441         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
2442         scripts which in turn trigger another (recursive) style recalc.
2443         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
2444         NoEventDispatchAssertion.
2445         * dom/Element.cpp:
2446         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
2447         newly cloned element for SVG use element's shadow tree.
2448         (WebCore::Element::cloneElementWithoutChildren): Ditto.
2449         * dom/EventDispatcher.cpp:
2450         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
2451         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
2452         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
2453         pushing or popoing the stack frame.
2454         * svg/SVGUseElement.cpp:
2455         (WebCore::SVGUseElement::clearShadowTree):
2456         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
2457         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
2458         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
2459         (WebCore::SVGUseElement::cloneTarget const): Ditto.
2460         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
2461         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
2462         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
2463
2464 2017-10-28  Dean Jackson  <dino@apple.com>
2465
2466         createImageBitmap with HTMLCanvasElement
2467         https://bugs.webkit.org/show_bug.cgi?id=178984
2468         <rdar://problem/35238440>
2469
2470         Reviewed by Sam Weinig.
2471
2472         Implement createImageBitmap(HTMLCanvasElement).
2473
2474         While here, explicitly reject the promises for the
2475         methods we haven't yet implemented. I was hoping this
2476         would avoid a lengthy timeout in one of the imported
2477         WPT tests but, alas, it doesn't. However, it's still
2478         a good idea.
2479
2480         Extend internal WPT proposals to cover canvas creation.
2481
2482         * html/ImageBitmap.cpp:
2483         (WebCore::ImageBitmap::createPromise): Get the image from
2484         the canvas and draw it into a new ImageBitmap buffer.
2485
2486 2017-10-28  Myles C. Maxfield  <mmaxfield@apple.com>
2487
2488         [iOS] Unify Font::platformCharWidthInit() with macOS
2489         https://bugs.webkit.org/show_bug.cgi?id=178951
2490         <rdar://problem/7848198>
2491
2492         Reviewed by Zalan Bujtas.
2493
2494         The only reason these codepaths are different is because historically this codepath
2495         didn't work with GS fonts (which we don't use anymore).
2496
2497         Tests: fast/forms/search-styled.html
2498                fast/forms/text-control-intrinsic-widths.html
2499                fast/forms/textarea-width.html
2500
2501         * platform/graphics/cocoa/FontCocoa.mm:
2502         (WebCore::Font::platformCharWidthInit):
2503
2504 2017-10-28  Chris Dumez  <cdumez@apple.com>
2505
2506         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
2507         https://bugs.webkit.org/show_bug.cgi?id=178976
2508
2509         Reviewed by Sam Weinig.
2510
2511         Test: http/tests/workers/service/ServiceWorkerGlobalScope-properties.html
2512
2513         * workers/service/ExtendableEvent.idl:
2514         * workers/service/FetchEvent.idl:
2515         Drop [Exposed=Worker] as there is already [Exposed=ServiceWorker] and
2516         ServiceWorkerGlobalScope inherits from WorkerGlobalScope. This is redundant
2517         and we would hit assertions and adding the global constructors at runtime
2518         when the feature is enabled, because the property already exists.
2519
2520 2017-10-28  Zalan Bujtas  <zalan@apple.com>
2521
2522         [FrameView::layout cleanup] Move core layout logic to a separate class.
2523         https://bugs.webkit.org/show_bug.cgi?id=178771
2524         <rdar://problem/35166542>
2525
2526         Reviewed by Simon Fraser.
2527
2528         Move layout code out from FrameView to LayoutContext.
2529
2530         LayoutContext holds all the layout related logic (scheduling, needsLayout, handling layout states),
2531         while scrolling, view sizing methods stay in FrameView.
2532         Having a dedicated LayoutContext allows to structure the code better.   
2533
2534         Covered by existing tests.
2535
2536         * Sources.txt:
2537         * WebCore.xcodeproj/project.pbxproj:
2538         * accessibility/AXObjectCache.cpp:
2539         (WebCore::rendererNeedsDeferredUpdate):
2540         * accessibility/AccessibilityObject.cpp:
2541         (WebCore::AccessibilityObject::updateBackingStore):
2542         * accessibility/AccessibilityRenderObject.cpp:
2543         (WebCore::AccessibilityRenderObject::textUnderElement const):
2544         (WebCore::AccessibilityRenderObject::layoutCount const):
2545         * dom/Document.cpp:
2546         (WebCore::Document::setVisualUpdatesAllowed):
2547         (WebCore::Document::resolveStyle):
2548         (WebCore::Document::updateStyleIfNeeded):
2549         (WebCore::Document::updateLayout):
2550         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2551         (WebCore::Document::implicitClose):
2552         (WebCore::Document::isLayoutTimerActive):
2553         * dom/Element.cpp:
2554         (WebCore::Element::absoluteEventHandlerBounds):
2555         * editing/FrameSelection.cpp:
2556         (WebCore::FrameSelection::setSelection):
2557         * html/HTMLEmbedElement.cpp:
2558         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
2559         * html/HTMLFormControlElement.cpp:
2560         (WebCore::HTMLFormControlElement::didAttachRenderers):
2561         * inspector/InspectorOverlay.cpp:
2562         (WebCore::InspectorOverlay::update):
2563         * loader/FrameLoader.cpp:
2564         (WebCore::FrameLoader::stopForUserCancel):
2565         * page/Frame.cpp:
2566         (WebCore::Frame::setView):
2567         (WebCore::Frame::clearTimers):
2568         (WebCore::Frame::setPageAndTextZoomFactors):
2569         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
2570         * page/FrameView.cpp:
2571         (WebCore::FrameView::FrameView):
2572         (WebCore::FrameView::~FrameView):
2573         (WebCore::FrameView::reset):
2574         (WebCore::FrameView::resetScrollbars):
2575         (WebCore::FrameView::didFirstLayout const):
2576         (WebCore::FrameView::willDestroyRenderTree):
2577         (WebCore::FrameView::didDestroyRenderTree):
2578         (WebCore::FrameView::setContentsSize):
2579         (WebCore::FrameView::calculateScrollbarModesForLayout):
2580         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
2581         (WebCore::FrameView::topContentInsetDidChange):
2582         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
2583         (WebCore::FrameView::adjustScrollbarsForLayout):
2584         (WebCore::FrameView::willDoLayout): This takes care of the view related task right before entering render tree layout.
2585         (WebCore::FrameView::didLayout): post layout tasks.
2586         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
2587         (WebCore::FrameView::updateLayoutViewport):
2588         (WebCore::FrameView::maintainScrollPositionAtAnchor):
2589         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
2590         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
2591         (WebCore::FrameView::availableContentSizeChanged):
2592         (WebCore::FrameView::updateContentsSize):
2593         (WebCore::FrameView::needsLayout const):
2594         (WebCore::FrameView::setNeedsLayout):
2595         (WebCore::FrameView::scheduleSelectionUpdate):
2596         (WebCore::FrameView::updateEmbeddedObjects):
2597         (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
2598         (WebCore::FrameView::flushPostLayoutTasksQueue):
2599         (WebCore::FrameView::performPostLayoutTasks):
2600         (WebCore::FrameView::sendResizeEventIfNeeded):
2601         (WebCore::FrameView::autoSizeIfEnabled):
2602         (WebCore::FrameView::paintControlTints):
2603         (WebCore::FrameView::paintContents):
2604         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2605         (WebCore::FrameView::enableAutoSizeMode):
2606         (WebCore::FrameView::forceLayout):
2607         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
2608         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
2609         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
2610         (): Deleted.
2611         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker): Deleted.
2612         (WebCore::applyTextSizingIfNeeded): Deleted.
2613         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
2614         (WebCore::FrameView::updateStyleForLayout): Deleted.
2615         (WebCore::FrameView::canPerformLayout const): Deleted.
2616         (WebCore::FrameView::layout): Deleted.
2617         (WebCore::FrameView::runOrSchedulePostLayoutTasks): Deleted.
2618         (WebCore::FrameView::convertSubtreeLayoutToFullLayout): Deleted.
2619         (WebCore::FrameView::layoutTimerFired): Deleted.
2620         (WebCore::FrameView::scheduleRelayout): Deleted.
2621         (WebCore::isObjectAncestorContainerOf): Deleted.
2622         (WebCore::FrameView::scheduleRelayoutOfSubtree): Deleted.
2623         (WebCore::FrameView::layoutPending const): Deleted.
2624         (WebCore::FrameView::unscheduleRelayout): Deleted.
2625         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted.
2626         * page/FrameView.h:
2627         * page/LayoutContext.cpp: Added.
2628         (WebCore::isObjectAncestorContainerOf):
2629         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
2630         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
2631         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
2632         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
2633         (WebCore::LayoutScope::LayoutScope):
2634         (WebCore::LayoutScope::~LayoutScope):
2635         (WebCore::LayoutContext::LayoutContext):
2636         (WebCore::LayoutContext::layout):
2637         (WebCore::LayoutContext::runOrScheduleAsynchronousTasks):
2638         (WebCore::LayoutContext::runAsynchronousTasks):
2639         (WebCore::LayoutContext::flushAsynchronousTasks):
2640         (WebCore::LayoutContext::reset):
2641         (WebCore::LayoutContext::needsLayout const):
2642         (WebCore::LayoutContext::setNeedsLayout):
2643         (WebCore::LayoutContext::enableSetNeedsLayout):
2644         (WebCore::LayoutContext::disableSetNeedsLayout):
2645         (WebCore::LayoutContext::scheduleLayout):
2646         (WebCore::LayoutContext::unscheduleLayout):
2647         (WebCore::LayoutContext::scheduleSubtreeLayout):
2648         (WebCore::LayoutContext::layoutTimerFired):
2649         (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout):
2650         (WebCore::LayoutContext::setSubtreeLayoutRoot):
2651         (WebCore::LayoutContext::canPerformLayout const):
2652         (WebCore::LayoutContext::applyTextSizingIfNeeded):
2653         (WebCore::LayoutContext::updateStyleForLayout):
2654         (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
2655         (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded):
2656         (WebCore::LayoutContext::frame const):
2657         (WebCore::LayoutContext::view const):
2658         (WebCore::LayoutContext::renderView const):
2659         (WebCore::LayoutContext::document const):
2660         * page/LayoutContext.h: Added.
2661         (WebCore::LayoutContext::startDisallowingLayout):
2662         (WebCore::LayoutContext::endDisallowingLayout):
2663         (WebCore::LayoutContext::layoutPhase const):
2664         (WebCore::LayoutContext::isLayoutNested const):
2665         (WebCore::LayoutContext::layoutCount const):
2666         (WebCore::LayoutContext::isLayoutPending const):
2667         (WebCore::LayoutContext::isInLayout const):
2668         (WebCore::LayoutContext::isInRenderTreeLayout const):
2669         (WebCore::LayoutContext::inPaintableState const):
2670         (WebCore::LayoutContext::subtreeLayoutRoot const):
2671         (WebCore::LayoutContext::clearSubtreeLayoutRoot):
2672         (WebCore::LayoutContext::resetFirstLayoutFlag):
2673         (WebCore::LayoutContext::didFirstLayout const):
2674         (WebCore::LayoutContext::setNeedsFullRepaint):
2675         (WebCore::LayoutContext::needsFullRepaint const):
2676         (WebCore::LayoutContext::layoutDisallowed const):
2677         (WebCore::LayoutContext::isLayoutSchedulingEnabled const):
2678         (WebCore::LayoutContext::inAsynchronousTasks const):
2679         * page/Page.cpp:
2680         (WebCore::Page::setPageScaleFactor):
2681         * rendering/RenderBlock.cpp:
2682         (WebCore::RenderBlock::insertPositionedObject):
2683         * rendering/RenderBox.cpp:
2684         (WebCore::RenderBox::imageChanged):
2685         (WebCore::RenderBox::computeLogicalWidthInFragment const):
2686         * rendering/RenderElement.cpp:
2687         (WebCore::RenderElement::clearSubtreeLayoutRootIfNeeded const):
2688         (WebCore::RenderElement::checkForRepaintDuringLayout const):
2689         * rendering/RenderFrameBase.cpp:
2690         (WebCore::RenderFrameBase::performLayoutWithFlattening):
2691         * rendering/RenderLayer.cpp:
2692         (WebCore::RenderLayer::scrollTo):
2693         * rendering/RenderObject.cpp:
2694         (WebCore::scheduleRelayoutForSubtree):
2695         * rendering/RenderTreeAsText.cpp:
2696         (WebCore::write):
2697         * rendering/RenderVideo.cpp:
2698         (WebCore::RenderVideo::updatePlayer):
2699         * rendering/RenderView.h:
2700         * rendering/RenderWidget.cpp:
2701         (WebCore::RenderWidget::updateWidgetPosition):
2702         * svg/graphics/SVGImage.cpp:
2703         (WebCore::SVGImage::draw):
2704         * testing/Internals.cpp:
2705         (WebCore::Internals::layoutCount const):
2706         
2707 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
2708
2709         Cleanup PageDebuggable
2710         https://bugs.webkit.org/show_bug.cgi?id=178972
2711
2712         Reviewed by Sam Weinig.
2713
2714         * page/PageDebuggable.cpp:
2715         (WebCore::PageDebuggable::PageDebuggable):
2716         * page/PageDebuggable.h:
2717
2718 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
2719
2720         Extract a WorkerDebuggerProxy interface out of WorkerReportingProxy
2721         https://bugs.webkit.org/show_bug.cgi?id=178975
2722
2723         Reviewed by Sam Weinig.
2724
2725         No new tests, just refactoring.
2726
2727         * workers/WorkerDebuggerProxy.h:
2728         * workers/WorkerReportingProxy.h:
2729         * WebCore.xcodeproj/project.pbxproj:
2730         Extract a method from WorkerReportingProxy to WorkerDebuggerProxy and
2731         rename it to be more general.
2732
2733         * inspector/WorkerToPageFrontendChannel.h:
2734         (WebCore::WorkerToPageFrontendChannel::sendMessageToFrontend):
2735         * workers/DedicatedWorkerThread.cpp:
2736         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2737         * workers/DedicatedWorkerThread.h:
2738         * workers/WorkerMessagingProxy.cpp:
2739         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2740         (WebCore::WorkerMessagingProxy::postMessageToDebugger):
2741         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
2742         * workers/WorkerMessagingProxy.h:
2743         * workers/WorkerThread.cpp:
2744         (WebCore::WorkerThread::WorkerThread):
2745         * workers/WorkerThread.h:
2746         (WebCore::WorkerThread::workerDebuggerProxy const):
2747         * workers/service/context/ServiceWorkerThread.cpp:
2748         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2749         * workers/service/context/ServiceWorkerThread.h:
2750         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2751         (WebCore::ServiceWorkerThreadProxy::create):
2752         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
2753         Include a WorkerDebuggerProxy alongside the other proxies.
2754         Use the renamed debugger proxy method.
2755
2756 2017-10-28  Ryosuke Niwa  <rniwa@webkit.org>
2757
2758         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
2759         https://bugs.webkit.org/show_bug.cgi?id=178715
2760         <rdar://problem/35144665>
2761
2762         Reviewed by Brent Fulgham.
2763
2764         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
2765         instead of in the middle of collecting a list of stylesheets.
2766
2767         * dom/Document.cpp:
2768         (WebCore::Document::Document): Initialize the newly added timer.
2769         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
2770         handlers may be expecting to see the document after XSLT had been applied.
2771         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
2772         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
2773         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
2774         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
2775         (WebCore::Document::applyXSLTransform): Deleted.
2776         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
2777         inline XSLT and it happens much earlier than implicitClose.
2778         (WebCore::Document::suspendScheduledTasks): Suspend the XSLT timer.
2779         (WebCore::Document::resumeScheduledTasks): Reschedule the XSLT timer if m_hasPendingXSLTransforms is set.
2780         * dom/Document.h:
2781         * dom/ProcessingInstruction.cpp:
2782         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
2783         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
2784         function can be called from a non-script-resilient call stack.
2785         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
2786         * style/StyleScope.cpp:
2787         (WebCore::Style::Scope::collectXSLTransforms): Added.
2788         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
2789         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
2790         * style/StyleScope.h:
2791         * xml/parser/XMLDocumentParserLibxml2.cpp:
2792         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
2793
2794 2017-10-27  Devin Rousso  <webkit@devinrousso.com>
2795
2796         Web Inspector: Canvas Tab: no way to see backtrace of where a canvas context was created
2797         https://bugs.webkit.org/show_bug.cgi?id=178799
2798         <rdar://problem/35175805>
2799
2800         Reviewed by Brian Burg.
2801
2802         No new tests, updated existing tests.
2803
2804         * inspector/InspectorCanvas.h:
2805         * inspector/InspectorCanvas.cpp:
2806         (iterateCallFrames):
2807         (WebCore::InspectorCanvas::buildObjectForCanvas):
2808         (WebCore::InspectorCanvas::buildAction):
2809
2810         * inspector/InspectorCanvasAgent.cpp:
2811         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
2812         If the Canvas agent is enabled, generate a backtrace and send it to the frontend with the canvas.
2813         We do not do this for canvases created before the agent is enabled for performance reasons.
2814
2815 2017-10-27  Keith Miller  <keith_miller@apple.com>
2816
2817         Add unified source list files and build scripts to Xcode project navigator
2818         https://bugs.webkit.org/show_bug.cgi?id=178959
2819
2820         Reviewed by Andy Estes.
2821
2822         * WebCore.xcodeproj/project.pbxproj:
2823
2824 2017-10-27  Daniel Bates  <dabates@apple.com>
2825
2826         Only allow non-mixed content protected subresources to ask for credentials
2827         https://bugs.webkit.org/show_bug.cgi?id=178919
2828         <rdar://problem/35015245>
2829
2830         Reviewed by Alex Christensen.
2831
2832         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
2833         to allow protected mixed-content subresources to ask for credentials.
2834
2835         Tests: http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html
2836                http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html
2837                http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html
2838                http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html
2839                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html
2840                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html
2841
2842         * loader/ResourceLoader.cpp:
2843         (WebCore::ResourceLoader::ResourceLoader): Initialize m_canAskClientForCredentials based on the
2844         specified resource loader options.
2845         (WebCore::ResourceLoader::init): Update m_canAskClientForCredentials based on the URL of the initial
2846         request.
2847         (WebCore::ResourceLoader::isMixedContent const): Helper function to check if the specified URL
2848         represents a mixed content resource.
2849         (WebCore::ResourceLoader::willSendRequestInternal): If the original request or the redirect request
2850         is mixed content then update state such that we will disallow asking for credentials.
2851         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified to use m_canAskClientForCredentials
2852         when determining whether the request is allowed to ask for credentials.
2853         * loader/ResourceLoader.h:
2854
2855 2017-10-27  Chris Dumez  <cdumez@apple.com>
2856
2857         Unskip more Service Workers tests
2858         https://bugs.webkit.org/show_bug.cgi?id=178944
2859
2860         Reviewed by Sam Weinig.
2861
2862         Drop bad assertion that was causing the Service Worker WebProcess to crash and causing
2863         tests to fail as a result.
2864
2865         * workers/service/ServiceWorkerGlobalScope.cpp:
2866         (WebCore::ServiceWorkerGlobalScope::registration):
2867         * workers/service/ServiceWorkerGlobalScope.h:
2868
2869 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
2870
2871         Unreviewed, rolling out r224011.
2872
2873         xsl LayoutTests hit an assertion added with this change since
2874         r223999 was rolled out.
2875
2876         Reverted changeset:
2877
2878         "Assert that no script is executed during style recalc"
2879         https://bugs.webkit.org/show_bug.cgi?id=178845
2880         https://trac.webkit.org/changeset/224011
2881
2882 2017-10-27  Antoine Quint  <graouts@apple.com>
2883
2884         [Web Animations] Expose the currentTime property on AnimationTimeline
2885         https://bugs.webkit.org/show_bug.cgi?id=178928
2886
2887         Reviewed by Dean Jackson.
2888
2889         We add the currentTime property on AnimationTimeline and add an internals method
2890         to set it in a test which will allow us to validate the timing model state for
2891         a given time.
2892
2893         Test: webanimations/timeline-current-time.html
2894
2895         * animation/AnimationTimeline.cpp:
2896         (WebCore::AnimationTimeline::bindingsCurrentTime const):
2897         (WebCore::AnimationTimeline::setCurrentTime):
2898         * animation/AnimationTimeline.h:
2899         (WebCore::AnimationTimeline::currentTime const):
2900         * animation/AnimationTimeline.idl:
2901         * testing/Internals.cpp:
2902         (WebCore::Internals::setTimelineCurrentTime):
2903         * testing/Internals.h:
2904         * testing/Internals.idl:
2905
2906 2017-10-27  Antoine Quint  <graouts@apple.com>
2907
2908         [Web Animations] Use Seconds vs. MonotonicTime to represent times
2909         https://bugs.webkit.org/show_bug.cgi?id=178950
2910
2911         Reviewed by Dean Jackson.
2912
2913         Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
2914         originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
2915         sense to use Seconds to represent them as opposed to a MonotonicTime.
2916
2917         * animation/WebAnimation.cpp:
2918         (WebCore::WebAnimation::bindingsStartTime const):
2919         (WebCore::WebAnimation::setBindingsStartTime):
2920         * animation/WebAnimation.h:
2921
2922 2017-10-27  Chris Dumez  <cdumez@apple.com>
2923
2924         DOMWindow::dispatchEvent() does not reset the event's dispatch flag
2925         https://bugs.webkit.org/show_bug.cgi?id=178897
2926
2927         Reviewed by Darin Adler.
2928
2929         Make sure we reset the currentTarget, dispatch flag, phase and propagation flags
2930         after dispatching an event on a Window, as per:
2931         - https://dom.spec.whatwg.org/#concept-event-dispatch
2932
2933         This behavior is consistent with Firefox.
2934
2935         Test: fast/events/window-load-initEvent.html
2936
2937         * page/DOMWindow.cpp:
2938         (WebCore::DOMWindow::dispatchEvent):
2939
2940 2017-10-27  Keith Miller  <keith_miller@apple.com>
2941
2942         Move iOS specific sources to unified sources
2943         https://bugs.webkit.org/show_bug.cgi?id=178915
2944
2945         Rubber-stamped by Tim Horton.
2946
2947         * SourcesCocoa.txt:
2948         * SourcesIOS.txt:
2949         * SourcesMac.txt:
2950         * WebCore.xcodeproj/project.pbxproj:
2951
2952 2017-10-27  Eric Carlson  <eric.carlson@apple.com>
2953
2954         NowPlayingInfo should contain a unique identifier
2955         https://bugs.webkit.org/show_bug.cgi?id=178872
2956         <rdar://problem/34924012>
2957
2958         Unreviewed, build fix.
2959
2960         * platform/audio/ios/MediaSessionManagerIOS.mm:
2961         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Call string.impl().hash() instead of
2962         string.existingHash() because the later will assert in a debug build if the hash hasn't
2963         been calculated yet.
2964         * platform/audio/mac/MediaSessionManagerMac.mm:
2965         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto.
2966
2967 2017-10-27  Alex Christensen  <achristensen@webkit.org>
2968
2969         Fix accessibility/mac/aria-label-on-label-element.html after r224074
2970         https://bugs.webkit.org/show_bug.cgi?id=178892
2971
2972         * accessibility/AccessibilityNodeObject.cpp:
2973         (WebCore::AccessibilityNodeObject::titleElementText const):
2974         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
2975         * accessibility/AccessibilityObject.h:
2976         (WebCore::AccessibilityText::AccessibilityText):
2977         Turns out my null checks changed behavior.  This undoes them.
2978
2979 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
2980
2981         Unreviewed, rolling out r223999.
2982
2983         Caused xsl LayoutTest flakiness.
2984
2985         Reverted changeset:
2986
2987         "Style::Scope::flushPendingUpdate() can replace the entire
2988         document in XSLTProcessor::createDocumentFromSource"
2989         https://bugs.webkit.org/show_bug.cgi?id=178715
2990         https://trac.webkit.org/changeset/223999
2991
2992 2017-10-27  Chris Dumez  <cdumez@apple.com>
2993
2994         Audit init*Event() method to make sure they reset internal data members
2995         https://bugs.webkit.org/show_bug.cgi?id=178886
2996
2997         Reviewed by Ryosuke Niwa.
2998
2999         Audit init*Event() method to make sure they reset internal data members.
3000
3001         * dom/Event.cpp:
3002         (WebCore::Event::initEvent):
3003         * dom/KeyboardEvent.cpp:
3004         (WebCore::KeyboardEvent::initKeyboardEvent):
3005         * dom/MessageEvent.cpp:
3006         (WebCore::MessageEvent::initMessageEvent):
3007         * dom/MouseEvent.cpp:
3008         (WebCore::MouseEvent::initMouseEvent):
3009         * dom/MouseRelatedEvent.h:
3010         (WebCore::MouseRelatedEvent::setIsSimulated):
3011         * dom/TextEvent.cpp:
3012         (WebCore::TextEvent::initTextEvent):
3013         * dom/WheelEvent.cpp:
3014         (WebCore::WheelEvent::initWheelEvent):
3015
3016 2017-10-27  Chris Dumez  <cdumez@apple.com>
3017
3018         Add initial support for serviceWorkerClient.postMessage()
3019         https://bugs.webkit.org/show_bug.cgi?id=178794
3020
3021         Reviewed by Youenn Fablet.
3022
3023         Add initial support for serviceWorkerClient.postMessage():
3024         - https://w3c.github.io/ServiceWorker/#client-postmessage
3025
3026         It is now possible to do bi-directional communication with a service worker
3027         via postMessage().
3028
3029         No new tests, updated existing test.
3030
3031         * WebCore.xcodeproj/project.pbxproj:
3032         * dom/Document.cpp:
3033         (WebCore::generateDocumentIdentifier):
3034         (WebCore::Document::allDocumentsMap):
3035         (WebCore::Document::allDocuments):
3036         (WebCore::m_identifier):
3037         (WebCore::Document::~Document):
3038         * dom/Document.h:
3039         (WebCore::Document::identifier const):
3040         * dom/ScriptExecutionContext.cpp:
3041         (WebCore::ScriptExecutionContext::serviceWorkerContainer):
3042         * dom/ScriptExecutionContext.h:
3043         * workers/service/ServiceWorker.cpp:
3044         (WebCore::ServiceWorker::postMessage):
3045         * workers/service/ServiceWorkerClient.cpp:
3046         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
3047         (WebCore::ServiceWorkerClient::~ServiceWorkerClient):
3048         (WebCore::ServiceWorkerClient::id const):
3049         (WebCore::ServiceWorkerClient::postMessage):
3050         * workers/service/ServiceWorkerClient.h:
3051         (WebCore::ServiceWorkerClient::create):
3052         * workers/service/ServiceWorkerClient.idl:
3053         * workers/service/ServiceWorkerClientIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
3054         (WebCore::ServiceWorkerClientIdentifier::toString const):
3055         * workers/service/ServiceWorkerRegistration.cpp:
3056         (WebCore::ServiceWorkerRegistration::unregister):
3057         * workers/service/ServiceWorkerWindowClient.cpp:
3058         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
3059         * workers/service/ServiceWorkerWindowClient.h:
3060         * workers/service/context/SWContextManager.cpp:
3061         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
3062         * workers/service/context/SWContextManager.h:
3063         * workers/service/context/ServiceWorkerThread.cpp:
3064         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
3065         * workers/service/context/ServiceWorkerThread.h:
3066         * workers/service/server/SWClientConnection.cpp:
3067         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
3068         * workers/service/server/SWClientConnection.h:
3069
3070 2017-10-27  Frederic Wang  <fwang@igalia.com>
3071
3072         Use auto for some variables in RenderLayerCompositor/Backing
3073         https://bugs.webkit.org/show_bug.cgi?id=178570
3074
3075         Reviewed by Darin Adler.
3076
3077         No new tests, behavior unchanged.
3078
3079         * rendering/RenderLayerBacking.cpp:
3080         (WebCore::canvasCompositingStrategy):
3081         (WebCore::RenderLayerBacking::RenderLayerBacking):
3082         (WebCore::computePageTiledBackingCoverage):
3083         (WebCore::RenderLayerBacking::layerWillBeDestroyed):
3084         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
3085         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
3086         (WebCore::RenderLayerBacking::updateCompositedBounds):
3087         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
3088         (WebCore::RenderLayerBacking::updateAfterLayout):
3089         (WebCore::RenderLayerBacking::updateConfiguration):
3090         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
3091         (WebCore::RenderLayerBacking::updateGeometry):
3092         (WebCore::RenderLayerBacking::updateInternalHierarchy):
3093         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
3094         (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const):
3095         (WebCore::RenderLayerBacking::compositingOpacity const):
3096         (WebCore::isRestartedPlugin):
3097         (WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
3098         (WebCore::RenderLayerBacking::updateImageContents):
3099         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
3100         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
3101         (WebCore::RenderLayerBacking::getCurrentTransform const):
3102         (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
3103         (WebCore::RenderLayerBacking::startAnimation):
3104         (WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const):
3105         * rendering/RenderLayerCompositor.cpp:
3106         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3107         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):
3108         (WebCore::updateScrollingLayerWithClient):
3109         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
3110         (WebCore::RenderLayerCompositor::didPaintBacking):
3111         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
3112         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const):
3113         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3114         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
3115         (WebCore::RenderLayerCompositor::logLayerInfo):
3116         (WebCore::checkIfDescendantClippingContextNeedsUpdate):
3117         (WebCore::styleChangeRequiresLayerRebuild):
3118         (WebCore::RenderLayerCompositor::canCompositeClipPath):
3119         (WebCore::rendererForCompositingTests):
3120         (WebCore::RenderLayerCompositor::updateBacking):
3121         (WebCore::RenderLayerCompositor::repaintOnCompositingChange):
3122         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
3123         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
3124         (WebCore::RenderLayerCompositor::setCompositingParent):
3125         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
3126         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling const):
3127         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
3128         (WebCore::RenderLayerCompositor::positionForClipLayer const):
3129         (WebCore::RenderLayerCompositor::frameViewDidLayout):
3130         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
3131         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
3132         (WebCore::RenderLayerCompositor::frameContentsCompositor):
3133         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
3134         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
3135         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
3136         (WebCore::RenderLayerCompositor::setIsInWindow):
3137         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
3138         (WebCore::RenderLayerCompositor::clippedByAncestor const):
3139         (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
3140         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
3141         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
3142         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
3143         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
3144         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
3145         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
3146         (WebCore::RenderLayerCompositor::requiresScrollLayer const):
3147         (WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const):
3148         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const):
3149         (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
3150         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
3151         (WebCore::RenderLayerCompositor::documentUsesTiledBacking const):
3152         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
3153         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3154         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3155         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3156         (WebCore::RenderLayerCompositor::ensureRootLayer):
3157         (WebCore::RenderLayerCompositor::destroyRootLayer):
3158         (WebCore::RenderLayerCompositor::attachRootLayer):
3159         (WebCore::RenderLayerCompositor::detachRootLayer):
3160         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
3161         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
3162         (WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):
3163         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints const):
3164         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
3165         (WebCore::enclosingScrollingNodeID):
3166         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
3167         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
3168         (WebCore::RenderLayerCompositor::attachScrollingNode):
3169         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3170         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
3171         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3172         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
3173         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
3174         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
3175         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView):
3176
3177 2017-10-27  Alicia Boya García  <aboya@igalia.com>
3178
3179         [GStreamer][MSE] Trim space between codecs
3180         https://bugs.webkit.org/show_bug.cgi?id=178160
3181
3182         Reviewed by Xabier Rodriguez-Calvar.
3183
3184         Modify supportsCodecs() to accept a Vector<String> instead of
3185         receiving a string and parsing itself.
3186
3187         This improves passrate for `mediasource-is-type-supported` as it
3188         ensures that whitespace between codecs is now trimmed and codec
3189         strings such as `video/webm;codecs="opus, vp9"` are matched as a valid
3190         type, as required by the spec.
3191
3192         This patch also renames supportCodecs() to supportAllCodecs() and adds
3193         a new variant, supportCodec(), that checks for support of an
3194         individual codec.
3195
3196         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3197         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
3198         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3199         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec):
3200         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs):
3201         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
3202         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
3203
3204 2017-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3205
3206         [GTK] Crash in WebCore::SelectionRangeData::apply
3207         https://bugs.webkit.org/show_bug.cgi?id=177808
3208
3209         Reviewed by Carlos Garcia Campos.
3210
3211         The problem appears to be a name collision between WebCore::SelectionData and
3212         WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
3213         Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
3214         Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
3215         poor linker for not being magic?
3216
3217         This fixes crashes in approximately one bajillion tests.
3218
3219         * rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.
3220
3221 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3222
3223         [WinCairo] Fix build after WebCore moves to unified source.
3224         https://bugs.webkit.org/show_bug.cgi?id=178920
3225
3226         Added empty implementations to fix link error.
3227
3228         Reviewed by Ryosuke Niwa.
3229
3230         * platform/network/curl/DNSCurl.cpp:
3231         (WebCore::DNSResolveQueue::updateIsUsingProxy):
3232         (WebCore::DNSResolveQueue::platformResolve):
3233
3234 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
3235
3236         Implement seek tolerance methods in WebAVPlayerController.
3237         https://bugs.webkit.org/show_bug.cgi?id=178838
3238         rdar://problem/33781777
3239
3240         Reviewed by Eric Carlson.
3241
3242         No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.
3243
3244         * html/HTMLMediaElement.cpp:
3245         (WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
3246         * html/HTMLMediaElement.h:
3247         * platform/cocoa/PlaybackSessionModel.h:
3248         * platform/cocoa/PlaybackSessionModelMediaElement.h:
3249         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
3250         (WebCore::PlaybackSessionModelMediaElement::seekToTime):
3251         * platform/ios/WebAVPlayerController.mm:
3252         (-[WebAVPlayerController seekToTime:]):
3253         (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
3254         (-[WebAVPlayerController seekByTimeInterval:]):
3255         (-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
3256         (-[WebAVPlayerController seekToBeginning:]):
3257         (-[WebAVPlayerController seekToEnd:]):
3258         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3259         (VideoFullscreenControllerContext::seekToTime):
3260
3261 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
3262
3263         Unreviewed, fix WPE build after r224074
3264         https://bugs.webkit.org/show_bug.cgi?id=178892
3265
3266         * accessibility/wpe/AccessibilityObjectWPE.cpp:
3267         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3268
3269 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
3270
3271         When navigating back to a page, compositing layers may not use accelerated drawing
3272         https://bugs.webkit.org/show_bug.cgi?id=178749
3273         rdar://problem/35158946
3274
3275         Reviewed by Dean Jackson.
3276
3277         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
3278         occurred on back navigation, related to the ordering of style recalcs and layout.
3279
3280         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
3281         its cacheAcceleratedCompositingFlags(), so any layers created during style update
3282         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
3283         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
3284
3285         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
3286         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
3287         the TileController.
3288
3289         Test: compositing/accelerated-layers-after-back.html
3290
3291         * page/FrameView.cpp:
3292         (WebCore::FrameView::updateCompositingLayersAfterLayout):
3293         * platform/graphics/ca/GraphicsLayerCA.cpp:
3294         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3295         * rendering/RenderLayerCompositor.cpp:
3296         (WebCore::RenderLayerCompositor::willRecalcStyle):
3297         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
3298         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3299         * rendering/RenderLayerCompositor.h:
3300
3301 2017-10-26  Alex Christensen  <achristensen@webkit.org>
3302
3303         Fix Windows build
3304         https://bugs.webkit.org/show_bug.cgi?id=178892
3305
3306         * accessibility/win/AccessibilityObjectWin.cpp:
3307         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3308
3309 2017-10-26  Alex Christensen  <achristensen@webkit.org>
3310
3311         Modernize AccessibilityObject.h
3312         https://bugs.webkit.org/show_bug.cgi?id=178892
3313
3314         Reviewed by Tim Horton.
3315
3316         The enums in AccessibilityObject.h are causing naming collisions with unified builds.
3317         This is what enum classes are for.
3318         HashMaps of enum classes still need a few casts to/from int.
3319         
3320         I also made some RefPtr's Ref's, use some initializer lists instead of values in the constructor implementation, and indentation fixing.
3321         
3322         No change in behavior.
3323
3324         * accessibility/AXObjectCache.cpp:
3325         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
3326         (WebCore::AXObjectCache::~AXObjectCache):
3327         (WebCore::AXObjectCache::getOrCreate):
3328         (WebCore::AXObjectCache::remove):
3329         (WebCore::AXObjectCache::notificationPostTimerFired):
3330         * accessibility/AXObjectCache.h:
3331         (WebCore::AXComputedObjectAttributeCache::CachedAXObjectAttributes::CachedAXObjectAttributes):
3332         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
3333         * accessibility/AccessibilityARIAGrid.cpp:
3334         (WebCore::AccessibilityARIAGrid::addChildren):
3335         * accessibility/AccessibilityARIAGridCell.cpp:
3336         (WebCore::AccessibilityARIAGridCell::parentRowGroup const):
3337         * accessibility/AccessibilityARIAGridRow.cpp:
3338         (WebCore::AccessibilityARIAGridRow::headerObject):
3339         * accessibility/AccessibilityAttachment.cpp:
3340         (WebCore::AccessibilityAttachment::accessibilityText):
3341         * accessibility/AccessibilityAttachment.h:
3342         * accessibility/AccessibilityImageMapLink.cpp:
3343         (WebCore::AccessibilityImageMapLink::roleValue const):
3344         (WebCore::AccessibilityImageMapLink::accessibilityText):
3345         * accessibility/AccessibilityLabel.cpp:
3346         (WebCore::childrenContainOnlyStaticText):
3347         * accessibility/AccessibilityLabel.h:
3348         * accessibility/AccessibilityList.cpp:
3349         (WebCore::AccessibilityList::isUnorderedList const):
3350         (WebCore::AccessibilityList::isOrderedList const):
3351         (WebCore::AccessibilityList::determineAccessibilityRole):
3352         (WebCore::AccessibilityList::roleValue const):
3353         * accessibility/AccessibilityListBox.cpp:
3354         (WebCore::AccessibilityListBox::setSelectedChildren):
3355         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const):
3356         * accessibility/AccessibilityListBox.h:
3357         * accessibility/AccessibilityListBoxOption.h:
3358         * accessibility/AccessibilityMathMLElement.cpp:
3359         (WebCore::AccessibilityMathMLElement::determineAccessibilityRole):
3360         (WebCore::AccessibilityMathMLElement::isMathScriptObject const):
3361         (WebCore::AccessibilityMathMLElement::isMathMultiscriptObject const):
3362         * accessibility/AccessibilityMediaControls.cpp:
3363         (WebCore::AccessibilityMediaControl::accessibilityText):
3364         (WebCore::AccessibilityMediaControl::roleValue const):
3365         * accessibility/AccessibilityMediaControls.h:
3366         * accessibility/AccessibilityMenuList.cpp:
3367         (WebCore::AccessibilityMenuList::addChildren):
3368         * accessibility/AccessibilityMenuList.h:
3369         * accessibility/AccessibilityMenuListOption.h:
3370         * accessibility/AccessibilityMenuListPopup.cpp:
3371         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const):
3372         * accessibility/AccessibilityMenuListPopup.h:
3373         * accessibility/AccessibilityNodeObject.cpp:
3374         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
3375         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
3376         (WebCore::AccessibilityNodeObject::canHaveChildren const):
3377         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
3378         (WebCore::AccessibilityNodeObject::isSearchField const):
3379         (WebCore::AccessibilityNodeObject::isImage const):
3380         (WebCore::AccessibilityNodeObject::isPasswordField const):
3381         (WebCore::AccessibilityNodeObject::isInputImage const):
3382         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
3383         (WebCore::AccessibilityNodeObject::isSlider const):
3384         (WebCore::AccessibilityNodeObject::isMenuRelated const):
3385         (WebCore::AccessibilityNodeObject::isMenu const):
3386         (WebCore::AccessibilityNodeObject::isMenuBar const):
3387         (WebCore::AccessibilityNodeObject::isMenuButton const):
3388         (WebCore::AccessibilityNodeObject::isMenuItem const):
3389         (WebCore::AccessibilityNodeObject::isEnabled const):
3390         (WebCore::AccessibilityNodeObject::isChecked const):
3391         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute const):
3392         (WebCore::AccessibilityNodeObject::headingLevel const):
3393         (WebCore::AccessibilityNodeObject::isHeading const):
3394         (WebCore::AccessibilityNodeObject::isLink const):
3395         (WebCore::AccessibilityNodeObject::isGroup const):
3396         (WebCore::AccessibilityNodeObject::selectedRadioButton):
3397         (WebCore::AccessibilityNodeObject::checkboxOrRadioValue const):
3398         (WebCore::AccessibilityNodeObject::actionElement const):
3399         (WebCore::AccessibilityNodeObject::alterSliderValue):
3400         (WebCore::AccessibilityNodeObject::isGenericFocusableElement const):
3401         (WebCore::AccessibilityNodeObject::menuElementForMenuButton const):
3402         (WebCore::AccessibilityNodeObject::menuItemElementForMenu const):
3403         (WebCore::AccessibilityNodeObject::titleElementText const):
3404         (WebCore::AccessibilityNodeObject::alternativeText const):
3405         (WebCore::AccessibilityNodeObject::visibleText const):
3406         (WebCore::AccessibilityNodeObject::helpText const):
3407         (WebCore::AccessibilityNodeObject::accessibilityText):
3408         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
3409         (WebCore::AccessibilityNodeObject::accessibilityDescription const):
3410         (WebCore::AccessibilityNodeObject::roleIgnoresTitle const):
3411         (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
3412         (WebCore::AccessibilityNodeObject::title const):
3413         (WebCore::AccessibilityNodeObject::text const):
3414         (WebCore::AccessibilityNodeObject::stringValue const):
3415         (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
3416         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const):
3417         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
3418         * accessibility/AccessibilityNodeObject.h:
3419         * accessibility/AccessibilityObject.cpp:
3420         (WebCore::AccessibilityObject::detach):
3421         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
3422         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):