[Conic Gradients] Add support for parsing conic gradients
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-29  Sam Weinig  <sam@webkit.org>
2
3         [Conic Gradients] Add support for parsing conic gradients
4         https://bugs.webkit.org/show_bug.cgi?id=178987
5
6         Reviewed by Dean Jackson.
7
8         Adds initial support, disabled by default, for parsing conic gradients as per
9         CSS 4 Images - https://www.w3.org/TR/css-images-4/#conic-gradients.
10
11         Test: fast/gradients/conic-gradient-parsing.html
12
13         * css/CSSGradientValue.cpp:
14         (WebCore::clone):
15         (WebCore::CSSGradientValue::isCacheable const):
16         (WebCore::CSSConicGradientValue::customCSSText const):
17         (WebCore::CSSConicGradientValue::createGradient):
18         (WebCore::CSSConicGradientValue::equals const):
19         * css/CSSGradientValue.h:
20         
21             Add CSSConicGradientValue as a subclass of CSSGradientValue and implement
22             customCSSText() and equals(). Stub out createGradient() as painting is not
23             yet implemented.
24         
25         * css/CSSImageGeneratorValue.cpp:
26         (WebCore::CSSImageGeneratorValue::image):
27         (WebCore::CSSImageGeneratorValue::isFixedSize const):
28         (WebCore::CSSImageGeneratorValue::fixedSize):
29         (WebCore::CSSImageGeneratorValue::isPending const):
30         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
31         (WebCore::CSSImageGeneratorValue::loadSubimages):
32         * css/CSSValue.cpp:
33         (WebCore::CSSValue::equals const):
34         (WebCore::CSSValue::cssText const):
35         (WebCore::CSSValue::destroy):
36         
37             Dispatch to CSSConicGradientValue as needed.
38         
39         * css/CSSValue.h:
40         (WebCore::CSSValue::isImageGeneratorValue const):
41         (WebCore::CSSValue::isGradientValue const):
42         (WebCore::CSSValue::isConicGradientValue const):
43         
44             Add conic gradient predicate support and update isImageGeneratorValue and 
45             isGradientValue to include conic gradient.
46         
47         * css/CSSValueKeywords.in:
48         
49             Add conic-gradient and repeating-conic-gradient.
50         
51         * css/parser/CSSParser.cpp:
52         (WebCore::CSSParserContext::CSSParserContext):
53         (WebCore::operator==):
54         * css/parser/CSSParserMode.h:
55         (WebCore::CSSParserContextHash::hash):
56         
57             Add runtime flags to enable conic gradients.
58         
59         * css/parser/CSSPropertyParserHelpers.cpp:
60         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
61         
62             Helper, similar to consumeLengthOrPercent, for consumeGradientColorStops. 
63             Corresponds to https://drafts.csswg.org/css-values-4/#typedef-angle-percentage
64         
65         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
66         
67             Convert to take CSSGradientValue by reference.
68         
69         (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):
70         
71             Helper, similar to consumeGradientColorStops, but for angular color stops
72             used in conic gradients. Corresponds to https://www.w3.org/TR/css-images-4/#typedef-angular-color-stop-list
73             but does not yet support double position syntax.
74         
75         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
76         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
77         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
78         
79             Pass CSSGradientValue by reference.
80         
81         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
82         
83             Parse conic gradient.
84         
85         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
86         
87             Dispatch to consumeConicGradient for repeating and non-repeating
88             conic gradients.
89         
90         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
91         
92             Put each value on its own line to make it more readable and add CSSValueConicGradient
93             and CSSValueRepeatingConicGradient.
94         
95         * page/Settings.yaml:
96         
97             Add a setting to enable conic gradients. Disabled by default.
98
99         * features.json:
100         
101             Move conic gradients to "In Development".
102
103 2017-10-29  Antoine Quint  <graouts@apple.com>
104
105         [Web Animations] Expose the currentTime property on Animation
106         https://bugs.webkit.org/show_bug.cgi?id=178988
107
108         Unreviewed.
109
110         Style fixes missed in previous patch.
111
112         * animation/WebAnimation.cpp:
113         (WebCore::WebAnimation::setCurrentTime):
114
115 2017-10-29  Antoine Quint  <graouts@apple.com>
116
117         [Web Animations] Expose the currentTime property on Animation
118         https://bugs.webkit.org/show_bug.cgi?id=178988
119
120         Reviewed by Dean Jackson.
121
122         We now expose the currentTime property on Animation objects, our first
123         step in implementing the Web Animations timing model, specifically section
124         3.5.4. "The current time of an animation" and section 3.5.5. "Setting the
125         current time of an animation". Setting the startTime has implications on
126         currentTime and vice-versa.
127
128         Test: webanimations/animation-current-time.html
129
130         * animation/WebAnimation.cpp:
131         (WebCore::WebAnimation::setBindingsStartTime):
132         (WebCore::WebAnimation::startTime const):
133         (WebCore::WebAnimation::setStartTime):
134         (WebCore::WebAnimation::bindingsCurrentTime const):
135         (WebCore::WebAnimation::setBindingsCurrentTime):
136         (WebCore::WebAnimation::currentTime const):
137         (WebCore::WebAnimation::setCurrentTime):
138         * animation/WebAnimation.h:
139         * animation/WebAnimation.idl:
140
141 2017-10-29  Ryosuke Niwa  <rniwa@webkit.org>
142
143         Assert that no script is executed during style recalc
144         https://bugs.webkit.org/show_bug.cgi?id=178845
145         <rdar://problem/35106129>
146
147         Reviewed by Antti Koivisto.
148
149         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
150         to make sure we don't start mutating DOM in the middle of a style update.
151
152         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
153         shadow tree since that happens while updating the style.
154
155         No new tests since there should be no behavioral change.
156
157         * dom/Document.cpp:
158         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
159         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
160         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
161         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
162         scripts which in turn trigger another (recursive) style recalc.
163         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
164         NoEventDispatchAssertion.
165         * dom/Element.cpp:
166         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
167         newly cloned element for SVG use element's shadow tree.
168         (WebCore::Element::cloneElementWithoutChildren): Ditto.
169         * dom/EventDispatcher.cpp:
170         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
171         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
172         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
173         pushing or popoing the stack frame.
174         * svg/SVGUseElement.cpp:
175         (WebCore::SVGUseElement::clearShadowTree):
176         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
177         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
178         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
179         (WebCore::SVGUseElement::cloneTarget const): Ditto.
180         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
181         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
182         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
183
184 2017-10-28  Dean Jackson  <dino@apple.com>
185
186         createImageBitmap with HTMLCanvasElement
187         https://bugs.webkit.org/show_bug.cgi?id=178984
188         <rdar://problem/35238440>
189
190         Reviewed by Sam Weinig.
191
192         Implement createImageBitmap(HTMLCanvasElement).
193
194         While here, explicitly reject the promises for the
195         methods we haven't yet implemented. I was hoping this
196         would avoid a lengthy timeout in one of the imported
197         WPT tests but, alas, it doesn't. However, it's still
198         a good idea.
199
200         Extend internal WPT proposals to cover canvas creation.
201
202         * html/ImageBitmap.cpp:
203         (WebCore::ImageBitmap::createPromise): Get the image from
204         the canvas and draw it into a new ImageBitmap buffer.
205
206 2017-10-28  Myles C. Maxfield  <mmaxfield@apple.com>
207
208         [iOS] Unify Font::platformCharWidthInit() with macOS
209         https://bugs.webkit.org/show_bug.cgi?id=178951
210         <rdar://problem/7848198>
211
212         Reviewed by Zalan Bujtas.
213
214         The only reason these codepaths are different is because historically this codepath
215         didn't work with GS fonts (which we don't use anymore).
216
217         Tests: fast/forms/search-styled.html
218                fast/forms/text-control-intrinsic-widths.html
219                fast/forms/textarea-width.html
220
221         * platform/graphics/cocoa/FontCocoa.mm:
222         (WebCore::Font::platformCharWidthInit):
223
224 2017-10-28  Chris Dumez  <cdumez@apple.com>
225
226         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
227         https://bugs.webkit.org/show_bug.cgi?id=178976
228
229         Reviewed by Sam Weinig.
230
231         Test: http/tests/workers/service/ServiceWorkerGlobalScope-properties.html
232
233         * workers/service/ExtendableEvent.idl:
234         * workers/service/FetchEvent.idl:
235         Drop [Exposed=Worker] as there is already [Exposed=ServiceWorker] and
236         ServiceWorkerGlobalScope inherits from WorkerGlobalScope. This is redundant
237         and we would hit assertions and adding the global constructors at runtime
238         when the feature is enabled, because the property already exists.
239
240 2017-10-28  Zalan Bujtas  <zalan@apple.com>
241
242         [FrameView::layout cleanup] Move core layout logic to a separate class.
243         https://bugs.webkit.org/show_bug.cgi?id=178771
244         <rdar://problem/35166542>
245
246         Reviewed by Simon Fraser.
247
248         Move layout code out from FrameView to LayoutContext.
249
250         LayoutContext holds all the layout related logic (scheduling, needsLayout, handling layout states),
251         while scrolling, view sizing methods stay in FrameView.
252         Having a dedicated LayoutContext allows to structure the code better.   
253
254         Covered by existing tests.
255
256         * Sources.txt:
257         * WebCore.xcodeproj/project.pbxproj:
258         * accessibility/AXObjectCache.cpp:
259         (WebCore::rendererNeedsDeferredUpdate):
260         * accessibility/AccessibilityObject.cpp:
261         (WebCore::AccessibilityObject::updateBackingStore):
262         * accessibility/AccessibilityRenderObject.cpp:
263         (WebCore::AccessibilityRenderObject::textUnderElement const):
264         (WebCore::AccessibilityRenderObject::layoutCount const):
265         * dom/Document.cpp:
266         (WebCore::Document::setVisualUpdatesAllowed):
267         (WebCore::Document::resolveStyle):
268         (WebCore::Document::updateStyleIfNeeded):
269         (WebCore::Document::updateLayout):
270         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
271         (WebCore::Document::implicitClose):
272         (WebCore::Document::isLayoutTimerActive):
273         * dom/Element.cpp:
274         (WebCore::Element::absoluteEventHandlerBounds):
275         * editing/FrameSelection.cpp:
276         (WebCore::FrameSelection::setSelection):
277         * html/HTMLEmbedElement.cpp:
278         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
279         * html/HTMLFormControlElement.cpp:
280         (WebCore::HTMLFormControlElement::didAttachRenderers):
281         * inspector/InspectorOverlay.cpp:
282         (WebCore::InspectorOverlay::update):
283         * loader/FrameLoader.cpp:
284         (WebCore::FrameLoader::stopForUserCancel):
285         * page/Frame.cpp:
286         (WebCore::Frame::setView):
287         (WebCore::Frame::clearTimers):
288         (WebCore::Frame::setPageAndTextZoomFactors):
289         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
290         * page/FrameView.cpp:
291         (WebCore::FrameView::FrameView):
292         (WebCore::FrameView::~FrameView):
293         (WebCore::FrameView::reset):
294         (WebCore::FrameView::resetScrollbars):
295         (WebCore::FrameView::didFirstLayout const):
296         (WebCore::FrameView::willDestroyRenderTree):
297         (WebCore::FrameView::didDestroyRenderTree):
298         (WebCore::FrameView::setContentsSize):
299         (WebCore::FrameView::calculateScrollbarModesForLayout):
300         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
301         (WebCore::FrameView::topContentInsetDidChange):
302         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
303         (WebCore::FrameView::adjustScrollbarsForLayout):
304         (WebCore::FrameView::willDoLayout): This takes care of the view related task right before entering render tree layout.
305         (WebCore::FrameView::didLayout): post layout tasks.
306         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
307         (WebCore::FrameView::updateLayoutViewport):
308         (WebCore::FrameView::maintainScrollPositionAtAnchor):
309         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
310         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
311         (WebCore::FrameView::availableContentSizeChanged):
312         (WebCore::FrameView::updateContentsSize):
313         (WebCore::FrameView::needsLayout const):
314         (WebCore::FrameView::setNeedsLayout):
315         (WebCore::FrameView::scheduleSelectionUpdate):
316         (WebCore::FrameView::updateEmbeddedObjects):
317         (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
318         (WebCore::FrameView::flushPostLayoutTasksQueue):
319         (WebCore::FrameView::performPostLayoutTasks):
320         (WebCore::FrameView::sendResizeEventIfNeeded):
321         (WebCore::FrameView::autoSizeIfEnabled):
322         (WebCore::FrameView::paintControlTints):
323         (WebCore::FrameView::paintContents):
324         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
325         (WebCore::FrameView::enableAutoSizeMode):
326         (WebCore::FrameView::forceLayout):
327         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
328         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
329         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
330         (): Deleted.
331         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker): Deleted.
332         (WebCore::applyTextSizingIfNeeded): Deleted.
333         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
334         (WebCore::FrameView::updateStyleForLayout): Deleted.
335         (WebCore::FrameView::canPerformLayout const): Deleted.
336         (WebCore::FrameView::layout): Deleted.
337         (WebCore::FrameView::runOrSchedulePostLayoutTasks): Deleted.
338         (WebCore::FrameView::convertSubtreeLayoutToFullLayout): Deleted.
339         (WebCore::FrameView::layoutTimerFired): Deleted.
340         (WebCore::FrameView::scheduleRelayout): Deleted.
341         (WebCore::isObjectAncestorContainerOf): Deleted.
342         (WebCore::FrameView::scheduleRelayoutOfSubtree): Deleted.
343         (WebCore::FrameView::layoutPending const): Deleted.
344         (WebCore::FrameView::unscheduleRelayout): Deleted.
345         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted.
346         * page/FrameView.h:
347         * page/LayoutContext.cpp: Added.
348         (WebCore::isObjectAncestorContainerOf):
349         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
350         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
351         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
352         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
353         (WebCore::LayoutScope::LayoutScope):
354         (WebCore::LayoutScope::~LayoutScope):
355         (WebCore::LayoutContext::LayoutContext):
356         (WebCore::LayoutContext::layout):
357         (WebCore::LayoutContext::runOrScheduleAsynchronousTasks):
358         (WebCore::LayoutContext::runAsynchronousTasks):
359         (WebCore::LayoutContext::flushAsynchronousTasks):
360         (WebCore::LayoutContext::reset):
361         (WebCore::LayoutContext::needsLayout const):
362         (WebCore::LayoutContext::setNeedsLayout):
363         (WebCore::LayoutContext::enableSetNeedsLayout):
364         (WebCore::LayoutContext::disableSetNeedsLayout):
365         (WebCore::LayoutContext::scheduleLayout):
366         (WebCore::LayoutContext::unscheduleLayout):
367         (WebCore::LayoutContext::scheduleSubtreeLayout):
368         (WebCore::LayoutContext::layoutTimerFired):
369         (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout):
370         (WebCore::LayoutContext::setSubtreeLayoutRoot):
371         (WebCore::LayoutContext::canPerformLayout const):
372         (WebCore::LayoutContext::applyTextSizingIfNeeded):
373         (WebCore::LayoutContext::updateStyleForLayout):
374         (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
375         (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded):
376         (WebCore::LayoutContext::frame const):
377         (WebCore::LayoutContext::view const):
378         (WebCore::LayoutContext::renderView const):
379         (WebCore::LayoutContext::document const):
380         * page/LayoutContext.h: Added.
381         (WebCore::LayoutContext::startDisallowingLayout):
382         (WebCore::LayoutContext::endDisallowingLayout):
383         (WebCore::LayoutContext::layoutPhase const):
384         (WebCore::LayoutContext::isLayoutNested const):
385         (WebCore::LayoutContext::layoutCount const):
386         (WebCore::LayoutContext::isLayoutPending const):
387         (WebCore::LayoutContext::isInLayout const):
388         (WebCore::LayoutContext::isInRenderTreeLayout const):
389         (WebCore::LayoutContext::inPaintableState const):
390         (WebCore::LayoutContext::subtreeLayoutRoot const):
391         (WebCore::LayoutContext::clearSubtreeLayoutRoot):
392         (WebCore::LayoutContext::resetFirstLayoutFlag):
393         (WebCore::LayoutContext::didFirstLayout const):
394         (WebCore::LayoutContext::setNeedsFullRepaint):
395         (WebCore::LayoutContext::needsFullRepaint const):
396         (WebCore::LayoutContext::layoutDisallowed const):
397         (WebCore::LayoutContext::isLayoutSchedulingEnabled const):
398         (WebCore::LayoutContext::inAsynchronousTasks const):
399         * page/Page.cpp:
400         (WebCore::Page::setPageScaleFactor):
401         * rendering/RenderBlock.cpp:
402         (WebCore::RenderBlock::insertPositionedObject):
403         * rendering/RenderBox.cpp:
404         (WebCore::RenderBox::imageChanged):
405         (WebCore::RenderBox::computeLogicalWidthInFragment const):
406         * rendering/RenderElement.cpp:
407         (WebCore::RenderElement::clearSubtreeLayoutRootIfNeeded const):
408         (WebCore::RenderElement::checkForRepaintDuringLayout const):
409         * rendering/RenderFrameBase.cpp:
410         (WebCore::RenderFrameBase::performLayoutWithFlattening):
411         * rendering/RenderLayer.cpp:
412         (WebCore::RenderLayer::scrollTo):
413         * rendering/RenderObject.cpp:
414         (WebCore::scheduleRelayoutForSubtree):
415         * rendering/RenderTreeAsText.cpp:
416         (WebCore::write):
417         * rendering/RenderVideo.cpp:
418         (WebCore::RenderVideo::updatePlayer):
419         * rendering/RenderView.h:
420         * rendering/RenderWidget.cpp:
421         (WebCore::RenderWidget::updateWidgetPosition):
422         * svg/graphics/SVGImage.cpp:
423         (WebCore::SVGImage::draw):
424         * testing/Internals.cpp:
425         (WebCore::Internals::layoutCount const):
426         
427 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
428
429         Cleanup PageDebuggable
430         https://bugs.webkit.org/show_bug.cgi?id=178972
431
432         Reviewed by Sam Weinig.
433
434         * page/PageDebuggable.cpp:
435         (WebCore::PageDebuggable::PageDebuggable):
436         * page/PageDebuggable.h:
437
438 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
439
440         Extract a WorkerDebuggerProxy interface out of WorkerReportingProxy
441         https://bugs.webkit.org/show_bug.cgi?id=178975
442
443         Reviewed by Sam Weinig.
444
445         No new tests, just refactoring.
446
447         * workers/WorkerDebuggerProxy.h:
448         * workers/WorkerReportingProxy.h:
449         * WebCore.xcodeproj/project.pbxproj:
450         Extract a method from WorkerReportingProxy to WorkerDebuggerProxy and
451         rename it to be more general.
452
453         * inspector/WorkerToPageFrontendChannel.h:
454         (WebCore::WorkerToPageFrontendChannel::sendMessageToFrontend):
455         * workers/DedicatedWorkerThread.cpp:
456         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
457         * workers/DedicatedWorkerThread.h:
458         * workers/WorkerMessagingProxy.cpp:
459         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
460         (WebCore::WorkerMessagingProxy::postMessageToDebugger):
461         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
462         * workers/WorkerMessagingProxy.h:
463         * workers/WorkerThread.cpp:
464         (WebCore::WorkerThread::WorkerThread):
465         * workers/WorkerThread.h:
466         (WebCore::WorkerThread::workerDebuggerProxy const):
467         * workers/service/context/ServiceWorkerThread.cpp:
468         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
469         * workers/service/context/ServiceWorkerThread.h:
470         * workers/service/context/ServiceWorkerThreadProxy.cpp:
471         (WebCore::ServiceWorkerThreadProxy::create):
472         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
473         Include a WorkerDebuggerProxy alongside the other proxies.
474         Use the renamed debugger proxy method.
475
476 2017-10-28  Ryosuke Niwa  <rniwa@webkit.org>
477
478         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
479         https://bugs.webkit.org/show_bug.cgi?id=178715
480         <rdar://problem/35144665>
481
482         Reviewed by Brent Fulgham.
483
484         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
485         instead of in the middle of collecting a list of stylesheets.
486
487         * dom/Document.cpp:
488         (WebCore::Document::Document): Initialize the newly added timer.
489         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
490         handlers may be expecting to see the document after XSLT had been applied.
491         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
492         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
493         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
494         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
495         (WebCore::Document::applyXSLTransform): Deleted.
496         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
497         inline XSLT and it happens much earlier than implicitClose.
498         (WebCore::Document::suspendScheduledTasks): Suspend the XSLT timer.
499         (WebCore::Document::resumeScheduledTasks): Reschedule the XSLT timer if m_hasPendingXSLTransforms is set.
500         * dom/Document.h:
501         * dom/ProcessingInstruction.cpp:
502         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
503         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
504         function can be called from a non-script-resilient call stack.
505         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
506         * style/StyleScope.cpp:
507         (WebCore::Style::Scope::collectXSLTransforms): Added.
508         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
509         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
510         * style/StyleScope.h:
511         * xml/parser/XMLDocumentParserLibxml2.cpp:
512         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
513
514 2017-10-27  Devin Rousso  <webkit@devinrousso.com>
515
516         Web Inspector: Canvas Tab: no way to see backtrace of where a canvas context was created
517         https://bugs.webkit.org/show_bug.cgi?id=178799
518         <rdar://problem/35175805>
519
520         Reviewed by Brian Burg.
521
522         No new tests, updated existing tests.
523
524         * inspector/InspectorCanvas.h:
525         * inspector/InspectorCanvas.cpp:
526         (iterateCallFrames):
527         (WebCore::InspectorCanvas::buildObjectForCanvas):
528         (WebCore::InspectorCanvas::buildAction):
529
530         * inspector/InspectorCanvasAgent.cpp:
531         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
532         If the Canvas agent is enabled, generate a backtrace and send it to the frontend with the canvas.
533         We do not do this for canvases created before the agent is enabled for performance reasons.
534
535 2017-10-27  Keith Miller  <keith_miller@apple.com>
536
537         Add unified source list files and build scripts to Xcode project navigator
538         https://bugs.webkit.org/show_bug.cgi?id=178959
539
540         Reviewed by Andy Estes.
541
542         * WebCore.xcodeproj/project.pbxproj:
543
544 2017-10-27  Daniel Bates  <dabates@apple.com>
545
546         Only allow non-mixed content protected subresources to ask for credentials
547         https://bugs.webkit.org/show_bug.cgi?id=178919
548         <rdar://problem/35015245>
549
550         Reviewed by Alex Christensen.
551
552         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
553         to allow protected mixed-content subresources to ask for credentials.
554
555         Tests: http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html
556                http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html
557                http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html
558                http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html
559                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html
560                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html
561
562         * loader/ResourceLoader.cpp:
563         (WebCore::ResourceLoader::ResourceLoader): Initialize m_canAskClientForCredentials based on the
564         specified resource loader options.
565         (WebCore::ResourceLoader::init): Update m_canAskClientForCredentials based on the URL of the initial
566         request.
567         (WebCore::ResourceLoader::isMixedContent const): Helper function to check if the specified URL
568         represents a mixed content resource.
569         (WebCore::ResourceLoader::willSendRequestInternal): If the original request or the redirect request
570         is mixed content then update state such that we will disallow asking for credentials.
571         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified to use m_canAskClientForCredentials
572         when determining whether the request is allowed to ask for credentials.
573         * loader/ResourceLoader.h:
574
575 2017-10-27  Chris Dumez  <cdumez@apple.com>
576
577         Unskip more Service Workers tests
578         https://bugs.webkit.org/show_bug.cgi?id=178944
579
580         Reviewed by Sam Weinig.
581
582         Drop bad assertion that was causing the Service Worker WebProcess to crash and causing
583         tests to fail as a result.
584
585         * workers/service/ServiceWorkerGlobalScope.cpp:
586         (WebCore::ServiceWorkerGlobalScope::registration):
587         * workers/service/ServiceWorkerGlobalScope.h:
588
589 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
590
591         Unreviewed, rolling out r224011.
592
593         xsl LayoutTests hit an assertion added with this change since
594         r223999 was rolled out.
595
596         Reverted changeset:
597
598         "Assert that no script is executed during style recalc"
599         https://bugs.webkit.org/show_bug.cgi?id=178845
600         https://trac.webkit.org/changeset/224011
601
602 2017-10-27  Antoine Quint  <graouts@apple.com>
603
604         [Web Animations] Expose the currentTime property on AnimationTimeline
605         https://bugs.webkit.org/show_bug.cgi?id=178928
606
607         Reviewed by Dean Jackson.
608
609         We add the currentTime property on AnimationTimeline and add an internals method
610         to set it in a test which will allow us to validate the timing model state for
611         a given time.
612
613         Test: webanimations/timeline-current-time.html
614
615         * animation/AnimationTimeline.cpp:
616         (WebCore::AnimationTimeline::bindingsCurrentTime const):
617         (WebCore::AnimationTimeline::setCurrentTime):
618         * animation/AnimationTimeline.h:
619         (WebCore::AnimationTimeline::currentTime const):
620         * animation/AnimationTimeline.idl:
621         * testing/Internals.cpp:
622         (WebCore::Internals::setTimelineCurrentTime):
623         * testing/Internals.h:
624         * testing/Internals.idl:
625
626 2017-10-27  Antoine Quint  <graouts@apple.com>
627
628         [Web Animations] Use Seconds vs. MonotonicTime to represent times
629         https://bugs.webkit.org/show_bug.cgi?id=178950
630
631         Reviewed by Dean Jackson.
632
633         Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
634         originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
635         sense to use Seconds to represent them as opposed to a MonotonicTime.
636
637         * animation/WebAnimation.cpp:
638         (WebCore::WebAnimation::bindingsStartTime const):
639         (WebCore::WebAnimation::setBindingsStartTime):
640         * animation/WebAnimation.h:
641
642 2017-10-27  Chris Dumez  <cdumez@apple.com>
643
644         DOMWindow::dispatchEvent() does not reset the event's dispatch flag
645         https://bugs.webkit.org/show_bug.cgi?id=178897
646
647         Reviewed by Darin Adler.
648
649         Make sure we reset the currentTarget, dispatch flag, phase and propagation flags
650         after dispatching an event on a Window, as per:
651         - https://dom.spec.whatwg.org/#concept-event-dispatch
652
653         This behavior is consistent with Firefox.
654
655         Test: fast/events/window-load-initEvent.html
656
657         * page/DOMWindow.cpp:
658         (WebCore::DOMWindow::dispatchEvent):
659
660 2017-10-27  Keith Miller  <keith_miller@apple.com>
661
662         Move iOS specific sources to unified sources
663         https://bugs.webkit.org/show_bug.cgi?id=178915
664
665         Rubber-stamped by Tim Horton.
666
667         * SourcesCocoa.txt:
668         * SourcesIOS.txt:
669         * SourcesMac.txt:
670         * WebCore.xcodeproj/project.pbxproj:
671
672 2017-10-27  Eric Carlson  <eric.carlson@apple.com>
673
674         NowPlayingInfo should contain a unique identifier
675         https://bugs.webkit.org/show_bug.cgi?id=178872
676         <rdar://problem/34924012>
677
678         Unreviewed, build fix.
679
680         * platform/audio/ios/MediaSessionManagerIOS.mm:
681         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Call string.impl().hash() instead of
682         string.existingHash() because the later will assert in a debug build if the hash hasn't
683         been calculated yet.
684         * platform/audio/mac/MediaSessionManagerMac.mm:
685         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto.
686
687 2017-10-27  Alex Christensen  <achristensen@webkit.org>
688
689         Fix accessibility/mac/aria-label-on-label-element.html after r224074
690         https://bugs.webkit.org/show_bug.cgi?id=178892
691
692         * accessibility/AccessibilityNodeObject.cpp:
693         (WebCore::AccessibilityNodeObject::titleElementText const):
694         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
695         * accessibility/AccessibilityObject.h:
696         (WebCore::AccessibilityText::AccessibilityText):
697         Turns out my null checks changed behavior.  This undoes them.
698
699 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
700
701         Unreviewed, rolling out r223999.
702
703         Caused xsl LayoutTest flakiness.
704
705         Reverted changeset:
706
707         "Style::Scope::flushPendingUpdate() can replace the entire
708         document in XSLTProcessor::createDocumentFromSource"
709         https://bugs.webkit.org/show_bug.cgi?id=178715
710         https://trac.webkit.org/changeset/223999
711
712 2017-10-27  Chris Dumez  <cdumez@apple.com>
713
714         Audit init*Event() method to make sure they reset internal data members
715         https://bugs.webkit.org/show_bug.cgi?id=178886
716
717         Reviewed by Ryosuke Niwa.
718
719         Audit init*Event() method to make sure they reset internal data members.
720
721         * dom/Event.cpp:
722         (WebCore::Event::initEvent):
723         * dom/KeyboardEvent.cpp:
724         (WebCore::KeyboardEvent::initKeyboardEvent):
725         * dom/MessageEvent.cpp:
726         (WebCore::MessageEvent::initMessageEvent):
727         * dom/MouseEvent.cpp:
728         (WebCore::MouseEvent::initMouseEvent):
729         * dom/MouseRelatedEvent.h:
730         (WebCore::MouseRelatedEvent::setIsSimulated):
731         * dom/TextEvent.cpp:
732         (WebCore::TextEvent::initTextEvent):
733         * dom/WheelEvent.cpp:
734         (WebCore::WheelEvent::initWheelEvent):
735
736 2017-10-27  Chris Dumez  <cdumez@apple.com>
737
738         Add initial support for serviceWorkerClient.postMessage()
739         https://bugs.webkit.org/show_bug.cgi?id=178794
740
741         Reviewed by Youenn Fablet.
742
743         Add initial support for serviceWorkerClient.postMessage():
744         - https://w3c.github.io/ServiceWorker/#client-postmessage
745
746         It is now possible to do bi-directional communication with a service worker
747         via postMessage().
748
749         No new tests, updated existing test.
750
751         * WebCore.xcodeproj/project.pbxproj:
752         * dom/Document.cpp:
753         (WebCore::generateDocumentIdentifier):
754         (WebCore::Document::allDocumentsMap):
755         (WebCore::Document::allDocuments):
756         (WebCore::m_identifier):
757         (WebCore::Document::~Document):
758         * dom/Document.h:
759         (WebCore::Document::identifier const):
760         * dom/ScriptExecutionContext.cpp:
761         (WebCore::ScriptExecutionContext::serviceWorkerContainer):
762         * dom/ScriptExecutionContext.h:
763         * workers/service/ServiceWorker.cpp:
764         (WebCore::ServiceWorker::postMessage):
765         * workers/service/ServiceWorkerClient.cpp:
766         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
767         (WebCore::ServiceWorkerClient::~ServiceWorkerClient):
768         (WebCore::ServiceWorkerClient::id const):
769         (WebCore::ServiceWorkerClient::postMessage):
770         * workers/service/ServiceWorkerClient.h:
771         (WebCore::ServiceWorkerClient::create):
772         * workers/service/ServiceWorkerClient.idl:
773         * workers/service/ServiceWorkerClientIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
774         (WebCore::ServiceWorkerClientIdentifier::toString const):
775         * workers/service/ServiceWorkerRegistration.cpp:
776         (WebCore::ServiceWorkerRegistration::unregister):
777         * workers/service/ServiceWorkerWindowClient.cpp:
778         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
779         * workers/service/ServiceWorkerWindowClient.h:
780         * workers/service/context/SWContextManager.cpp:
781         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
782         * workers/service/context/SWContextManager.h:
783         * workers/service/context/ServiceWorkerThread.cpp:
784         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
785         * workers/service/context/ServiceWorkerThread.h:
786         * workers/service/server/SWClientConnection.cpp:
787         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
788         * workers/service/server/SWClientConnection.h:
789
790 2017-10-27  Frederic Wang  <fwang@igalia.com>
791
792         Use auto for some variables in RenderLayerCompositor/Backing
793         https://bugs.webkit.org/show_bug.cgi?id=178570
794
795         Reviewed by Darin Adler.
796
797         No new tests, behavior unchanged.
798
799         * rendering/RenderLayerBacking.cpp:
800         (WebCore::canvasCompositingStrategy):
801         (WebCore::RenderLayerBacking::RenderLayerBacking):
802         (WebCore::computePageTiledBackingCoverage):
803         (WebCore::RenderLayerBacking::layerWillBeDestroyed):
804         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
805         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
806         (WebCore::RenderLayerBacking::updateCompositedBounds):
807         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
808         (WebCore::RenderLayerBacking::updateAfterLayout):
809         (WebCore::RenderLayerBacking::updateConfiguration):
810         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
811         (WebCore::RenderLayerBacking::updateGeometry):
812         (WebCore::RenderLayerBacking::updateInternalHierarchy):
813         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
814         (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const):
815         (WebCore::RenderLayerBacking::compositingOpacity const):
816         (WebCore::isRestartedPlugin):
817         (WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
818         (WebCore::RenderLayerBacking::updateImageContents):
819         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
820         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
821         (WebCore::RenderLayerBacking::getCurrentTransform const):
822         (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
823         (WebCore::RenderLayerBacking::startAnimation):
824         (WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const):
825         * rendering/RenderLayerCompositor.cpp:
826         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
827         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):
828         (WebCore::updateScrollingLayerWithClient):
829         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
830         (WebCore::RenderLayerCompositor::didPaintBacking):
831         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
832         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const):
833         (WebCore::RenderLayerCompositor::updateCompositingLayers):
834         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
835         (WebCore::RenderLayerCompositor::logLayerInfo):
836         (WebCore::checkIfDescendantClippingContextNeedsUpdate):
837         (WebCore::styleChangeRequiresLayerRebuild):
838         (WebCore::RenderLayerCompositor::canCompositeClipPath):
839         (WebCore::rendererForCompositingTests):
840         (WebCore::RenderLayerCompositor::updateBacking):
841         (WebCore::RenderLayerCompositor::repaintOnCompositingChange):
842         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
843         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
844         (WebCore::RenderLayerCompositor::setCompositingParent):
845         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
846         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling const):
847         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
848         (WebCore::RenderLayerCompositor::positionForClipLayer const):
849         (WebCore::RenderLayerCompositor::frameViewDidLayout):
850         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
851         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
852         (WebCore::RenderLayerCompositor::frameContentsCompositor):
853         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
854         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
855         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
856         (WebCore::RenderLayerCompositor::setIsInWindow):
857         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
858         (WebCore::RenderLayerCompositor::clippedByAncestor const):
859         (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
860         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
861         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
862         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
863         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
864         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
865         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
866         (WebCore::RenderLayerCompositor::requiresScrollLayer const):
867         (WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const):
868         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const):
869         (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
870         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
871         (WebCore::RenderLayerCompositor::documentUsesTiledBacking const):
872         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
873         (WebCore::RenderLayerCompositor::updateLayerForHeader):
874         (WebCore::RenderLayerCompositor::updateLayerForFooter):
875         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
876         (WebCore::RenderLayerCompositor::ensureRootLayer):
877         (WebCore::RenderLayerCompositor::destroyRootLayer):
878         (WebCore::RenderLayerCompositor::attachRootLayer):
879         (WebCore::RenderLayerCompositor::detachRootLayer):
880         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
881         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
882         (WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):
883         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints const):
884         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
885         (WebCore::enclosingScrollingNodeID):
886         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
887         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
888         (WebCore::RenderLayerCompositor::attachScrollingNode):
889         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
890         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
891         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
892         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
893         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
894         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
895         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView):
896
897 2017-10-27  Alicia Boya García  <aboya@igalia.com>
898
899         [GStreamer][MSE] Trim space between codecs
900         https://bugs.webkit.org/show_bug.cgi?id=178160
901
902         Reviewed by Xabier Rodriguez-Calvar.
903
904         Modify supportsCodecs() to accept a Vector<String> instead of
905         receiving a string and parsing itself.
906
907         This improves passrate for `mediasource-is-type-supported` as it
908         ensures that whitespace between codecs is now trimmed and codec
909         strings such as `video/webm;codecs="opus, vp9"` are matched as a valid
910         type, as required by the spec.
911
912         This patch also renames supportCodecs() to supportAllCodecs() and adds
913         a new variant, supportCodec(), that checks for support of an
914         individual codec.
915
916         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
917         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
918         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
919         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec):
920         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs):
921         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
922         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
923
924 2017-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
925
926         [GTK] Crash in WebCore::SelectionRangeData::apply
927         https://bugs.webkit.org/show_bug.cgi?id=177808
928
929         Reviewed by Carlos Garcia Campos.
930
931         The problem appears to be a name collision between WebCore::SelectionData and
932         WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
933         Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
934         Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
935         poor linker for not being magic?
936
937         This fixes crashes in approximately one bajillion tests.
938
939         * rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.
940
941 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
942
943         [WinCairo] Fix build after WebCore moves to unified source.
944         https://bugs.webkit.org/show_bug.cgi?id=178920
945
946         Added empty implementations to fix link error.
947
948         Reviewed by Ryosuke Niwa.
949
950         * platform/network/curl/DNSCurl.cpp:
951         (WebCore::DNSResolveQueue::updateIsUsingProxy):
952         (WebCore::DNSResolveQueue::platformResolve):
953
954 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
955
956         Implement seek tolerance methods in WebAVPlayerController.
957         https://bugs.webkit.org/show_bug.cgi?id=178838
958         rdar://problem/33781777
959
960         Reviewed by Eric Carlson.
961
962         No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.
963
964         * html/HTMLMediaElement.cpp:
965         (WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
966         * html/HTMLMediaElement.h:
967         * platform/cocoa/PlaybackSessionModel.h:
968         * platform/cocoa/PlaybackSessionModelMediaElement.h:
969         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
970         (WebCore::PlaybackSessionModelMediaElement::seekToTime):
971         * platform/ios/WebAVPlayerController.mm:
972         (-[WebAVPlayerController seekToTime:]):
973         (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
974         (-[WebAVPlayerController seekByTimeInterval:]):
975         (-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
976         (-[WebAVPlayerController seekToBeginning:]):
977         (-[WebAVPlayerController seekToEnd:]):
978         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
979         (VideoFullscreenControllerContext::seekToTime):
980
981 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
982
983         Unreviewed, fix WPE build after r224074
984         https://bugs.webkit.org/show_bug.cgi?id=178892
985
986         * accessibility/wpe/AccessibilityObjectWPE.cpp:
987         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
988
989 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
990
991         When navigating back to a page, compositing layers may not use accelerated drawing
992         https://bugs.webkit.org/show_bug.cgi?id=178749
993         rdar://problem/35158946
994
995         Reviewed by Dean Jackson.
996
997         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
998         occurred on back navigation, related to the ordering of style recalcs and layout.
999
1000         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
1001         its cacheAcceleratedCompositingFlags(), so any layers created during style update
1002         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
1003         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
1004
1005         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
1006         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
1007         the TileController.
1008
1009         Test: compositing/accelerated-layers-after-back.html
1010
1011         * page/FrameView.cpp:
1012         (WebCore::FrameView::updateCompositingLayersAfterLayout):
1013         * platform/graphics/ca/GraphicsLayerCA.cpp:
1014         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1015         * rendering/RenderLayerCompositor.cpp:
1016         (WebCore::RenderLayerCompositor::willRecalcStyle):
1017         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
1018         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1019         * rendering/RenderLayerCompositor.h:
1020
1021 2017-10-26  Alex Christensen  <achristensen@webkit.org>
1022
1023         Fix Windows build
1024         https://bugs.webkit.org/show_bug.cgi?id=178892
1025
1026         * accessibility/win/AccessibilityObjectWin.cpp:
1027         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1028
1029 2017-10-26  Alex Christensen  <achristensen@webkit.org>
1030
1031         Modernize AccessibilityObject.h
1032         https://bugs.webkit.org/show_bug.cgi?id=178892
1033
1034         Reviewed by Tim Horton.
1035
1036         The enums in AccessibilityObject.h are causing naming collisions with unified builds.
1037         This is what enum classes are for.
1038         HashMaps of enum classes still need a few casts to/from int.
1039         
1040         I also made some RefPtr's Ref's, use some initializer lists instead of values in the constructor implementation, and indentation fixing.
1041         
1042         No change in behavior.
1043
1044         * accessibility/AXObjectCache.cpp:
1045         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
1046         (WebCore::AXObjectCache::~AXObjectCache):
1047         (WebCore::AXObjectCache::getOrCreate):
1048         (WebCore::AXObjectCache::remove):
1049         (WebCore::AXObjectCache::notificationPostTimerFired):
1050         * accessibility/AXObjectCache.h:
1051         (WebCore::AXComputedObjectAttributeCache::CachedAXObjectAttributes::CachedAXObjectAttributes):
1052         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
1053         * accessibility/AccessibilityARIAGrid.cpp:
1054         (WebCore::AccessibilityARIAGrid::addChildren):
1055         * accessibility/AccessibilityARIAGridCell.cpp:
1056         (WebCore::AccessibilityARIAGridCell::parentRowGroup const):
1057         * accessibility/AccessibilityARIAGridRow.cpp:
1058         (WebCore::AccessibilityARIAGridRow::headerObject):
1059         * accessibility/AccessibilityAttachment.cpp:
1060         (WebCore::AccessibilityAttachment::accessibilityText):
1061         * accessibility/AccessibilityAttachment.h:
1062         * accessibility/AccessibilityImageMapLink.cpp:
1063         (WebCore::AccessibilityImageMapLink::roleValue const):
1064         (WebCore::AccessibilityImageMapLink::accessibilityText):
1065         * accessibility/AccessibilityLabel.cpp:
1066         (WebCore::childrenContainOnlyStaticText):
1067         * accessibility/AccessibilityLabel.h:
1068         * accessibility/AccessibilityList.cpp:
1069         (WebCore::AccessibilityList::isUnorderedList const):
1070         (WebCore::AccessibilityList::isOrderedList const):
1071         (WebCore::AccessibilityList::determineAccessibilityRole):
1072         (WebCore::AccessibilityList::roleValue const):
1073         * accessibility/AccessibilityListBox.cpp:
1074         (WebCore::AccessibilityListBox::setSelectedChildren):
1075         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const):
1076         * accessibility/AccessibilityListBox.h:
1077         * accessibility/AccessibilityListBoxOption.h:
1078         * accessibility/AccessibilityMathMLElement.cpp:
1079         (WebCore::AccessibilityMathMLElement::determineAccessibilityRole):
1080         (WebCore::AccessibilityMathMLElement::isMathScriptObject const):
1081         (WebCore::AccessibilityMathMLElement::isMathMultiscriptObject const):
1082         * accessibility/AccessibilityMediaControls.cpp:
1083         (WebCore::AccessibilityMediaControl::accessibilityText):
1084         (WebCore::AccessibilityMediaControl::roleValue const):
1085         * accessibility/AccessibilityMediaControls.h:
1086         * accessibility/AccessibilityMenuList.cpp:
1087         (WebCore::AccessibilityMenuList::addChildren):
1088         * accessibility/AccessibilityMenuList.h:
1089         * accessibility/AccessibilityMenuListOption.h:
1090         * accessibility/AccessibilityMenuListPopup.cpp:
1091         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const):
1092         * accessibility/AccessibilityMenuListPopup.h:
1093         * accessibility/AccessibilityNodeObject.cpp:
1094         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
1095         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
1096         (WebCore::AccessibilityNodeObject::canHaveChildren const):
1097         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
1098         (WebCore::AccessibilityNodeObject::isSearchField const):
1099         (WebCore::AccessibilityNodeObject::isImage const):
1100         (WebCore::AccessibilityNodeObject::isPasswordField const):
1101         (WebCore::AccessibilityNodeObject::isInputImage const):
1102         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
1103         (WebCore::AccessibilityNodeObject::isSlider const):
1104         (WebCore::AccessibilityNodeObject::isMenuRelated const):
1105         (WebCore::AccessibilityNodeObject::isMenu const):
1106         (WebCore::AccessibilityNodeObject::isMenuBar const):
1107         (WebCore::AccessibilityNodeObject::isMenuButton const):
1108         (WebCore::AccessibilityNodeObject::isMenuItem const):
1109         (WebCore::AccessibilityNodeObject::isEnabled const):
1110         (WebCore::AccessibilityNodeObject::isChecked const):
1111         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute const):
1112         (WebCore::AccessibilityNodeObject::headingLevel const):
1113         (WebCore::AccessibilityNodeObject::isHeading const):
1114         (WebCore::AccessibilityNodeObject::isLink const):
1115         (WebCore::AccessibilityNodeObject::isGroup const):
1116         (WebCore::AccessibilityNodeObject::selectedRadioButton):
1117         (WebCore::AccessibilityNodeObject::checkboxOrRadioValue const):
1118         (WebCore::AccessibilityNodeObject::actionElement const):
1119         (WebCore::AccessibilityNodeObject::alterSliderValue):
1120         (WebCore::AccessibilityNodeObject::isGenericFocusableElement const):
1121         (WebCore::AccessibilityNodeObject::menuElementForMenuButton const):
1122         (WebCore::AccessibilityNodeObject::menuItemElementForMenu const):
1123         (WebCore::AccessibilityNodeObject::titleElementText const):
1124         (WebCore::AccessibilityNodeObject::alternativeText const):
1125         (WebCore::AccessibilityNodeObject::visibleText const):
1126         (WebCore::AccessibilityNodeObject::helpText const):
1127         (WebCore::AccessibilityNodeObject::accessibilityText):
1128         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
1129         (WebCore::AccessibilityNodeObject::accessibilityDescription const):
1130         (WebCore::AccessibilityNodeObject::roleIgnoresTitle const):
1131         (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
1132         (WebCore::AccessibilityNodeObject::title const):
1133         (WebCore::AccessibilityNodeObject::text const):
1134         (WebCore::AccessibilityNodeObject::stringValue const):
1135         (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
1136         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const):
1137         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
1138         * accessibility/AccessibilityNodeObject.h:
1139         * accessibility/AccessibilityObject.cpp:
1140         (WebCore::AccessibilityObject::detach):
1141         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
1142         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
1143         (WebCore::AccessibilityObject::isBlockquote const):
1144         (WebCore::AccessibilityObject::isTextControl const):
1145         (WebCore::AccessibilityObject::isARIATextControl const):
1146         (WebCore::AccessibilityObject::isLandmark const):
1147         (WebCore::AccessibilityObject::findMatchingObjects):
1148         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
1149         (WebCore::AccessibilityObject::selectText):
1150         (WebCore::AccessibilityObject::isARIAInput):
1151         (WebCore::AccessibilityObject::isARIAControl):
1152         (WebCore::AccessibilityObject::isRangeControl const):
1153         (WebCore::AccessibilityObject::visiblePositionForBounds const):
1154         (WebCore::AccessibilityObject::supportsARIAReadOnly const):
1155         (WebCore::AccessibilityObject::ariaReadOnlyValue const):
1156         (WebCore::AccessibilityObject::headingElementForNode):
1157         (WebCore::AccessibilityObject::ariaTreeRows):
1158         (WebCore::AccessibilityObject::ariaTreeItemContent):
1159         (WebCore::AccessibilityObject::ariaTreeItemDisclosedRows):
1160         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
1161         (WebCore::AccessibilityObject::actionVerb const):
1162         (WebCore::AccessibilityObject::ariaCurrentState const):
1163         (WebCore::AccessibilityObject::ariaCurrentValue const):
1164         (WebCore::AccessibilityObject::orientation const):
1165         (WebCore::initializeRoleMap):
1166         (WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
1167         (WebCore::AccessibilityObject::computedRoleString const):
1168         (WebCore::AccessibilityObject::supportsPressAction const):
1169         (WebCore::AccessibilityObject::sortDirection const):
1170         (WebCore::AccessibilityObject::supportsExpanded const):
1171         (WebCore::AccessibilityObject::isExpanded const):
1172         (WebCore::AccessibilityObject::supportsChecked const):
1173         (WebCore::AccessibilityObject::checkboxOrRadioValue const):
1174         (WebCore::AccessibilityObject::scrollByPage const):
1175         (WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
1176         (WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
1177         (WebCore::AccessibilityObject::buttonRoleType const):
1178         (WebCore::AccessibilityObject::isButton const):
1179         (WebCore::AccessibilityObject::accessibilityIsIgnoredByDefault const):
1180         (WebCore::AccessibilityObject::defaultObjectInclusion const):
1181         (WebCore::AccessibilityObject::accessibilityIsIgnored const):
1182         (WebCore::AccessibilityObject::isContainedByPasswordField const):
1183         (WebCore::AccessibilityObject::AccessibilityObject): Deleted.
1184         * accessibility/AccessibilityObject.h:
1185         (WebCore::AccessibilityText::AccessibilityText):
1186         (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
1187         (WebCore::AccessibilityObject::isImageMap const):
1188         (WebCore::AccessibilityObject::isWebArea const):
1189         (WebCore::AccessibilityObject::isCheckbox const):
1190         (WebCore::AccessibilityObject::isRadioButton const):
1191         (WebCore::AccessibilityObject::isListBox const):
1192         (WebCore::AccessibilityObject::isSpinButton const):
1193         (WebCore::AccessibilityObject::isSwitch const):
1194         (WebCore::AccessibilityObject::isToggleButton const):
1195         (WebCore::AccessibilityObject::isTabList const):
1196         (WebCore::AccessibilityObject::isTabItem const):
1197         (WebCore::AccessibilityObject::isRadioGroup const):
1198         (WebCore::AccessibilityObject::isComboBox const):
1199         (WebCore::AccessibilityObject::isTree const):
1200         (WebCore::AccessibilityObject::isTreeGrid const):
1201         (WebCore::AccessibilityObject::isTreeItem const):
1202         (WebCore::AccessibilityObject::isScrollbar const):
1203         (WebCore::AccessibilityObject::isListItem const):
1204         (WebCore::AccessibilityObject::isScrollView const):
1205         (WebCore::AccessibilityObject::isCanvas const):
1206         (WebCore::AccessibilityObject::isPopUpButton const):
1207         (WebCore::AccessibilityObject::isColorWell const):
1208         (WebCore::AccessibilityObject::isSplitter const):
1209         (WebCore::AccessibilityObject::isToolbar const):
1210         (WebCore::AccessibilityObject::isSummary const):
1211         (WebCore::AccessibilityObject::isStaticText const):
1212         (WebCore::AccessibilityObject::ariaRoleAttribute const):
1213         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1214         * accessibility/AccessibilityProgressIndicator.h:
1215         * accessibility/AccessibilityRenderObject.cpp:
1216         (WebCore::AccessibilityRenderObject::parentObject const):
1217         (WebCore::AccessibilityRenderObject::isAttachment const):
1218         (WebCore::AccessibilityRenderObject::helpText const):
1219         (WebCore::AccessibilityRenderObject::stringValue const):
1220         (WebCore::AccessibilityRenderObject::addRadioButtonGroupChildren const):
1221         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
1222         (WebCore::AccessibilityRenderObject::linkedUIElements const):
1223         (WebCore::AccessibilityRenderObject::isAllowedChildOfTree const):
1224         (WebCore::objectInclusionFromAltText):
1225         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
1226         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
1227         (WebCore::AccessibilityRenderObject::selectedTextRange const):
1228         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
1229         (WebCore::AccessibilityRenderObject::isFocused const):
1230         (WebCore::AccessibilityRenderObject::setSelectedRows):
1231         (WebCore::AccessibilityRenderObject::getDocumentLinks):
1232         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
1233         (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
1234         (WebCore::AccessibilityRenderObject::supportsExpandedTextValue const):
1235         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1236         (WebCore::AccessibilityRenderObject::orientation const):
1237         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
1238         (WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren const):
1239         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
1240         (WebCore::AccessibilityRenderObject::addImageMapChildren):
1241         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
1242         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
1243         (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const):
1244         (WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
1245         (WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
1246         (WebCore::AccessibilityRenderObject::selectedChildren):
1247         (WebCore::AccessibilityRenderObject::visibleChildren):
1248         (WebCore::AccessibilityRenderObject::tabChildren):
1249         (WebCore::AccessibilityRenderObject::actionVerb const):
1250         (WebCore::msaaRoleForRenderer):
1251         (WebCore::AccessibilityRenderObject::roleValueForMSAA const):
1252         * accessibility/AccessibilitySVGElement.cpp:
1253         (WebCore::AccessibilitySVGElement::accessibilityText):
1254         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
1255         (WebCore::AccessibilitySVGElement::inheritsPresentationalRole const):
1256         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute const):
1257         (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
1258         * accessibility/AccessibilitySVGRoot.h:
1259         * accessibility/AccessibilityScrollView.cpp:
1260         (WebCore::AccessibilityScrollView::scrollBar):
1261         * accessibility/AccessibilityScrollView.h:
1262         * accessibility/AccessibilityScrollbar.cpp:
1263         (WebCore::AccessibilityScrollbar::orientation const):
1264         * accessibility/AccessibilityScrollbar.h:
1265         * accessibility/AccessibilitySlider.cpp:
1266         (WebCore::AccessibilitySlider::orientation const):
1267         (WebCore::AccessibilitySlider::addChildren):
1268         * accessibility/AccessibilitySlider.h:
1269         * accessibility/AccessibilitySpinButton.cpp:
1270         (WebCore::AccessibilitySpinButton::addChildren):
1271         * accessibility/AccessibilitySpinButton.h:
1272         * accessibility/AccessibilityTable.cpp:
1273         (WebCore::AccessibilityTable::hasARIARole const):
1274         (WebCore::AccessibilityTable::addChildren):
1275         (WebCore::AccessibilityTable::headerContainer):
1276         (WebCore::AccessibilityTable::roleValue const):
1277         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
1278         (WebCore::AccessibilityTable::titleElementText const):
1279         * accessibility/AccessibilityTableCell.cpp:
1280         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
1281         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
1282         * accessibility/AccessibilityTableColumn.cpp:
1283         (WebCore::AccessibilityTableColumn::headerObject):
1284         * accessibility/AccessibilityTableColumn.h:
1285         * accessibility/AccessibilityTableHeaderContainer.h:
1286         * accessibility/AccessibilityTableRow.cpp:
1287         (WebCore::AccessibilityTableRow::determineAccessibilityRole):
1288         (WebCore::AccessibilityTableRow::computeAccessibilityIsIgnored const):
1289         * accessibility/AccessibilityTree.cpp:
1290         (WebCore::AccessibilityTree::determineAccessibilityRole):
1291         * accessibility/ios/AccessibilityObjectIOS.mm:
1292         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1293         (WebCore::AccessibilityObject::isInputTypePopupButton const):
1294         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1295         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
1296         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
1297         (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
1298         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
1299         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
1300         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
1301         (-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
1302         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
1303         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1304         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
1305         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
1306         (-[WebAccessibilityObjectWrapper accessibilityValue]):
1307         (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
1308         (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
1309         (-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
1310         (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
1311         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
1312         (-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
1313         * accessibility/mac/AccessibilityObjectMac.mm:
1314         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1315         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1316         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
1317         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
1318         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
1319         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
1320         (createAccessibilitySearchKeyMap):
1321         (accessibilitySearchKeyForString):
1322         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
1323         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1324         (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
1325         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1326         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1327         (createAccessibilityRoleMap):
1328         (roleValueToNSString):
1329         (-[WebAccessibilityObjectWrapper role]):
1330         (-[WebAccessibilityObjectWrapper subrole]):
1331         (-[WebAccessibilityObjectWrapper roleDescription]):
1332         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1333         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
1334         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1335         * inspector/InspectorDOMAgent.cpp:
1336         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1337
1338 2017-10-26  Youenn Fablet  <youenn@apple.com>
1339
1340         importScripts in service worker should use ServiceWorkersMode::None
1341         https://bugs.webkit.org/show_bug.cgi?id=178888
1342
1343         Reviewed by Chris Dumez.
1344
1345         Test: http/tests/workers/service/service-worker-importScript.html
1346
1347         Made sure ServiceWorkersMode::None is used for loading scripts in service workers as we do not support foreign fetch.
1348
1349         * workers/WorkerScriptLoader.cpp:
1350         (WebCore::WorkerScriptLoader::loadSynchronously):
1351
1352 2017-10-26  Keith Miller  <keith_miller@apple.com>
1353
1354         Unreviewed, cleanup changelogs.
1355
1356 2017-10-26  Keith Miller  <keith_miller@apple.com>
1357
1358         Unreviewed, add deprecated declarations pragma to fix macosx.
1359
1360         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1361
1362 2017-10-26  Andy Estes  <aestes@apple.com>
1363
1364         [Payment Request] Restrict API use to secure, same-origin frames
1365         https://bugs.webkit.org/show_bug.cgi?id=178887
1366
1367         Reviewed by Tim Horton.
1368
1369         Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
1370         in the same origin as the main frame.
1371
1372         Progresses active-document-cross-origin.https.sub.html and
1373         active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
1374         since the allowpaymentrequest <iframe> attribute is not yet implemented.
1375
1376         * Modules/applepay/ApplePaySession.cpp:
1377         (WebCore::ApplePaySession::create):
1378         (WebCore::ApplePaySession::supportsVersion):
1379         (WebCore::ApplePaySession::canMakePayments):
1380         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
1381         (WebCore::ApplePaySession::openPaymentSetup):
1382         (WebCore::isSecure): Deleted.
1383         (WebCore::canCallApplePaySessionAPIs): Deleted.
1384         * Modules/applepay/PaymentSession.cpp: Added.
1385         (WebCore::isSecure):
1386         (WebCore::PaymentSession::canCreateSession):
1387         * Modules/applepay/PaymentSession.h:
1388         * Modules/paymentrequest/PaymentHandler.cpp:
1389         (WebCore::PaymentHandler::canCreateSession):
1390         * Modules/paymentrequest/PaymentHandler.h:
1391         * Modules/paymentrequest/PaymentRequest.cpp:
1392         (WebCore::PaymentRequest::create):
1393         * WebCore.xcodeproj/project.pbxproj:
1394
1395 2017-10-26  Youenn Fablet  <youenn@apple.com>
1396
1397         Add service worker handle fetch support for all subresource requests
1398         https://bugs.webkit.org/show_bug.cgi?id=178769
1399
1400         Reviewed by Chris Dumez.
1401
1402         Test: http/tests/workers/service/image-fetch.html
1403
1404         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
1405         Setting the selected service worker identifier for subresource only at the moment.
1406
1407         Testing is limited to images, future wpt tests should cover other subresource cases.
1408
1409         * loader/DocumentThreadableLoader.cpp:
1410         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1411         * loader/cache/CachedResourceLoader.cpp:
1412         (WebCore::CachedResourceLoader::prepareFetch):
1413         * loader/cache/CachedResourceRequest.cpp:
1414         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
1415         * loader/cache/CachedResourceRequest.h:
1416
1417 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
1418
1419         NowPlayingInfo should contain a unique identifier
1420         https://bugs.webkit.org/show_bug.cgi?id=178872
1421
1422         Reviewed by Jer Noble.
1423
1424         Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.
1425
1426         * platform/audio/PlatformMediaSessionManager.h:
1427         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.
1428
1429         * platform/audio/ios/MediaSessionManagerIOS.h:
1430         * platform/audio/ios/MediaSessionManagerIOS.mm:
1431         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.
1432
1433         * platform/audio/mac/MediaSessionManagerMac.h:
1434         * platform/audio/mac/MediaSessionManagerMac.mm:
1435         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.
1436
1437         * platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
1438         * platform/mac/MediaRemoteSoftLink.h:
1439
1440 2017-10-26  Keith Miller  <keith_miller@apple.com>
1441
1442         Unreviewed, iOS build fix.
1443
1444         * SourcesMac.txt:
1445         * WebCore.xcodeproj/project.pbxproj:
1446
1447 2017-10-26  Keith Miller  <keith_miller@apple.com>
1448
1449         Move Mac specific files to unified sources
1450         https://bugs.webkit.org/show_bug.cgi?id=178883
1451
1452         Rubber-stamped by Tim Horton.
1453
1454         * SourcesCocoa.txt:
1455         * SourcesMac.txt:
1456         * WebCore.xcodeproj/project.pbxproj:
1457
1458 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
1459
1460         DidMoveToNewDocumentAssertionScope shouldn't be necessary
1461         https://bugs.webkit.org/show_bug.cgi?id=178836
1462         <rdar://problem/35008876>
1463
1464         Reviewed by Antti Koivisto.
1465
1466         DidMoveToNewDocumentAssertionScope was introduced in r217972 to replace an existing assertion to make sure
1467         Node::didMoveToNewDocument is always called by its overrides in Node's subclasses. However, we can ensure
1468         better Node::didMoveToNewDocument is always called if we called it directly in Node::moveTreeToNewScope.
1469
1470         Because only subclasses of Element and ShadowRoot override Node::didMoveToNewDocument and we already have
1471         a specialized code path to adopt a ShadowRoot to a new document, this refactoring eliminates the need for
1472         having a virtual function on Node at all.
1473
1474         Hence this patch names Node::didMoveToNewDocument to Node::moveToNewDocument and makes it non-virtual,
1475         splits ShadowRoot::didMoveToNewDocument into moveShadowRootToNewParentScope and moveShadowRootToNewDocument,
1476         and removes DidMoveToNewDocumentAssertionScope completely.
1477
1478         No new tests since there should be no behavioral change.
1479
1480         * dom/Document.cpp:
1481         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Renamed from moveNodeIteratorsToNewDocument.
1482         * dom/Document.h:
1483         (WebCore::Document::moveNodeIteratorsToNewDocument): Inlined the check for emptiness of m_nodeIterators to
1484         avoid keep calling moveNodeIteratorsToNewDocumentSlowCase on every single node getting moved.
1485         * dom/Element.cpp:
1486         (WebCore::Element::didMoveToNewDocument): Removed the call to Node::didMoveToNewDocument since this is the
1487         base virtual function now.
1488         * dom/Element.h:
1489         * dom/Node.cpp:
1490         (WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope): Deleted.
1491         (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope): Deleted.
1492         (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall): Deleted.
1493         (WebCore::moveNodeToNewDocument): Deleted.
1494         (WebCore::Node::moveShadowTreeToNewDocument): Made this a member function of Node since it needs to call
1495         moveNodeToNewDocument, which is private to Node.
1496         (WebCore::Node::moveTreeToNewScope): Removed the release assert for the root node since  the same check
1497         exists inside traverseSubtreeToUpdateTreeScope. Also removed the release assertion for checking that
1498         node's old document matches the old document since document() simply calls treeScope().documentScope()
1499         and we're already release-asserting that the old scope of a node matches the old scope we know of.
1500         We release-assert that the old tree scope's document didn't change after the traversal instead. Finally,
1501         replaced a bunch of RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
1502         (WebCore::Node::moveNodeToNewDocument): Renamed from didMoveToNewDocument. Moved the code related to
1503         mutation observers inside hasRareData() check, and moved the the code to move event listeners inside
1504         eventTargetData() check both for clarity, and avoid doing the work for every single node being moved.
1505         Finally, call the old didMoveToNewDocument when "this" is an Element.
1506         * dom/Node.h:
1507         * dom/ShadowRoot.cpp:
1508         (WebCore::ShadowRoot::moveShadowRootToNewParentScope): Added. Extracted from didMoveToNewDocument.
1509         (WebCore::ShadowRoot::moveShadowRootToNewDocument): Renamed from didMoveToNewDocument. We now
1510         release-assert that parent tree scope's document matches the new document if any.
1511         * dom/ShadowRoot.h:
1512
1513 2017-10-26  Youenn Fablet  <youenn@apple.com>
1514
1515         Implement ServiceWorkerContainer getRegistration
1516         https://bugs.webkit.org/show_bug.cgi?id=178882
1517
1518         Reviewed by Chris Dumez.
1519
1520         Replace rejection promise by resolving the promise with a null value.
1521         This helps in running WPT tests as WPT tests usually check for registered service workers before running tests.
1522         For WTR, there should be no registered service worker anyway.
1523
1524         * workers/service/ServiceWorkerContainer.cpp:
1525         (WebCore::ServiceWorkerContainer::getRegistration):
1526         * workers/service/ServiceWorkerContainer.h:
1527
1528 2017-10-26  Dan Bernstein  <mitz@apple.com>
1529
1530         Account for Mail’s WebMessageDocument class being renamed
1531         https://bugs.webkit.org/show_bug.cgi?id=178881
1532
1533         Reviewed by Sam Weinig.
1534
1535         * editing/cocoa/HTMLConverter.mm:
1536         (_WebMessageDocumentClass): Look up the class by its new name. No longer look it up by the
1537           old old name, because TOT WebKit isn’t going to be used by versions of Mail that have that name.
1538
1539 2017-10-26  Antoine Quint  <graouts@apple.com>
1540
1541         Remove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
1542         https://bugs.webkit.org/show_bug.cgi?id=178879
1543
1544         Reviewed by Dean Jackson.
1545
1546         There are no call sites for FrameView::serviceScriptedAnimations() and that method is the
1547         only call site for Document::serviceScriptedAnimations(), so both can go.
1548
1549         * dom/Document.cpp:
1550         (WebCore::Document::serviceScriptedAnimations): Deleted.
1551         * dom/Document.h:
1552         * page/FrameView.cpp:
1553         (WebCore::FrameView::serviceScriptedAnimations): Deleted.
1554         * page/FrameView.h:
1555
1556 2017-10-26  Chris Dumez  <cdumez@apple.com>
1557
1558         Bring back SWContextManager abstraction in WebCore
1559         https://bugs.webkit.org/show_bug.cgi?id=178876
1560
1561         Reviewed by Geoffrey Garen.
1562
1563         Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
1564         is actually useful when the ServiceWorker wants to message the storage process.
1565
1566         * Sources.txt:
1567         * WebCore.xcodeproj/project.pbxproj:
1568         * workers/service/context/SWContextManager.cpp: Added.
1569         (WebCore::SWContextManager::singleton):
1570         (WebCore::SWContextManager::setConnection):
1571         (WebCore::SWContextManager::connection const):
1572         (WebCore::SWContextManager::registerServiceWorkerThread):
1573         (WebCore::SWContextManager::serviceWorkerThreadProxy const):
1574         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
1575         * workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
1576         (WebCore::SWContextManager::Connection::~Connection):
1577
1578 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1579
1580         [Curl] Rename CurlJobManager to CurlRequestScheduler
1581         https://bugs.webkit.org/show_bug.cgi?id=178775
1582
1583         To match the meaning of the class.
1584         It was originally meant to be more generic purpose, but as
1585         other classes was introduced, the objective of the class is
1586         now only to handle the life cycle of curl requests.
1587
1588         The delegate is also renamed to CurlRequestSchedulerClient.
1589
1590         Reviewed by Alex Christensen.
1591
1592         * platform/Curl.cmake:
1593         * platform/network/curl/CurlDownload.cpp:
1594         (WebCore::CurlDownload::~CurlDownload):
1595         (WebCore::CurlDownload::willSendRequest):
1596         * platform/network/curl/CurlDownload.h:
1597         * platform/network/curl/CurlRequest.cpp:
1598         (WebCore::CurlRequest::CurlRequest):
1599         (WebCore::CurlRequest::start):
1600         (WebCore::CurlRequest::startWithJobManager):
1601         (WebCore::CurlRequest::cancel):
1602         (WebCore::CurlRequest::callClient):
1603         (WebCore::CurlRequest::didReceiveData):
1604         (WebCore::CurlRequest::didCompleteTransfer):
1605         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
1606         (WebCore::CurlRequest::invokeDidReceiveResponse):
1607         (WebCore::CurlRequest::completeDidReceiveResponse):
1608         (WebCore::CurlRequest::pausedStatusChanged):
1609         (WebCore::CurlRequest::callDelegate): Deleted.
1610         * platform/network/curl/CurlRequest.h:
1611         (WebCore::CurlRequest::create):
1612         (WebCore::CurlRequest::setClient):
1613         (WebCore::CurlRequest::setDelegate): Deleted.
1614         * platform/network/curl/CurlRequestClient.h: Renamed from Source/WebCore/platform/network/curl/CurlRequestDelegate.h.
1615         * platform/network/curl/CurlRequestScheduler.cpp: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.cpp.
1616         (WebCore::CurlJobList::startJobs):
1617         (WebCore::CurlJobList::finishJobs):
1618         (WebCore::CurlRequestScheduler::singleton):
1619         (WebCore::CurlRequestScheduler::add):
1620         (WebCore::CurlRequestScheduler::cancel):
1621         (WebCore::CurlRequestScheduler::callOnWorkerThread):
1622         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
1623         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
1624         (WebCore::CurlRequestScheduler::stopThread):
1625         (WebCore::CurlRequestScheduler::updateJobList):
1626         (WebCore::CurlRequestScheduler::workerThread):
1627         * platform/network/curl/CurlRequestScheduler.h: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.h.
1628         (WebCore::CurlRequestScheduler::~CurlRequestScheduler):
1629         * platform/network/curl/CurlRequestSchedulerClient.h: Added.
1630         (WebCore::CurlRequestSchedulerClient::~CurlRequestSchedulerClient):
1631         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1632         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
1633         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
1634         (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
1635         * platform/network/curl/ResourceHandleCurlDelegate.h:
1636
1637 2017-10-26  Antti Koivisto  <antti@apple.com>
1638
1639         Remove unnecessary whitespace invalidation logic from RenderTreeUpdater
1640         https://bugs.webkit.org/show_bug.cgi?id=178786
1641
1642         Reviewed by Zalan Bujtas.
1643
1644         RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded is a somewhat complex
1645         and confusing function for figuring out if some whitespace-only text node might need to have its
1646         rendering status recomputed. However actually computing if a text renderer is needed is not expensive.
1647         We can simply do it for all whitespace nodes after a sibling mutation.
1648
1649         This also removes a set that could have stale renderer pointers in it (they were never dereferenced).
1650
1651         * rendering/RenderBlock.cpp:
1652         (WebCore::RenderBlock::addChildIgnoringContinuation):
1653
1654             Fix a display:contents bug exposed by this change. With display:contents a text renderer may have an anonymous
1655             inline wrapper and we need to take it into account when the text renderer is the beforeChild.
1656
1657             Tested by imported/w3c/web-platform-tests/css/css-display-3/display-contents-state-change-001.html
1658
1659         * style/RenderTreeUpdater.cpp:
1660         (WebCore::RenderTreeUpdater::updateRenderTree):
1661
1662             Call updateTextRenderer() for all whitespace-only text nodes after a change in siblings.
1663             In normal update case it just figures out quickly (by calling textRendererIsNeeded)
1664             that there are no changes and bails out.
1665
1666         (WebCore::RenderTreeUpdater::updateElementRenderer):
1667         (WebCore::RenderTreeUpdater::updateTextRenderer):
1668         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.
1669
1670             No longer needed. Just mark that there have been changes to siblings instead.
1671
1672         * style/RenderTreeUpdater.h:
1673
1674 2017-10-26  Myles C. Maxfield  <mmaxfield@apple.com>
1675
1676         Mark font palettes as in development
1677         https://bugs.webkit.org/show_bug.cgi?id=178590
1678
1679         Unreviewed.
1680
1681         * features.json:
1682
1683 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
1684
1685         Unreviewed, rolling out r223984.
1686
1687         Caused LayoutTest assertion failures.
1688
1689         Reverted changeset:
1690
1691         "When navigating back to a page, compositing layers may not
1692         use accelerated drawing"
1693         https://bugs.webkit.org/show_bug.cgi?id=178749
1694         https://trac.webkit.org/changeset/223984
1695
1696 2017-10-26  Youenn Fablet  <youenn@apple.com>
1697
1698         Add inspector logging for MediaElementSession autoplay
1699         https://bugs.webkit.org/show_bug.cgi?id=178846
1700
1701         Reviewed by Eric Carlson.
1702
1703         No change of behavior.
1704         Making use of pal Logger in MediaElementSession.
1705         This new logging is limited to autoplay/playback for now.
1706
1707         * html/MediaElementSession.cpp:
1708         (WebCore::MediaElementSession::MediaElementSession):
1709         (WebCore::MediaElementSession::playbackPermitted const):
1710         (WebCore::MediaElementSession::autoplayPermitted const):
1711         (WebCore::MediaElementSession::willLog const):
1712         (WebCore::MediaElementSession::logChannel const):
1713         * html/MediaElementSession.h:
1714
1715 2017-10-26  Keith Miller  <keith_miller@apple.com>
1716
1717         Move ApplePay to unified sources
1718         https://bugs.webkit.org/show_bug.cgi?id=178871
1719
1720         Rubber-stamped by Tim Horton.
1721
1722         Also, add some other missing files.
1723
1724         * SourcesCocoa.txt:
1725         * WebCore.xcodeproj/project.pbxproj:
1726
1727 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
1728
1729         Unreviewed, rolling out r224019.
1730
1731         This change caused API test WebKit.MSEIsPlayingAudio to time
1732         out.
1733
1734         Reverted changeset:
1735
1736         "XMLHttpRequest should not treat file URLs as same origin"
1737         https://bugs.webkit.org/show_bug.cgi?id=178565
1738         https://trac.webkit.org/changeset/224019
1739
1740 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
1741
1742         Unreviewed, rolling out r223994.
1743
1744         The LayoutTest for this change is failing.
1745
1746         Reverted changeset:
1747
1748         "Add service worker handle fetch support for all subresource
1749         requests"
1750         https://bugs.webkit.org/show_bug.cgi?id=178769
1751         https://trac.webkit.org/changeset/223994
1752
1753 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
1754
1755         Unreviewed, rolling out r223908.
1756
1757         Causes LayoutTest crashes with newer SDKs.
1758
1759         Reverted changeset:
1760
1761         "Adopt new secure coding APIs"
1762         https://bugs.webkit.org/show_bug.cgi?id=178484
1763         https://trac.webkit.org/changeset/223908
1764
1765 2017-10-25  Brent Fulgham  <bfulgham@apple.com>
1766
1767         XMLHttpRequest should not treat file URLs as same origin
1768         https://bugs.webkit.org/show_bug.cgi?id=178565
1769         <rdar://problem/11115901>
1770
1771         Reviewed by Ryosuke Niwa.
1772
1773         Do not treat file URLs as same-origin for XHR requests.
1774
1775         Test: fast/xmlhttprequest/xmlhttprequest-access-self-as-file.html
1776
1777         * loader/DocumentThreadableLoader.cpp:
1778         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Use new helper method.
1779         * page/SecurityOrigin.cpp:
1780         (WebCore::SecurityOrigin::requestIsSameOrigin): New method to recognize same-origin
1781         requests, with special handling for XHR.
1782         * page/SecurityOrigin.h:
1783
1784 2017-10-26  Christopher Reid  <chris.reid@sony.com>
1785
1786         Remove scopeguard from platform
1787         https://bugs.webkit.org/show_bug.cgi?id=178681
1788
1789         Reviewed by Brady Eidson.
1790
1791         Replacing platform/ScopeGuard with WTF::ScopeExit.
1792         No new tests, no change in behavior.
1793
1794         * Modules/indexeddb/IDBRequest.cpp:
1795         * Modules/indexeddb/IDBRequest.h:
1796         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1797         * WebCore.xcodeproj/project.pbxproj:
1798         * platform/FileSystem.cpp:
1799         * platform/ScopeGuard.h: Removed.
1800         * platform/network/BlobRegistryImpl.cpp:
1801         * workers/service/ServiceWorkerContainer.cpp:
1802
1803 2017-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1804
1805         REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line
1806         https://bugs.webkit.org/show_bug.cgi?id=178625
1807
1808         Reviewed by Michael Catanzaro.
1809
1810         Once we find the first space, which has the COMMON script, we split the run, and the next ones keep using
1811         COMMON instead of ARABIC because we don't update the current script on every loop iteration. This patch
1812         simplifies the script handling by moving the code back to the loop and always breaking in case of different
1813         scripts, correctly handling INHERITED and COMMON cases and updating the current script when needed.
1814
1815         Covered by existing tests. This improves several tests that have been rebaselined.
1816
1817         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1818         (WebCore::findNextRun):
1819         (WebCore::scriptsAreCompatibleForCharacters): Deleted.
1820
1821 2017-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1822
1823         [MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
1824         https://bugs.webkit.org/show_bug.cgi?id=178819
1825
1826         Reviewed by Xabier Rodriguez-Calvar.
1827
1828         The deadlock may occur when UI thread tries to clear pipeline in
1829         AppendPipeline::clearPlayerPrivate() while parser thread tries to change
1830         pipeline state to pause holding the stream lock in
1831         AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread()
1832
1833         This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
1834
1835         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1836         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1837         Return if there's no player private.
1838
1839 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
1840
1841         Assert that no script is executed during style recalc
1842         https://bugs.webkit.org/show_bug.cgi?id=178845
1843         <rdar://problem/35106129>
1844
1845         Reviewed by Antti Koivisto.
1846
1847         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
1848         to make sure we don't start mutating DOM in the middle of a style update.
1849
1850         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
1851         shadow tree since that happens while updating the style.
1852
1853         No new tests since there should be no behavioral change.
1854
1855         * dom/Document.cpp:
1856         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
1857         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
1858         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
1859         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
1860         scripts which in turn trigger another (recursive) style recalc.
1861         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
1862         NoEventDispatchAssertion.
1863         * dom/Element.cpp:
1864         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
1865         newly cloned element for SVG use element's shadow tree.
1866         (WebCore::Element::cloneElementWithoutChildren): Ditto.
1867         * dom/EventDispatcher.cpp:
1868         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
1869         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
1870         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
1871         pushing or popoing the stack frame.
1872         * svg/SVGUseElement.cpp:
1873         (WebCore::SVGUseElement::clearShadowTree):
1874         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
1875         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
1876         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
1877         (WebCore::SVGUseElement::cloneTarget const): Ditto.
1878         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
1879         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
1880         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
1881
1882 2017-10-25  Keith Miller  <keith_miller@apple.com>
1883
1884         Move platform Cocoa sources to unified sources
1885         https://bugs.webkit.org/show_bug.cgi?id=178851
1886
1887         Rubber-stamped by Tim Horton.
1888
1889         * SourcesCocoa.txt:
1890         * WebCore.xcodeproj/project.pbxproj:
1891
1892 2017-10-25  Keith Miller  <keith_miller@apple.com>
1893
1894         Start moving Cocoa specific unified sources
1895         https://bugs.webkit.org/show_bug.cgi?id=178850
1896
1897         Rubber-stamped by Tim Horton.
1898
1899         * PlatformMac.cmake:
1900         * SourcesCocoa.txt:
1901         * WebCore.xcodeproj/project.pbxproj:
1902
1903 2017-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1904
1905         [HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
1906         https://bugs.webkit.org/show_bug.cgi?id=178788
1907
1908         Reviewed by Michael Catanzaro.
1909
1910         Instead of using the TextRun direction. If the TextRun is ltr, but the harfbuzz buffer is rtl, the character
1911         indexes will be swapped in m_coreTextIndices.
1912
1913         * platform/graphics/ComplexTextController.h:
1914         (WebCore::ComplexTextController::ComplexTextRun::create): Remove the ltr parameter.
1915         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1916         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isLTR using hb_buffer_get_direction().
1917         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Do not pass ltr to ComplexTextRun::create().
1918
1919 2017-10-25  Keith Miller  <keith_miller@apple.com>
1920
1921         Move remaining platform independent sources to unified sources
1922         https://bugs.webkit.org/show_bug.cgi?id=178849
1923
1924         Rubber-stamped by Tim Horton.
1925
1926         * CMakeLists.txt:
1927         * Sources.txt:
1928         * WebCore.xcodeproj/project.pbxproj:
1929
1930 2017-10-25  Keith Miller  <keith_miller@apple.com>
1931
1932         Move plugins and rendering to unified sources
1933         https://bugs.webkit.org/show_bug.cgi?id=178848
1934
1935         Rubber-stamped by Tim Horton.
1936
1937         * CMakeLists.txt:
1938         * Sources.txt:
1939         * WebCore.xcodeproj/project.pbxproj:
1940
1941 2017-10-25  Keith Miller  <keith_miller@apple.com>
1942
1943         Unreviewed, add FEMorphology.cpp back to the regular build after r224003.
1944
1945         * WebCore.xcodeproj/project.pbxproj:
1946
1947 2017-10-25  Keith Miller  <keith_miller@apple.com>
1948
1949         Unreviewed, Windows build fix.
1950
1951         * Sources.txt:
1952
1953 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
1954
1955         Web Inspector: provide a way to enable/disable event listeners
1956         https://bugs.webkit.org/show_bug.cgi?id=177451
1957         <rdar://problem/34994925>
1958
1959         Reviewed by Joseph Pecoraro.
1960
1961         Test: inspector/dom/setEventListenerDisabled.html
1962
1963         * dom/EventTarget.cpp:
1964         (WebCore::EventTarget::fireEventListeners):
1965         Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
1966         callback will not be called.
1967
1968         * inspector/InspectorDOMAgent.h:
1969         * inspector/InspectorDOMAgent.cpp:
1970         (WebCore::InspectorDOMAgent::discardBindings):
1971         (WebCore::InspectorDOMAgent::getEventListenersForNode):
1972         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
1973         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1974         (WebCore::InspectorDOMAgent::willRemoveEventListener):
1975         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
1976         Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
1977         identifying event listeners so they can be referenced from the frontend. We only add items
1978         to this mapping when `getEventListenersForNode` is called, as that is when EventListener
1979         data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
1980         for each EventListener until it is needed. Items are removed whenever an event listener is
1981         removed or when the document changes.
1982
1983         * inspector/InspectorInstrumentation.h:
1984         (WebCore::InspectorInstrumentation::isEventListenerDisabled):
1985         * inspector/InspectorInstrumentation.cpp:
1986         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
1987         (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
1988         Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
1989         actually exists. If not, don't dispatch an event to the frontend as nothing will change.
1990
1991 2017-10-25  Keith Miller  <keith_miller@apple.com>
1992
1993         Move Platform to unified sources.
1994         https://bugs.webkit.org/show_bug.cgi?id=178829
1995
1996         Rubber-stamped by Tim Horton.
1997
1998         * CMakeLists.txt:
1999         * Sources.txt:
2000         * WebCore.xcodeproj/project.pbxproj:
2001         * platform/Cursor.cpp:
2002         * platform/sql/SQLiteDatabase.h:
2003
2004 2017-10-25  Chris Dumez  <cdumez@apple.com>
2005
2006         messageEvent.source can also be a ServiceWorker
2007         https://bugs.webkit.org/show_bug.cgi?id=178839
2008
2009         Reviewed by Brady Eidson.
2010
2011         messageEvent.source can also be a ServiceWorker:
2012         - https://html.spec.whatwg.org/multipage/comms.html#messageeventsource
2013
2014         This enables calling postMessage() from a ServiceWorker via Bug 178794.
2015
2016         * dom/MessageEvent.cpp:
2017         (WebCore::MessageEvent::source const): Deleted.
2018         * dom/MessageEvent.h:
2019         * dom/MessageEvent.idl:
2020
2021 2017-10-25  Ryosuke Niwa  <rniwa@webkit.org>
2022
2023         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
2024         https://bugs.webkit.org/show_bug.cgi?id=178715
2025         <rdar://problem/35144665>
2026
2027         Reviewed by Brent Fulgham.
2028
2029         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
2030         instead of in the middle of collecting a list of stylesheets.
2031
2032         * dom/Document.cpp:
2033         (WebCore::Document::Document): Initialize the newly added timer.
2034         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
2035         handlers may be expecting to see the document after XSLT had been applied.
2036         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
2037         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
2038         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
2039         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
2040         (WebCore::Document::applyXSLTransform): Deleted.
2041         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
2042         inline XSLT and it happens much earlier than implicitClose.
2043         * dom/Document.h:
2044         * dom/ProcessingInstruction.cpp:
2045         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
2046         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
2047         function can be called from a non-script-resilient call stack.
2048         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
2049         * style/StyleScope.cpp:
2050         (WebCore::Style::Scope::collectXSLTransforms): Added.
2051         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
2052         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
2053         * style/StyleScope.h:
2054         * xml/parser/XMLDocumentParserLibxml2.cpp:
2055         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
2056
2057 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
2058
2059         Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
2060         https://bugs.webkit.org/show_bug.cgi?id=178805
2061         <rdar://problem/35176303>
2062
2063         Reviewed by Brian Burg.
2064
2065         No new tests, updated existing tests.
2066
2067         * inspector/InspectorCanvasAgent.cpp:
2068         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2069         If the recording was stopped and had no data, reset the CallTracingActive flag to false.
2070
2071 2017-10-25  Keith Miller  <keith_miller@apple.com>
2072
2073         Move html to unified sources
2074         https://bugs.webkit.org/show_bug.cgi?id=178709
2075
2076         Reviewed by Alex Christensen.
2077
2078         * CMakeLists.txt:
2079         * Sources.txt:
2080         * WebCore.xcodeproj/project.pbxproj:
2081
2082 2017-10-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2083
2084         [Curl] Delete temporally downloaded file when it cancelled
2085         https://bugs.webkit.org/show_bug.cgi?id=134393
2086
2087         Reviewed by Alex Christensen.
2088
2089         * platform/network/curl/CurlRequest.cpp:
2090         (WebCore::CurlRequest::didCancelTransfer):
2091         (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
2092         (WebCore::CurlRequest::closeDownloadFile):
2093         (WebCore::CurlRequest::cleanupDownloadFile):
2094         * platform/network/curl/CurlRequest.h:
2095
2096 2017-10-25  Youenn Fablet  <youenn@apple.com>
2097
2098         Add service worker handle fetch support for all subresource requests
2099         https://bugs.webkit.org/show_bug.cgi?id=178769
2100
2101         Reviewed by Chris Dumez.
2102
2103         Test: http/tests/workers/service/image-fetch.https.html
2104
2105         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
2106         Setting the selected service worker identifier for subresource only at the moment.
2107
2108         Testing is limited to images, future wpt tests should cover other subresource cases.
2109
2110         * loader/DocumentThreadableLoader.cpp:
2111         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2112         * loader/cache/CachedResourceLoader.cpp:
2113         (WebCore::CachedResourceLoader::prepareFetch):
2114         * loader/cache/CachedResourceRequest.cpp:
2115         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
2116         * loader/cache/CachedResourceRequest.h:
2117
2118 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2119
2120         Aliasing of text in CSS specs is blocky and ugly
2121         https://bugs.webkit.org/show_bug.cgi?id=174946
2122         rdar://problem/33594542
2123
2124         Reviewed by Dean Jackson.
2125
2126         The PaintedContentRequest relating to subpixel-antialiased text was failing to be
2127         satisfied if the text content in a composited layer was nested inside descendant
2128         RenderLayers, because RenderLayer::isVisuallyNonEmpty() returned early. If this
2129         function is passed a request, we can't return until we've satisfied the request
2130         (which triggers the checking of descendant layers).
2131
2132         Test: compositing/contents-format/subpixel-antialiased-nested-layer.html
2133
2134         * rendering/RenderLayer.cpp:
2135         (WebCore::RenderLayer::calculateClipRects const):
2136
2137 2017-10-25  Chris Dumez  <cdumez@apple.com>
2138
2139         Unreviewed, add missing copyright header to ServiceWorkerClientType.idl.
2140
2141         * workers/service/ServiceWorkerClientType.idl:
2142 =======
2143         * platform/Cursor.cpp: Previously, excluded on iOS now wrapped in #if
2144         * platform/sql/SQLiteDatabase.h: remove debugging data member from release builds.
2145 >>>>>>> build fixes
2146
2147 2017-10-25  Chris Dumez  <cdumez@apple.com>
2148
2149         Make toJS() do the right thing for ServiceWorkerClient
2150         https://bugs.webkit.org/show_bug.cgi?id=178816
2151
2152         Reviewed by Youenn Fablet.
2153
2154         Make toJS() do the right thing for ServiceWorkerClient. In particular,
2155         it needs to construct a JSServiceWorkerWindowClient wrapper if the
2156         implementation object is a ServiceWorkerWindowClient.
2157
2158         Also, ServiceWorkerClient does not need to be an ActiveDOMObject as
2159         it does not have any long-running tasks. Make it a ContextDestructionObject
2160         instead for now.
2161
2162         * CMakeLists.txt:
2163         * DerivedSources.make:
2164         * Sources.txt:
2165         * WebCore.xcodeproj/project.pbxproj:
2166         * workers/service/ServiceWorkerClient.cpp:
2167         (WebCore::ServiceWorkerClient::postMessage):
2168         * workers/service/ServiceWorkerClient.h:
2169         (WebCore::ServiceWorkerClient::create):
2170         * workers/service/ServiceWorkerClient.idl:
2171         * workers/service/ServiceWorkerClientType.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
2172         * workers/service/ServiceWorkerClientType.idl: Added.
2173         * workers/service/ServiceWorkerClients.h:
2174         * workers/service/ServiceWorkerClients.idl:
2175
2176 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2177
2178         When navigating back to a page, compositing layers may not use accelerated drawing
2179         https://bugs.webkit.org/show_bug.cgi?id=178749
2180         rdar://problem/35158946
2181
2182         Reviewed by Dean Jackson.
2183
2184         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
2185         occurred on back navigation, related to the ordering of style recalcs and layout.
2186
2187         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
2188         its cacheAcceleratedCompositingFlags(), so any layers created during style update
2189         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
2190         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
2191
2192         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
2193         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
2194         the TileController.
2195
2196         Test: compositing/accelerated-layers-after-back.html
2197
2198         * page/FrameView.cpp:
2199         (WebCore::FrameView::updateCompositingLayersAfterLayout):
2200         * platform/graphics/ca/GraphicsLayerCA.cpp:
2201         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2202         * rendering/RenderLayerCompositor.cpp:
2203         (WebCore::RenderLayerCompositor::willRecalcStyle):
2204         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2205         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2206         * rendering/RenderLayerCompositor.h:
2207
2208 2017-10-25  Youenn Fablet  <youenn@apple.com>
2209
2210         Enable ServiceWorker to fetch resources
2211         https://bugs.webkit.org/show_bug.cgi?id=178673
2212
2213         Reviewed by Brady Eidson.
2214
2215         Test: http/tests/workers/service/service-worker-fetch.html
2216
2217         Allow reusing of EmptyFrameLoaderClient for network loading in WebKit Service Worker environment.
2218         Allow overriding the creation of a document loader, pageID, frameID and sessionID getters.
2219
2220         Allow the possibility to create synthetic documents for all ports.
2221
2222         Beefing up ServiceWorkerThreadProxy as it owns a Document and a Page that do nothing but server
2223         the purpose of loading resources for a service worker thread.
2224
2225         * WebCore.xcodeproj/project.pbxproj:
2226         * loader/DocumentLoader.h:
2227         (WebCore::DocumentLoader::setResponse):
2228         * loader/EmptyClients.cpp:
2229         (WebCore::EmptyFrameLoaderClient::sessionID const):
2230         (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
2231         (WebCore::createEmptyFrameNetworkingContext):
2232         * loader/EmptyClients.h:
2233         * loader/EmptyFrameLoaderClient.h: Added.
2234         * loader/FrameLoader.cpp:
2235         (WebCore::FrameLoader::initForSynthesizedDocument):
2236         * loader/FrameLoader.h:
2237         * loader/FrameLoaderClient.h:
2238         * workers/service/context/ServiceWorkerThread.cpp:
2239         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2240         (WebCore::m_workerObjectProxy):
2241         * workers/service/context/ServiceWorkerThread.h:
2242         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2243         (WebCore::ServiceWorkerThreadProxy::create):
2244         (WebCore::createPageForServiceWorker):
2245         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
2246         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
2247         * workers/service/context/ServiceWorkerThreadProxy.h:
2248         Test: http/tests/workers/service/service-worker-fetch.html
2249
2250 2017-10-25  Jer Noble  <jer.noble@apple.com>
2251
2252         UNPACK_FLIP_Y is broken for MSE-backed videos
2253         https://bugs.webkit.org/show_bug.cgi?id=178774
2254
2255         Reviewed by Dean Jackson.
2256
2257         The global GLSL variable gl_Position can apparently only be set once, and any modifications
2258         made after that initial set are ignored. So rather than implement flipping by changing
2259         gl_Position.y, flip the texture coordinates instead.
2260
2261         Drive-by fix: some of the constants used in VideoTextureCopierCV are not defined on older
2262         macOS versions, so make them optional.
2263
2264         Tests: fast/canvas/webgl/texImage2D-mse-flipY-false.html
2265                fast/canvas/webgl/texImage2D-mse-flipY-true.html
2266
2267         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2268         (WebCore::transferFunctionFromString):
2269         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
2270         * platform/cocoa/CoreVideoSoftLink.cpp:
2271         * platform/cocoa/CoreVideoSoftLink.h:
2272
2273 2017-10-25  Chris Dumez  <cdumez@apple.com>
2274
2275         [Service Worker] Add stubs for serviceWorkerClient.type
2276         https://bugs.webkit.org/show_bug.cgi?id=178812
2277
2278         Reviewed by Youenn Fablet.
2279
2280         Add stubs for serviceWorkerClient.type to match the latest specification:
2281         - https://w3c.github.io/ServiceWorker/#enumdef-clienttype
2282
2283         * CMakeLists.txt:
2284         * DerivedSources.make:
2285         * Sources.txt:
2286         * WebCore.xcodeproj/project.pbxproj:
2287         * workers/service/ServiceWorkerClient.cpp:
2288         (WebCore::ServiceWorkerClient::type const):
2289         * workers/service/ServiceWorkerClient.h:
2290         * workers/service/ServiceWorkerClient.idl:
2291         * workers/service/ServiceWorkerClientType.h: Added.
2292         * workers/service/ServiceWorkerClientType.idl: Added.
2293         * workers/service/ServiceWorkerClients.h:
2294         * workers/service/ServiceWorkerClients.idl:
2295
2296 2017-10-24  Keith Miller  <keith_miller@apple.com>
2297
2298         Move mathml and page to unified souces
2299         https://bugs.webkit.org/show_bug.cgi?id=178770
2300
2301         Rubber-stamped by Tim Horton.
2302
2303         * CMakeLists.txt:
2304         * Sources.txt:
2305         * WebCore.xcodeproj/project.pbxproj:
2306
2307 2017-10-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2308
2309         fast/images/animated-gif-paint-after-animation.html flaky crash
2310         https://bugs.webkit.org/show_bug.cgi?id=178510
2311
2312         Reviewed by Said Abou-Hallawa.
2313
2314         ScalableImageDecoder was accessed from the main thread and the
2315         image decoding thread without a mutex.
2316
2317         No new tests because there is no behavior change.
2318
2319         * platform/image-decoders/ScalableImageDecoder.h: Add m_mutex. Lock the mutex in setData.
2320         * platform/image-decoders/ScalableImageDecoder.cpp:
2321         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): Lock the mutex.
2322         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): Ditto.
2323         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
2324         (WebCore::ScalableImageDecoder::frameDurationAtIndex const): Ditto.
2325         (WebCore::ScalableImageDecoder::createFrameImageAtIndex): Ditto.
2326
2327 2017-10-25  Chris Dumez  <cdumez@apple.com>
2328
2329         Add support for unregistering a service worker
2330         https://bugs.webkit.org/show_bug.cgi?id=178735
2331
2332         Reviewed by Brady Eidson.
2333
2334         Add support for unregistering a service worker:
2335         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
2336
2337         Test: http/tests/workers/service/basic-unregister.https.html
2338
2339         * workers/service/ServiceWorkerContainer.cpp:
2340         (WebCore::ServiceWorkerContainer::addRegistration):
2341         (WebCore::ServiceWorkerContainer::removeRegistration):
2342         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
2343         * workers/service/ServiceWorkerContainer.h:
2344         * workers/service/ServiceWorkerJob.cpp:
2345         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
2346         * workers/service/ServiceWorkerJob.h:
2347         * workers/service/ServiceWorkerJobClient.h:
2348         * workers/service/ServiceWorkerJobData.h:
2349         (WebCore::ServiceWorkerJobData::encode const):
2350         (WebCore::ServiceWorkerJobData::decode):
2351         * workers/service/ServiceWorkerJobType.h:
2352         * workers/service/ServiceWorkerRegistration.cpp:
2353         (WebCore::containerForScriptExecutionContext):
2354         (WebCore::ServiceWorkerRegistration::unregister):
2355         * workers/service/server/SWClientConnection.cpp:
2356         (WebCore::SWClientConnection::registrationJobResolvedInServer):
2357         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
2358         * workers/service/server/SWClientConnection.h:
2359         * workers/service/server/SWServer.cpp:
2360         (WebCore::SWServer::resolveRegistationJob):
2361         (WebCore::SWServer::resolveUnregistrationJob):
2362         * workers/service/server/SWServer.h:
2363         * workers/service/server/SWServerRegistration.cpp:
2364         (WebCore::SWServerRegistration::scriptContextStarted):
2365         (WebCore::SWServerRegistration::startNextJob):
2366         (WebCore::SWServerRegistration::runUnregisterJob):
2367         (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
2368         (WebCore::SWServerRegistration::resolveWithUnregistrationResultOnMainThread):
2369         (WebCore::SWServerRegistration::resolveCurrentRegistrationJob):
2370         (WebCore::SWServerRegistration::resolveCurrentUnregistrationJob):
2371         * workers/service/server/SWServerRegistration.h:
2372
2373 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2374
2375         MediaSessionManager* needs to catch Obj-C exceptions
2376         https://bugs.webkit.org/show_bug.cgi?id=178813
2377
2378         Reviewed by Tim Horton.
2379
2380         Wrap all calls out to Objective-C with BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS.
2381
2382         * platform/audio/ios/MediaSessionManagerIOS.mm:
2383         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
2384         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
2385         (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
2386         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
2387         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
2388         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
2389         (-[WebMediaSessionHelper allocateVolumeView]):
2390         (-[WebMediaSessionHelper initWithCallback:]):
2391         * platform/audio/mac/MediaSessionManagerMac.mm:
2392         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2393
2394 2017-10-25  Andy Estes  <aestes@apple.com>
2395
2396         [Payment Request] Implement the "user aborts the payment request" algorithm
2397         https://bugs.webkit.org/show_bug.cgi?id=178810
2398
2399         Reviewed by Tim Horton.
2400
2401         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2402         (WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
2403         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2404         * Modules/paymentrequest/PaymentRequest.cpp:
2405         (WebCore::PaymentRequest::cancel):
2406         * Modules/paymentrequest/PaymentRequest.h:
2407         * testing/MockPaymentCoordinator.cpp:
2408         (WebCore::MockPaymentCoordinator::cancelPayment):
2409         * testing/MockPaymentCoordinator.h:
2410         * testing/MockPaymentCoordinator.idl:
2411
2412 2017-10-25  Jer Noble  <jer.noble@apple.com>
2413
2414         Autoplay muted videos still stop playback of other streaming apps in the background
2415         https://bugs.webkit.org/show_bug.cgi?id=177920
2416
2417         Reviewed by Eric Carlson.
2418
2419         When creating a new <video> or <audio> element, the global AudioSession can sometimes have
2420         its sessionCategory() set to "MediaPlayback", even if the element does not yet have a
2421         source. This is because the constructor for the MediaElementSession is called before
2422         m_isPlayingToWirelessTarget is initialized, and so in the MediaElementSession constructor,
2423         the media element's m_isPlayingToWirelessTarget ivar is sometimes (uninitialized) true.
2424
2425         We could move the MediaElementSession ivar to the very end of the header, so it's
2426         initialized last, but that still leaves the possibility of the MediaElementSession et. all
2427         calling into the HTMLMediaElement before it's subclass's constructors have a chance to
2428         initialize their own ivars (much less their vtables). So instead, we'll create and set the
2429         MediaElementSession in a finishInitialization() method called from the HTMLVideoElement and
2430         HTMLAudioElement's create() factory methods.
2431
2432         * html/HTMLAudioElement.cpp:
2433         (WebCore::HTMLAudioElement::create):
2434         * html/HTMLMediaElement.cpp:
2435         (WebCore::HTMLMediaElement::HTMLMediaElement):
2436         (WebCore::HTMLMediaElement::finishInitialization):
2437         * html/HTMLMediaElement.h:
2438         * html/HTMLVideoElement.cpp:
2439         (WebCore::HTMLVideoElement::create):
2440
2441 2017-10-25  Javier Fernandez  <jfernandez@igalia.com>
2442
2443         [css-grid] Avoid clearing the overrideContainingBlockWidth if possible
2444         https://bugs.webkit.org/show_bug.cgi?id=178260
2445
2446         Reviewed by Sergio Villar Senin.
2447
2448         Since the intrinsic width computation uses the same logic than the
2449         track sizing algorithm we are clearing the overrideContainingBlockWidth
2450         of some grid items that are required to laid out them properly.
2451
2452         It's very uncommon that any intrinsic size computation isn't performed
2453         as part of a layout process. However, if it happens, once cleared the
2454         overrideContainingBlockWidth it may lead to an incorrect layout of the
2455         affected grid items.
2456
2457         This change is a defensive approach to avoid the issues caused by
2458         such off-layout preferred size requests, which may imply recomputing
2459         the grid container intrinsic size.
2460
2461         No new tests, because we are only removing some redundant logic.
2462
2463         * rendering/GridTrackSizingAlgorithm.cpp:
2464         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
2465         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
2466         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2467         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
2468         (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
2469         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
2470         * rendering/GridTrackSizingAlgorithm.h:
2471
2472 2017-10-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2473
2474         Unreviewed follow up changing one more enum value as discussed in the bug
2475         https://bugs.webkit.org/show_bug.cgi?id=177810
2476
2477         * platform/glib/LowPowerModeNotifierGLib.cpp:
2478         (WebCore::LowPowerModeNotifier::updateState): use NONE instead of DISCHARGING, to ensure
2479         it will build even with older upower.
2480
2481 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
2482
2483         Make SERVICE_WORKER feature buildable on GTK, WPE
2484         https://bugs.webkit.org/show_bug.cgi?id=178574
2485
2486         Reviewed by Carlos Garcia Campos.
2487
2488         * CMakeLists.txt: Add missing include paths and files to the build.
2489         * Sources.txt: Add missing files to the build.
2490         * WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
2491         JSFetchEventCustom.cpp targets, they're now built via unified sources.
2492         * bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
2493         with the ENABLE(SERVICE_WORKER) guards.
2494
2495 2017-10-24  Alejandro G. Castro  <alex@igalia.com>
2496
2497         Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
2498         https://bugs.webkit.org/show_bug.cgi?id=178721
2499
2500         Reviewed by Youenn Fablet.
2501
2502         Assert when we reach those situations and return some value after that to avoid warning.
2503
2504         No new tests, this is a clean up.
2505
2506         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2507         (WebCore::sessionDescriptionType):
2508         (WebCore::signalingState):
2509         (WebCore::toRTCIceConnectionState):
2510         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2511         (WebCore::bundlePolicyfromConfiguration):
2512         (WebCore::iceTransportPolicyfromConfiguration):
2513
2514 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
2515
2516         RenderSVGModelObject::checkIntersection triggers layout
2517         https://bugs.webkit.org/show_bug.cgi?id=178710
2518
2519         Reviewed by Simon Fraser.
2520
2521         Fixed the bug that checkIntersection and checkEnclosure no longer updates the layout after r223882.
2522
2523         Test: svg/custom/check-intersection-basic.svg
2524
2525         * svg/SVGSVGElement.cpp:
2526         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
2527         (WebCore::SVGSVGElement::checkIntersection):
2528         (WebCore::SVGSVGElement::checkEnclosure):
2529         * svg/SVGSVGElement.h:
2530
2531 2017-10-24  Andy Estes  <aestes@apple.com>
2532
2533         [Apple Pay] Implement a paymentmethodselected event for PaymentRequest
2534         https://bugs.webkit.org/show_bug.cgi?id=178765
2535
2536         Reviewed by Tim Horton.
2537
2538         When the Apple Pay payment method changes, fire an applepaypaymentmethodchanged event on the
2539         PaymentRequest object. The event has a paymentMethod property and an updateWith() method
2540         which behaves identically to PaymentRequestUpdateEvent.updateWith().
2541
2542         Test: http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html
2543
2544         * DerivedSources.make:
2545         * Modules/applepay/ApplePayPaymentMethod.idl:
2546         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
2547         * Modules/applepay/PaymentMethod.h:
2548         (WebCore::PaymentMethod::PaymentMethod): Deleted.
2549         (WebCore::PaymentMethod::pkPaymentMethod const): Deleted.
2550         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2551         (WebCore::ApplePayPaymentHandler::detailsUpdated):
2552         (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
2553         (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
2554         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2555         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Added.
2556         (WebCore::ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent):
2557         (WebCore::ApplePayPaymentMethodUpdateEvent::eventInterface const):
2558         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Added.
2559         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl: Added.
2560         * Modules/paymentrequest/PaymentHandler.h:
2561         * Modules/paymentrequest/PaymentRequest.cpp:
2562         (WebCore::PaymentRequest::shippingAddressChanged):
2563         (WebCore::PaymentRequest::shippingOptionChanged):
2564         (WebCore::PaymentRequest::dispatchEvent):
2565         (WebCore::PaymentRequest::updateWith):
2566         (WebCore::PaymentRequest::settleDetailsPromise):
2567         (WebCore::PaymentRequest::dispatchUpdateEvent): Deleted.
2568         * Modules/paymentrequest/PaymentRequest.h:
2569         * Modules/paymentrequest/PaymentRequest.idl:
2570         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
2571         (WebCore::PaymentRequestUpdateEvent::updateWith):
2572         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
2573         * WebCore.xcodeproj/project.pbxproj:
2574         * dom/EventNames.h:
2575         * dom/EventNames.in:
2576         * testing/MockPaymentCoordinator.cpp:
2577         (WebCore::MockPaymentCoordinator::changePaymentMethod):
2578         * testing/MockPaymentCoordinator.h:
2579         * testing/MockPaymentCoordinator.idl:
2580         * testing/MockPaymentMethod.h: Added.
2581
2582 2017-10-24  Youenn Fablet  <youenn@apple.com>
2583
2584         ServiceWorkerClientFetch should return an error that is not null in case of failure
2585         https://bugs.webkit.org/show_bug.cgi?id=178761
2586
2587         Reviewed by Geoffrey Garen.
2588
2589         Covered by existing tests.
2590
2591         As per spec, ServiceWorkerJob should not go through Service Worker Handle Fetch
2592         for fetching scripts.
2593
2594         * workers/WorkerScriptLoader.cpp:
2595         (WebCore::WorkerScriptLoader::loadAsynchronously):
2596         * workers/WorkerScriptLoaderClient.h:
2597         (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const):
2598         * workers/service/ServiceWorkerJob.h:
2599
2600 2017-10-24  Keith Miller  <keith_miller@apple.com>
2601
2602         Move inspector and loader to unified sources.
2603         https://bugs.webkit.org/show_bug.cgi?id=178760
2604
2605         Rubber-stamped by Tim Horton.
2606
2607         * CMakeLists.txt:
2608         * Sources.txt:
2609         * WebCore.xcodeproj/project.pbxproj:
2610
2611 2017-10-24  Alex Christensen  <achristensen@webkit.org>
2612
2613         Fix build after r223940
2614
2615         * inspector/WebConsoleAgent.cpp:
2616
2617 2017-10-24  Alex Christensen  <achristensen@webkit.org>
2618
2619         Fix Windows build after r223929.
2620         https://bugs.webkit.org/show_bug.cgi?id=177027
2621
2622         * inspector/WebConsoleAgent.cpp:
2623         (WebCore::WebConsoleAgent::getLoggingChannels):
2624         Always initialize the variable "level".  Visual studio was complaining about the possibility of not initializing it
2625         but this is only possible if logChannel->level is an invalid enum value.
2626
2627 2017-10-24  Alex Christensen  <achristensen@webkit.org>
2628
2629         Fix Windows build after r223925
2630         https://bugs.webkit.org/show_bug.cgi?id=178687
2631
2632         * html/ImageBitmap.cpp:
2633         (WebCore::interpolationQualityForResizeQuality):
2634         Visual Studio was complaining that not all control paths returned a value.
2635
2636 2017-10-24  Youenn Fablet  <youenn@apple.com>
2637
2638         Enable service worker to use cache storage api
2639         https://bugs.webkit.org/show_bug.cgi?id=178684
2640
2641         Reviewed by Brady Eidson.
2642
2643         Test: http/tests/workers/service/service-worker-cache-api.https.html
2644
2645         Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
2646         Update WorkerCacheStorageConnection to take benefit of that.
2647         This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.
2648
2649         Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
2650         It is in particular responsible to do proxy for loading tasks.
2651         It implements cache API support for service worker by creating a dedicated CacheStorageConnection.
2652
2653         * Modules/cache/WorkerCacheStorageConnection.cpp:
2654         (WebCore::WorkerCacheStorageConnection::create):
2655         (WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
2656         (WebCore::WorkerCacheStorageConnection::doOpen):
2657         (WebCore::WorkerCacheStorageConnection::doRemove):
2658         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
2659         (WebCore::WorkerCacheStorageConnection::reference):
2660         (WebCore::WorkerCacheStorageConnection::dereference):
2661         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
2662         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
2663         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
2664         * WebCore.xcodeproj/project.pbxproj:
2665         * workers/WorkerLoaderProxy.h:
2666         * workers/WorkerMessagingProxy.cpp:
2667         (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
2668         * workers/WorkerMessagingProxy.h:
2669         * workers/service/context/ServiceWorkerThread.cpp:
2670         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2671         * workers/service/context/ServiceWorkerThread.h:
2672         * workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
2673         (WebCore::ServiceWorkerThreadProxy::create):
2674         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
2675         (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
2676         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
2677         (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
2678         * workers/service/context/ServiceWorkerThreadProxy.h: Added.
2679
2680 2017-10-24  Alex Christensen  <achristensen@webkit.org>
2681
2682         Optionally store entire ResourceRequest for ping loads
2683         https://bugs.webkit.org/show_bug.cgi?id=178756
2684
2685         Reviewed by Tim Horton.
2686
2687         No change in behavior.
2688         This uses less memory in the common loading case.
2689         This will be needed for moving appcache loading to the Networking Process.
2690         See https://bugs.webkit.org/show_bug.cgi?id=178540
2691
2692         * loader/cache/CachedResource.cpp:
2693         (WebCore::CachedResource::load):
2694         * loader/cache/CachedResource.h:
2695         (WebCore::CachedResource::setOriginalRequest):
2696         (WebCore::CachedResource::originalRequest const):
2697         (WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
2698         * loader/cache/CachedResourceLoader.cpp:
2699         (WebCore::CachedResourceLoader::requestResource):
2700
2701 2017-10-24  Andy Estes  <aestes@apple.com>
2702
2703         [WebIDL] Support the ExportMacro attribute for dictionaries
2704         https://bugs.webkit.org/show_bug.cgi?id=178752
2705
2706         Reviewed by Sam Weinig.
2707
2708         * bindings/scripts/CodeGeneratorJS.pm:
2709         (GenerateDictionaryHeaderContent):
2710         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
2711         * bindings/scripts/test/TestStandaloneDictionary.idl:
2712
2713 2017-10-24  Eric Carlson  <eric.carlson@apple.com>
2714
2715         Web Inspector: Enable WebKit logging configuration and display
2716         https://bugs.webkit.org/show_bug.cgi?id=177027
2717         <rdar://problem/33964767>
2718
2719         Reviewed by Joseph Pecoraro.
2720
2721         Test: inspector/console/webcore-logging.html
2722
2723         * dom/Document.cpp:
2724         (WebCore::Document::~Document): Stop observing the logger.
2725         (WebCore::Document::logger): Observe the logger.
2726         (WebCore::Document::didLogMessage): Forward logging messages to the inspector.
2727         * dom/Document.h:
2728
2729         * inspector/WebConsoleAgent.cpp:
2730         (WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
2731         (WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
2732         * inspector/WebConsoleAgent.h:
2733
2734         * platform/Logging.cpp:
2735         (WebCore::getLogChannel): New, get a log channel by name.
2736         * platform/Logging.h:
2737
2738 2017-10-24  Dean Jackson  <dino@apple.com>
2739
2740         Attempted build fix for Sierra.
2741
2742         * html/ImageBitmap.cpp:
2743         (WebCore::croppedSourceRectangleWithFormatting):
2744
2745 2017-10-24  Dean Jackson  <dino@apple.com>
2746
2747         Implement resizing options for ImageBitmap rendering
2748         https://bugs.webkit.org/show_bug.cgi?id=178687
2749         <rdar://problem/35135417>
2750
2751         Reviewed by Sam Weinig.
2752
2753         Implement many of the sizing options for createImageBitmap.
2754
2755         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html
2756
2757         * html/ImageBitmap.cpp:
2758         (WebCore::croppedSourceRectangleWithFormatting):
2759
2760             Implement the first bit of the algorithm from
2761             the HTML specification.
2762
2763         (WebCore::outputSizeForSourceRectangle):
2764
2765             ... and then the second bit. Leave the rest in
2766             comments for now.
2767
2768         (WebCore::interpolationQualityForResizeQuality):
2769
2770             Helper function to map ImageBitmapOptions to
2771             GraphicsContext.
2772
2773         (WebCore::ImageBitmap::createPromise):
2774
2775             Implement more of the sizing algorithm.
2776
2777         * html/ImageBitmap.h: Origin tainting is defined to be false by default.
2778
2779 2017-10-24  Chris Dumez  <cdumez@apple.com>
2780
2781         Add initial implementation for serviceWorker.postMessage()
2782         https://bugs.webkit.org/show_bug.cgi?id=178534
2783
2784         Reviewed by Youenn Fablet.
2785
2786         Add initial implementation for serviceWorker.postMessage():
2787         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
2788
2789         Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html
2790
2791         * CMakeLists.txt:
2792         * DerivedSources.make:
2793         * Sources.txt:
2794         * WebCore.xcodeproj/project.pbxproj:
2795         * bindings/js/JSBindingsAllInOne.cpp:
2796         * bindings/js/JSExtendableMessageEvent.cpp: Added.
2797         (WebCore::JSExtendableMessageEvent::data const):
2798         * bindings/js/WebCoreBuiltinNames.h:
2799         * dom/Document.h:
2800         * dom/EventNames.in:
2801         * dom/MessagePortChannel.h:
2802         * dom/ScriptExecutionContext.h:
2803         * workers/WorkerGlobalScope.h:
2804         * workers/service/ExtendableEvent.cpp:
2805         (WebCore::ExtendableEvent::ExtendableEvent):
2806         (WebCore::ExtendableEvent::~ExtendableEvent):
2807         * workers/service/ExtendableEvent.h:
2808         * workers/service/ExtendableMessageEvent.cpp: Added.
2809         (WebCore::ExtendableMessageEvent::create):
2810         (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
2811         (WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
2812         * workers/service/ExtendableMessageEvent.h: Added.
2813         * workers/service/ExtendableMessageEvent.idl: Added.
2814         * workers/service/ServiceWorker.cpp:
2815         (WebCore::ServiceWorker::ServiceWorker):
2816         (WebCore::ServiceWorker::postMessage):
2817         (WebCore::ServiceWorker::state const):
2818         (WebCore::ServiceWorker::scriptExecutionContext const):
2819         * workers/service/ServiceWorker.h:
2820         * workers/service/ServiceWorkerContainer.cpp:
2821         (WebCore::ServiceWorkerContainer::controller const):
2822         * workers/service/ServiceWorkerContainer.h:
2823         * workers/service/ServiceWorkerGlobalScope.cpp:
2824         (WebCore::ServiceWorkerGlobalScope::thread):
2825         * workers/service/ServiceWorkerGlobalScope.h:
2826         (isType):
2827         * workers/service/context/ServiceWorkerThread.cpp:
2828         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
2829         * workers/service/context/ServiceWorkerThread.h:
2830         * workers/service/server/SWClientConnection.h:
2831
2832 2017-10-24  Andy Estes  <aestes@apple.com>
2833
2834         [Payment Request] Implement the "PaymentRequest updated" algorithm
2835         https://bugs.webkit.org/show_bug.cgi?id=178689
2836
2837         Reviewed by Alex Christensen.
2838
2839         Implemented the "PaymentRequest updated" algorithm by firing shippingaddresschange and
2840         shippingoptionchange events at the right times and implementing
2841         PaymentRequestUpdateEvent.updateWith().
2842
2843         Tests: http/tests/paymentrequest/payment-request-change-shipping-address.https.html
2844                http/tests/paymentrequest/payment-request-change-shipping-option.https.html
2845                http/tests/paymentrequest/updateWith-method-pmi-handling.https.html
2846
2847         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2848         (WebCore::convertAndValidate): Added. Converts a PaymentDetailsInit to a
2849         ApplePaySessionPaymentRequest::TotalAndLineItems.
2850         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Created a ShippingContactUpdate
2851         and passed it to PaymentCoordinator::completeShippingContactSelection().
2852         (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): Created a ShippingMethodUpdate and
2853         passed it to PaymentCoordinator::completeShippingMethodSelection().
2854         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2855         * Modules/paymentrequest/PaymentHandler.h:
2856         * Modules/paymentrequest/PaymentRequest.cpp:
2857         (WebCore::checkAndCanonicalizeDetails): Moved the logic for checking and canonicalizing a
2858         PaymentDetailsBase from PaymentRequest::create() to here.
2859         (WebCore::PaymentRequest::create): Called checkAndCanonicalizeDetails().
2860         (WebCore::PaymentRequest::abortWithException): Moved the body of stop() to here and
2861         parameterized the Exception with which to abort m_showPromise.
2862         (WebCore::PaymentRequest::stop): Called abortWithException() with an AbortError.
2863         (WebCore::PaymentRequest::shippingAddressChanged): Called dispatchUpdateEvent() with
2864         shippingaddresschangeEvent.
2865         (WebCore::PaymentRequest::shippingOptionChanged): Ditto with shippingoptionchangeEvent.
2866         (WebCore::PaymentRequest::dispatchUpdateEvent): Created a PaymentRequestUpdateEvent and
2867         dispatched it.
2868         (WebCore::PaymentRequest::updateWith): Added a settle handler to m_detailsPromise.
2869         (WebCore::PaymentRequest::settleDetailsPromise): Updated the PaymentRequest with the new
2870         details and called PaymentHandler::shippingAddressUpdated() or
2871         PaymentHandler::shippingOptionUpdated().
2872         * Modules/paymentrequest/PaymentRequest.h:
2873         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
2874         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
2875         (WebCore::PaymentRequestUpdateEvent::updateWith): Called PaymentRequest::updateWith().
2876         (WebCore::PaymentRequestUpdateEvent::eventInterface const): Returned
2877         PaymentRequestUpdateEventInterfaceType.
2878         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
2879         * Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
2880         * testing/MockPaymentCoordinator.cpp:
2881         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
2882         (WebCore::MockPaymentCoordinator::openPaymentSetup):
2883         (WebCore::MockPaymentCoordinator::completeMerchantValidation): Stopped calling
2884         PaymentCoordinator::didAuthorizePayment().
2885         (WebCore::MockPaymentCoordinator::changeShippingOption): Called
2886         PaymentCoordinator::didSelectShippingMethod().
2887         (WebCore::MockPaymentCoordinator::acceptPayment): Called
2888         PaymentCoordinator::didAuthorizePayment().
2889         * testing/MockPaymentCoordinator.h:
2890         * testing/MockPaymentCoordinator.idl:
2891
2892 2017-10-24  Alex Christensen  <achristensen@webkit.org>
2893
2894         Apply custom header fields from WebsitePolicies to same-domain requests
2895         https://bugs.webkit.org/show_bug.cgi?id=178356
2896         <rdar://problem/31073436>
2897
2898         Reviewed by Brady Eidson.
2899
2900         Covered by new API tests.
2901
2902         * loader/cache/CachedResourceLoader.cpp:
2903         (WebCore::CachedResourceLoader::requestResource):
2904         * platform/network/ResourceRequestBase.cpp:
2905         (WebCore::ResourceRequestBase::setCachePolicy):
2906         (WebCore::ResourceRequestBase::setTimeoutInterval):
2907         (WebCore::ResourceRequestBase::setHTTPMethod):
2908         (WebCore::ResourceRequestBase::setHTTPHeaderField):
2909         (WebCore::ResourceRequestBase::clearHTTPAuthorization):
2910         (WebCore::ResourceRequestBase::clearHTTPContentType):
2911         (WebCore::ResourceRequestBase::clearHTTPReferrer):
2912         (WebCore::ResourceRequestBase::clearHTTPOrigin):
2913         (WebCore::ResourceRequestBase::clearHTTPUserAgent):
2914         (WebCore::ResourceRequestBase::clearHTTPAccept):
2915         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
2916         (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
2917         (WebCore::ResourceRequestBase::setHTTPBody):
2918         (WebCore::ResourceRequestBase::setAllowCookies):
2919         (WebCore::ResourceRequestBase::setPriority):
2920         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
2921         (WebCore::ResourceRequestBase::addHTTPHeaderField):
2922         (WebCore::ResourceRequestBase::setHTTPHeaderFields):
2923         If we only update the platform request when headers are added (or other changes) for HTTP requests,
2924         then the changes will not affect the NSURLRequest that is sent over IPC or visible to the API.
2925         This is necessary for these new tests to work, but it's also of growing importance since our
2926         introduction of WKURLSchemeHandler.
2927
2928 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
2929
2930         Adopt new secure coding APIs
2931         https://bugs.webkit.org/show_bug.cgi?id=178484
2932         <rdar://problem/34837193>
2933
2934         Reviewed by Tim Horton.
2935
2936         Switch to new NSKeyed[Un]Archiver methods that active and use
2937         NSSecureCoding by default.
2938
2939         Most of the new API is wrapped in a set of convenience methods so we can
2940         build without the new API on older systems.
2941
2942         No change in behavior.
2943
2944         * editing/cocoa/EditorCocoa.mm:
2945         (WebCore::archivedDataForAttributedString): Use new convenience method
2946         to archive the string object.
2947         * loader/archive/cf/LegacyWebArchiveMac.mm:
2948         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
2949         use secure coding where possible.
2950         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
2951         * platform/ios/PlatformPasteboardIOS.mm:
2952         (WebCore::PlatformPasteboard::write): Use new secure API.
2953         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
2954         * testing/cocoa/WebArchiveDumpSupport.mm:
2955         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
2956         secure coding API where possible.
2957
2958 2017-10-24  Jeremy Jones  <jeremyj@apple.com>
2959
2960         HTMLMediaElement should iterate HTMLTrackElements consistently.
2961         https://bugs.webkit.org/show_bug.cgi?id=178423
2962         rdar://problem/35044967
2963
2964         Reviewed by Eric Carlson.
2965
2966         No new tests because no expected behavior change.
2967
2968         HTMLMediaElement iterates HTMLTrackElements as children in every place but one, where it iterates them
2969         as descendants. It should always iterate them as children.
2970
2971         * html/HTMLMediaElement.cpp:
2972         (WebCore::HTMLMediaElement::finishParsingChildren):
2973
2974 2017-10-24  Chris Dumez  <cdumez@apple.com>
2975
2976         SerializedScriptValue::deserialize() should take ports as a const Vector&
2977         https://bugs.webkit.org/show_bug.cgi?id=178727
2978
2979         Reviewed by Alex Christensen.
2980
2981         SerializedScriptValue::deserialize() should take ports as a const Vector&, not a Vector&.
2982         It does not modify the input vector.
2983
2984         * bindings/js/JSMessageEventCustom.cpp:
2985         (WebCore::JSMessageEvent::data const):
2986         * bindings/js/SerializedScriptValue.cpp:
2987         (WebCore::CloneDeserializer::deserialize):
2988         (WebCore::CloneDeserializer::CloneDeserializer):
2989         (WebCore::SerializedScriptValue::deserialize):
2990         * bindings/js/SerializedScriptValue.h:
2991
2992 2017-10-24  Konstantin Tokarev  <annulen@yandex.ru>
2993
2994         [MediaFoundation] Videos are always autoplaying for local files
2995         https://bugs.webkit.org/show_bug.cgi?id=178693
2996
2997         Patch by Doug Massay.
2998         Reviewed by Alex Christensen.
2999
3000         r199114 fixes autoplay issue only if starting session invokes
3001         buffering stage. However when local files are played, onBufferingStarted
3002         and onBufferingStopped are not called, and video is not paused.
3003
3004         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3005         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
3006         (WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
3007         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3008
3009 2017-10-24  Matt Lewis  <jlewis3@apple.com>
3010
3011         Unreviewed, rolling out r223889.
3012
3013         This caused multiple crashes on all platforms
3014
3015         Reverted changeset:
3016
3017         "Adopt new secure coding APIs"
3018         https://bugs.webkit.org/show_bug.cgi?id=178484
3019         https://trac.webkit.org/changeset/223889
3020
3021 2017-10-24  Antti Koivisto  <antti@apple.com>
3022
3023         Create inline wrappers for before/after pseudo elements that have display:contents
3024         https://bugs.webkit.org/show_bug.cgi?id=178722
3025
3026         Reviewed by Ryosuke Niwa.
3027
3028         We can handle before and after pseudo elements with display:contents by giving them
3029         inline renderers with style inherited from display:contents style. This removes
3030         need for complicated logic for this case and handles everything correctly.
3031
3032         This is a better approach and replaces the one taken in bug 178584.
3033         It also fixes two display:contents WPTs.
3034
3035         * dom/PseudoElement.h:
3036
3037             There is no need to track content renderers separately anymore. They always descendants of
3038             pseudo element's renderer (which is an inline wrapper in case of display:contents).
3039
3040         * rendering/style/RenderStyle.cpp:
3041         (WebCore::RenderStyle::copyContentFrom):
3042         * rendering/style/RenderStyle.h:
3043         * style/RenderTreeUpdaterGeneratedContent.cpp:
3044         (WebCore::createContentRenderers):
3045         (WebCore::updateStyleForContentRenderers):
3046         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
3047         (WebCore::removeAndDestroyContentRenderers): Deleted.
3048
3049             Since content renderers are now always descendants of the pseudo renderer
3050             there is no need for a separate destruction path.
3051
3052         * style/StyleTreeResolver.cpp:
3053         (WebCore::Style::TreeResolver::resolvePseudoStyle):
3054
3055             Create ElementUpdate with a style that will produce an inline wrapper.
3056
3057 2017-10-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3058
3059         [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
3060         https://bugs.webkit.org/show_bug.cgi?id=178713
3061         <rdar://problem/35115906>
3062
3063         Reviewed by Eric Carlson.
3064
3065         Loading AVFoundation should not be required to answer the question of MediaPlayer::isAvailable() on iOS, where
3066         both AVFoundation and CoreMedia frameworks should always exist. As such, we can bail early and return true to
3067         avoid always dynamically loading AVFoundation and CoreMedia.
3068
3069         * platform/graphics/MediaPlayer.cpp:
3070         (WebCore::MediaPlayer::isAvailable):
3071
3072 2017-10-24  Antoine Quint  <graouts@apple.com>
3073
3074         RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
3075         https://bugs.webkit.org/show_bug.cgi?id=178716
3076         <rdar://problem/35112900>
3077
3078         Reviewed by Dean Jackson.
3079
3080         * rendering/RenderThemeCocoa.mm:
3081         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
3082
3083 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
3084
3085         SizesAttributeParser::SizesAttributeParser triggers layout
3086         https://bugs.webkit.org/show_bug.cgi?id=178712
3087
3088         Reviewed by Antti Koivisto.
3089
3090         Revert r213711 as this change introduced an unwated synchronous layout inside Node::insertedIntoAncestor.
3091
3092         The test had been marked as timing out since r191379 and changed to failing expectation in r199225
3093         as the test result's error message changes from run to run.
3094
3095         Disabled Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
3096                         had been marked failing since r199225, prior to which it was marked as timeout in r191379.
3097                         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
3098                         is now marked as flaky.
3099
3100         * css/parser/SizesAttributeParser.cpp:
3101         (WebCore::SizesAttributeParser::SizesAttributeParser):
3102
3103 2017-10-24  Keith Miller  <keith_miller@apple.com>
3104
3105         Unreviewed, fix internal iOS build.
3106
3107         * Sources.txt:
3108
3109 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
3110
3111         Adopt new secure coding APIs
3112         https://bugs.webkit.org/show_bug.cgi?id=178484
3113         <rdar://problem/34837193>
3114
3115         Reviewed by Tim Horton.
3116
3117         Switch to new NSKeyed[Un]Archiver methods that active and use
3118         NSSecureCoding by default.
3119
3120         Most of the new API is wrapped in a set of convenience methods so we can
3121         build without the new API on older systems.
3122
3123         No change in behavior.
3124
3125         * editing/cocoa/EditorCocoa.mm:
3126         (WebCore::archivedDataForAttributedString): Use new convenience method
3127         to archive the string object.
3128         * loader/archive/cf/LegacyWebArchiveMac.mm:
3129         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
3130         use secure coding where possible.
3131         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
3132         * platform/ios/PlatformPasteboardIOS.mm:
3133         (WebCore::PlatformPasteboard::write): Use new secure API.
3134         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
3135         * testing/cocoa/WebArchiveDumpSupport.mm:
3136         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
3137         secure coding API where possible.
3138
3139 2017-10-24  Miguel Gomez  <magomez@igalia.com>
3140
3141         [GTK][X11] Windy.com shows always straight wind lines
3142         https://bugs.webkit.org/show_bug.cgi?id=176718
3143
3144         Reviewed by Carlos Garcia Campos.
3145
3146         WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2
3147         and a core profile. In that case, we need to replace it with GL_RG and swizzle the color
3148         components appropriately.
3149
3150         No new behavior.
3151
3152         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3153         (WebCore::GraphicsContext3D::texImage2D):
3154         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3155         (WebCore::GraphicsContext3D::texSubImage2D):
3156
3157 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
3158
3159         DocumentOrderedMap::add should release assert that tree scopes match
3160         https://bugs.webkit.org/show_bug.cgi?id=178708
3161
3162         Reviewed by Antti Koivisto.
3163
3164         Assert that the tree scope of element matches the given tree scope instead of asserting that
3165         element is in tree scope, and replaced the use of RELEASE_ASSERT by the newly added
3166         RELEASE_ASSERT_WITH_SECURITY_IMPLICATION to clarify the semantics of these assertions.
3167
3168         Also removed now redudnant early exits which would never execute due to release assertions.
3169
3170         * dom/DocumentOrderedMap.cpp:
3171         (WebCore::DocumentOrderedMap::add):
3172         (WebCore::DocumentOrderedMap::remove):
3173         (WebCore::DocumentOrderedMap::get const):
3174
3175 2017-10-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3176
3177         -Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
3178         https://bugs.webkit.org/show_bug.cgi?id=178698
3179
3180         Reviewed by Joseph Pecoraro.
3181
3182         * inspector/InspectorIndexedDBAgent.cpp:
3183
3184 2017-10-24  Antoine Quint  <graouts@apple.com>
3185
3186         [Web Animations] Add basic timing and target properties
3187         https://bugs.webkit.org/show_bug.cgi?id=178674
3188
3189         Reviewed by Dean Jackson.
3190
3191         We add three new interfaces to expose enough properties to establish basic timing properties,
3192         a start time and duration, and the target of an animation. The startTime property is set on
3193         the Animation object, the target is set on the KeyframeEffect set as the effect property on
3194         the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.
3195
3196         Tests: webanimations/animation-effect-timing.html
3197                webanimations/animation-effect.html
3198                webanimations/animation-interface-effect-property.html
3199                webanimations/animation-interface-start-time-property.html
3200                webanimations/keyframe-effect-interface-timing-duration.html
3201                webanimations/keyframe-effect.html
3202
3203         * CMakeLists.txt:
3204         * DerivedSources.make:
3205         * Sources.txt:
3206         * WebCore.xcodeproj/project.pbxproj:
3207         * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
3208         (WebCore::AnimationEffect::AnimationEffect):
3209         (WebCore::AnimationEffect::~AnimationEffect):
3210         * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
3211         (WebCore::AnimationEffect::isKeyframeEffect const):
3212         (WebCore::AnimationEffect::timing const):
3213         (WebCore::AnimationEffect::classType const):
3214         * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
3215         * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
3216         (WebCore::AnimationEffectTiming::create):
3217         (WebCore::AnimationEffectTiming::AnimationEffectTiming):
3218         (WebCore::AnimationEffectTiming::~AnimationEffectTiming):
3219         * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
3220         * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
3221         * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
3222         (WebCore::KeyframeEffect::create):
3223         (WebCore::KeyframeEffect::KeyframeEffect):
3224         * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
3225         * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
3226         * animation/WebAnimation.cpp:
3227         (WebCore::WebAnimation::setEffect):
3228         * animation/WebAnimation.h:
3229         * animation/WebAnimation.idl:
3230         * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
3231         (WebCore::toJSNewlyCreated):
3232         (WebCore::toJS):
3233         * bindings/js/WebCoreBuiltinNames.h:
3234
3235 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
3236
3237         RenderSVGModelObject::checkIntersection triggers layout
3238         https://bugs.webkit.org/show_bug.cgi?id=178710
3239
3240         Reviewed by Antti Koivisto.
3241
3242         Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.
3243
3244         * rendering/svg/RenderSVGModelObject.cpp:
3245         (WebCore::getElementCTM):
3246         * svg/SVGSVGElement.cpp:
3247         (WebCore::SVGSVGElement::getEnclosureList):
3248
3249 2017-10-24  Nan Wang  <n_wang@apple.com>
3250
3251         AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
3252         https://bugs.webkit.org/show_bug.cgi?id=178697
3253
3254         Reviewed by Chris Fleizach.
3255
3256         When we are calling _accessibilityMinValue and _accessibilityMaxValue on iOS, 
3257         it might cause crash if the AX object has already been detached. Fixed this 
3258         by adding the necessary checks.
3259
3260         Test: accessibility/ios-simulator/slider-min-value-crash.html
3261
3262         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3263         (-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
3264         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
3265
3266 2017-10-23  Keith Miller  <keith_miller@apple.com>
3267
3268         Unreviewed, restore unneeded all in ones.
3269
3270         * CMakeLists.txt:
3271
3272 2017-10-23  Commit Queue  <commit-queue@webkit.org>
3273
3274         Unreviewed, rolling out r223870 and r223871.
3275         https://bugs.webkit.org/show_bug.cgi?id=178702
3276
3277         broke the windows build (Requested by keith_miller on
3278         #webkit).
3279
3280         Reverted changesets:
3281
3282         "Add html, inspector, loader to unified sources"
3283         https://bugs.webkit.org/show_bug.cgi?id=178695
3284         https://trac.webkit.org/changeset/223870
3285
3286         "Unrievwed, fix windows build."
3287         https://trac.webkit.org/changeset/223871
3288
3289 2017-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3290
3291         Unreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
3292         https://bugs.webkit.org/show_bug.cgi?id=178618
3293         <rdar://problem/35108852>
3294
3295         * platform/MIMETypeRegistry.cpp:
3296         (WebCore::initializeSupportedImageMIMETypes):
3297
3298 2017-10-23  Keith Miller  <keith_miller@apple.com>
3299
3300         Unrievwed, fix windows build.
3301
3302         * CMakeLists.txt:
3303
3304 2017-10-23  Keith Miller  <keith_miller@apple.com>
3305
3306         Add html, inspector, loader to unified sources
3307         https://bugs.webkit.org/show_bug.cgi?id=178695
3308
3309         Rubber-stamped by Tim Horton.
3310
3311         * CMakeLists.txt:
3312         * Sources.txt:
3313         * WebCore.xcodeproj/project.pbxproj:
3314
3315 2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>
3316
3317         Web Inspector: Remove unused Console.setMonitoringXHREnabled
3318         https://bugs.webkit.org/show_bug.cgi?id=178617
3319
3320         Reviewed by Sam Weinig.
3321
3322         * inspector/InspectorInstrumentation.cpp:
3323         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
3324         * inspector/InspectorInstrumentation.h:
3325         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
3326         * inspector/WebConsoleAgent.cpp:
3327         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
3328         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
3329         * inspector/WebConsoleAgent.h:
3330         Remove XHR monitoring code.
3331
3332         * xml/XMLHttpRequest.h:
3333         * xml/XMLHttpRequest.cpp:
3334         (WebCore::XMLHttpRequest::send):
3335         (WebCore::XMLHttpRequest::didFinishLoading):
3336         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
3337         * xml/XMLHttpRequest.idl:
3338         Remove now unused state on XHR and ExecState requirement for send().
3339
3340 2017-10-23  Keith Miller  <keith_miller@apple.com>
3341
3342         Add dom, editing, fileapi, and history to unified sources
3343         https://bugs.webkit.org/show_bug.cgi?id=178694
3344
3345         Rubber-stamped by Tim Horton.
3346
3347         * CMakeLists.txt:
3348         * Sources.txt:
3349         * WebCore.xcodeproj/project.pbxproj:
3350
3351 2017-10-23  Keith Miller  <keith_miller@apple.com>
3352
3353         Move bridge, contentextensions, crypto, and css to unified sources.
3354         https://bugs.webkit.org/show_bug.cgi?id=178691
3355
3356         Reviewed by Tim Horton.
3357
3358         * CMakeLists.txt:
3359         * Sources.txt:
3360         * WebCore.xcodeproj/project.pbxproj:
3361
3362 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3363
3364         Unreviewed, fix the Windows build after r223860
3365
3366         UTIUtilities only exists on Cocoa platforms, so we need to guard it accordingly.
3367
3368         * platform/MIMETypeRegistry.cpp:
3369         (WebCore::initializeSupportedImageMIMETypes):
3370
3371 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3372
3373         [iOS] DocumentWriter::createDocument can spend ~100ms unnecessarily converting image UTIs to MIME types
3374         https://bugs.webkit.org/show_bug.cgi?id=178618
3375         <rdar://problem/35108852>
3376
3377         Reviewed by Said Abou-Hallawa.
3378
3379         Currently, in setting up a new Document, DocumentWriter::createDocument() always asks whether or not the
3380         Document should be a PDF document by calling MIMETypeRegistry::isPDFMIMEType(), which forces lazy initialization
3381         of every MIME type dictionary (e.g. image types, PDF types, JavaScript types, etc.). As evidenced by traces,
3382         this can be an expensive operation on certain devices.
3383
3384         This patch implements two optimizations. First, we refactor the initializeSupportedImageMIMETypes() helper to
3385         stop asking for MIMETypeForImageSourceType for each of the supported UTIs. This is because the known MIME types
3386         corresponding to these hard-coded UTI types is a fixed set anyways, so we can simply iterate over a constant
3387         array of MIME types and populate the supported image (and image resource) types. Also, add assertions to ensure
3388         that we keep allowed image MIME types in sync with allowed image UTIs.
3389
3390         The second optimization removes initializeMIMETypeRegistry() altogether in favor of calling just the
3391         initialize*MIMETypes() functions needed to ensure the information required. For instance, getPDFMIMETypes()
3392         currently calls initializeMIMETypeRegistry() if the pdfMIMETypes dictionary doesn't exist, when it really only
3393         needs to ensure that the pdfMIMETypes is initialized, for which initializePDFMIMETypes() is sufficient.
3394
3395         * platform/MIMETypeRegistry.cpp:
3396         (WebCore::initializeSupportedImageMIMETypes):
3397         (WebCore::initializeSupportedJavaScriptMIMETypes):
3398         (WebCore::initializePDFMIMETypes):
3399         (WebCore::initializeSupportedNonImageMimeTypes):
3400         (WebCore::initializeUnsupportedTextMIMETypes):
3401
3402         Move MIME type dictionary creation into initialize*MIMETypes() helpers. Additionally, remove
3403         initializePDFAndPostScriptMIMETypes, which is no longer necessary.
3404
3405         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
3406         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
3407         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
3408         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
3409         (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
3410         (WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):
3411
3412         Tweak to check that the type isPDFMIMEType(), or that it's otherwise "application/postscript".
3413
3414         (WebCore::MIMETypeRegistry::isPDFMIMEType):
3415         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
3416         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
3417         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
3418         (WebCore::MIMETypeRegistry::getPDFMIMETypes):
3419         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
3420
3421         Call only the relevant MIME type initializers when needed.
3422
3423         (WebCore::initializePostScriptMIMETypes): Deleted.
3424         (WebCore::initializeMIMETypeRegistry): Deleted.
3425         (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Deleted.
3426
3427         Remove an unused and unexported function.
3428
3429         * platform/MIMETypeRegistry.h:
3430
3431 2017-10-23  Andy Estes  <aestes@apple.com>
3432