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