101d035a418f09a596c1b980deb39ff23a4a706d
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-11-23  Darin Adler  <darin@apple.com>
2
3         Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby
4         https://bugs.webkit.org/show_bug.cgi?id=179981
5
6         Reviewed by Sam Weinig.
7
8         * accessibility/AXObjectCache.cpp:
9         (WebCore::AXObjectCache::rangeMatchesTextNearRange): Pass { } instead of 0.
10         * accessibility/AccessibilityObject.cpp:
11         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Use { }
12         instead of | to construct value.
13         * editing/Editor.cpp:
14         (WebCore::Editor::findString): Use contains instead of & to test an option.
15         (WebCore::Editor::rangeOfString): Ditto.
16         (WebCore::Editor::countMatchesForText): Ditto.
17         * editing/EditorCommand.cpp:
18         (WebCore::executeFindString): Use { } instead of | to construct value.
19         * editing/FindOptions.h: Use OptionSet for type.
20         * editing/TextIterator.cpp:
21         (WebCore::SearchBuffer::SearchBuffer): Use contains instead of &. Also use -= instead
22         of &= coupled with ~ to remove a flag.
23         (WebCore::SearchBuffer::isWordEndMatch const): Ditto.
24         (WebCore::SearchBuffer::isWordStartMatch const): Ditto.
25         (WebCore::SearchBuffer::search): Ditto.
26         (WebCore::findIteratorOptions): Ditto.
27         (WebCore::findClosestPlainText): Ditto.
28         (WebCore::findPlainText): Ditto.
29
30         * editing/mac/DictionaryLookup.h: Changed optional dictionary out arguments to
31         RetainPtr<NSDictionary>. Before, they were returning a retained object, but callers
32         did not seem to realize that.
33         * editing/mac/DictionaryLookup.mm:
34         (WebCore::tokenRange): Added helper. Takes care of doing adoptNS on the options
35         dictionary, and also handles the Objective-C exception possibility cleanly. Also
36         fixed the exception case to return NSNotFound instead of a zero-length range at
37         the location we are searching, which is what the code expects.
38         (WebCore::DictionaryLookup::rangeForSelection): Refactored to use the tokenRange
39         helper function, and also to do much less work when the options pointer is null.
40         (WebCore::DictionaryLookup::rangeAtHitTestResult): Use the tokenRange helper
41         function and also use auto a bunch to tighten up the code a bit.
42         (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
43
44         * page/DOMWindow.cpp:
45         (WebCore::DOMWindow::find const): Use |= instead of | to build find options.
46         * page/Page.cpp:
47         (WebCore::Page::findString): Use contains instead of & and also - instead of
48         & combined with ~.
49         (WebCore::Page::findStringMatchingRanges): Ditto.
50         (WebCore::Page::rangeOfString): Ditto.
51
52         * page/mac/EventHandlerMac.mm:
53         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
54         Pass nullptr to indicate we don't need the options dictionary. The code before
55         was passing a pointer to a null, which meant we would do the work to get the
56         options dictionary, not use it, and also leak it.
57
58         * testing/Internals.cpp:
59         (WebCore::Internals::rangeOfStringNearLocation): Pass { } instead of 0.
60         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Pass nullptr to
61         indicate we don't need the options dictionary as above.
62         (WebCore::parseFindOptions): Initialize options without an explicit 0, since
63         an OptionSet starts out empty rather than uninitialized.
64
65 2017-11-24  Antti Koivisto  <antti@apple.com>
66
67         Style resolution spin due to calc() values always comparing inequal (seen on arstechnica.com)
68         https://bugs.webkit.org/show_bug.cgi?id=179982
69         <rdar://problem/35677991>
70
71         Reviewed by Darin Adler.
72
73         Test: transitions/transition-with-calc-spin.html
74
75         Something like calc(100% - 10px) would compare inequal to itself. This causes the implicit animation engine think that
76         there is a new target value after style resolution and restart the transition. Starting the transition triggers another style
77         resolution on zero duration timer and so on.
78
79         * platform/CalculationValue.cpp:
80         (WebCore::operator==):
81         * platform/CalculationValue.h:
82
83         Deep compare the child vectors.
84
85 2017-11-24  Antoine Quint  <graouts@apple.com>
86
87         Captions move when <video> with no controls is hovered
88         https://bugs.webkit.org/show_bug.cgi?id=178600
89         <rdar://problem/35112309>
90
91         Reviewed by Jer Noble.
92
93         We should only reduce the text tracks container height to make room for the controls
94         bar when controls are enabled.
95
96         Tests: media/modern-media-controls/text-tracks/text-tracks-height-no-controls.html
97                media/modern-media-controls/text-tracks/text-tracks-height-with-controls.html
98
99         * Modules/modern-media-controls/controls/text-tracks.css:
100         (video[controls]::-webkit-media-text-track-container.visible-controls-bar):
101         (video::-webkit-media-text-track-container.visible-controls-bar): Deleted.
102
103 2017-11-23  Simon Fraser  <simon.fraser@apple.com>
104
105         Some FilterEffect cleanup and logging
106         https://bugs.webkit.org/show_bug.cgi?id=179932
107
108         Reviewed by Darin Adler.
109         
110         Rename the FilterEffect functions that get the result of the filter
111         to have "result" in the name.
112         
113         Re-order FilterEffect member variables and use initializers. webkit.org/b/45614
114         is closed so remove the comment about things moving to RenderSVGResourceFilterPrimitive.
115         
116         Add a virtual filterName() function for use by logging.
117         
118         Add a Filters log channel. Log some stuff.
119         
120         Rename RenderSVGResourceFilter::m_filter to m_rendererFilterDataMap.
121
122         * platform/Logging.h:
123         * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
124         (WebCore::FEBlend::platformApplySoftware):
125         * platform/graphics/filters/FEBlend.cpp:
126         (WebCore::FEBlend::platformApplySoftware):
127         * platform/graphics/filters/FEBlend.h:
128         * platform/graphics/filters/FEColorMatrix.cpp:
129         (WebCore::FEColorMatrix::platformApplySoftware):
130         * platform/graphics/filters/FEColorMatrix.h:
131         * platform/graphics/filters/FEComponentTransfer.cpp:
132         (WebCore::FEComponentTransfer::platformApplySoftware):
133         * platform/graphics/filters/FEComponentTransfer.h:
134         * platform/graphics/filters/FEComposite.cpp:
135         (WebCore::FEComposite::platformApplySoftware):
136         * platform/graphics/filters/FEComposite.h:
137         * platform/graphics/filters/FEConvolveMatrix.cpp:
138         (WebCore::FEConvolveMatrix::platformApplySoftware):
139         * platform/graphics/filters/FEConvolveMatrix.h:
140         * platform/graphics/filters/FEDisplacementMap.cpp:
141         (WebCore::FEDisplacementMap::platformApplySoftware):
142         * platform/graphics/filters/FEDisplacementMap.h:
143         * platform/graphics/filters/FEDropShadow.cpp:
144         (WebCore::FEDropShadow::platformApplySoftware):
145         * platform/graphics/filters/FEDropShadow.h:
146         * platform/graphics/filters/FEFlood.h:
147         * platform/graphics/filters/FEGaussianBlur.cpp:
148         (WebCore::FEGaussianBlur::platformApplySoftware):
149         * platform/graphics/filters/FEGaussianBlur.h:
150         * platform/graphics/filters/FELighting.cpp:
151         (WebCore::FELighting::platformApplySoftware):
152         * platform/graphics/filters/FELighting.h:
153         * platform/graphics/filters/FEMerge.cpp:
154         (WebCore::FEMerge::platformApplySoftware):
155         * platform/graphics/filters/FEMerge.h:
156         * platform/graphics/filters/FEMorphology.cpp:
157         (WebCore::FEMorphology::platformApplyDegenerate):
158         (WebCore::FEMorphology::platformApplySoftware):
159         * platform/graphics/filters/FEMorphology.h:
160         * platform/graphics/filters/FEOffset.cpp:
161         (WebCore::FEOffset::platformApplySoftware):
162         * platform/graphics/filters/FEOffset.h:
163         * platform/graphics/filters/FETile.cpp:
164         (WebCore::FETile::platformApplySoftware):
165         * platform/graphics/filters/FETile.h:
166         * platform/graphics/filters/FETurbulence.cpp:
167         (WebCore::operator<<):
168         * platform/graphics/filters/FETurbulence.h:
169         * platform/graphics/filters/FilterEffect.cpp:
170         (WebCore::FilterEffect::FilterEffect):
171         (WebCore::FilterEffect::imageBufferResult):
172         (WebCore::FilterEffect::unmultipliedResult):
173         (WebCore::FilterEffect::premultipliedResult):
174         (WebCore::FilterEffect::copyImageBytes const): This can be const. It'a also crazy
175         to mark a large, slow function like this as 'inline'.
176         (WebCore::FilterEffect::copyUnmultipliedResult):
177         (WebCore::FilterEffect::copyPremultipliedResult):
178         (WebCore::FilterEffect::createImageBufferResult):
179         (WebCore::FilterEffect::createUnmultipliedImageResult):
180         (WebCore::FilterEffect::createPremultipliedImageResult):
181         (WebCore::FilterEffect::transformResultColorSpace):
182         (WebCore::FilterEffect::asImageBuffer): Deleted.
183         (WebCore::FilterEffect::asUnmultipliedImage): Deleted.
184         (WebCore::FilterEffect::asPremultipliedImage): Deleted.
185         (WebCore::FilterEffect::copyImageBytes): Deleted.
186         (WebCore::FilterEffect::copyUnmultipliedImage): Deleted.
187         (WebCore::FilterEffect::copyPremultipliedImage): Deleted.
188         * platform/graphics/filters/FilterEffect.h:
189         * platform/graphics/filters/SourceAlpha.cpp:
190         (WebCore::SourceAlpha::platformApplySoftware):
191         * platform/graphics/filters/SourceAlpha.h:
192         * platform/graphics/filters/SourceGraphic.h:
193         * rendering/FilterEffectRenderer.cpp:
194         (WebCore::FilterEffectRenderer::output const):
195         * rendering/svg/RenderSVGResourceFilter.cpp:
196         (WebCore::RenderSVGResourceFilter::removeAllClientsFromCache):
197         (WebCore::RenderSVGResourceFilter::removeClientFromCache):
198         (WebCore::RenderSVGResourceFilter::applyResource):
199         (WebCore::RenderSVGResourceFilter::postApplyResource):
200         (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged):
201         (WebCore::RenderSVGResourceFilter::drawingRegion const):
202         (WebCore::operator<<):
203         * rendering/svg/RenderSVGResourceFilter.h:
204         (WebCore::FilterData::FilterData): Deleted.
205         * svg/graphics/filters/SVGFEImage.h:
206
207 2017-11-24  Antoine Quint  <graouts@apple.com>
208
209         [Web Animations] Allow getComputedStyle() to return animated values for accelerated animations
210         https://bugs.webkit.org/show_bug.cgi?id=179975
211         <rdar://problem/35676811>
212
213         Reviewed by Dean Jackson.
214
215         In case we're running an accelerated animation, we are not blending RenderStyles as the animation
216         progresses and thus we need to hook into computeRenderStyleForProperty() to query the DocumentTimeline
217         for the animated style of running accelerated animations where we blend styles manually for the
218         animation's current time.
219
220         Test: http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle.html
221
222         * animation/DocumentTimeline.cpp:
223         (WebCore::DocumentTimeline::animatedStyleForRenderer): Iterate through all running accelerated animations
224         for the element to which the provided renderer is attached and ask for their animated styles.
225         * animation/DocumentTimeline.h:
226         * animation/KeyframeEffect.cpp:
227         (WebCore::KeyframeEffect::getAnimatedStyle): Manually blend all animated properties and populate the provided
228         RenderStyle with their values, creating the RenderStyle if needed.
229         * animation/KeyframeEffect.h:
230         * css/CSSComputedStyleDeclaration.cpp:
231         (WebCore::computeRenderStyleForProperty): Query the DocumentTimeline for accelerated animated properties in
232         case such animations are running, otherwise let the CSS animation controller report the animated values.
233
234 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
235
236         [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer
237         https://bugs.webkit.org/show_bug.cgi?id=179977
238
239         Reviewed by Carlos Garcia Campos.
240
241         CoordinatedGraphicsLayer::updateContentBuffers() retrieves a RefPtr<CoordinatedBuffer>
242         from the CompositingCoordinator. This pointer should never be null since if no
243         existing UpdateAtlas can provide the necessary memory area, a fresh UpdateAtlas is
244         created and its buffer returned. This can't fail in theory since the tiles that are
245         being updated are smaller than the UpdateAtlas area.
246
247         The CoordinatedGraphicsLayerClient::getCoordinatedBuffer() method is updated to
248         always return a Ref<CoordinatedBuffer> value. Code in updateContentBuffers() is
249         updated to remove a null-check on what is now the Ref<CoordinatedBuffer> value.
250
251         No new tests -- no change in functionality.
252
253         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
254         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
255         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
256
257 2017-11-23  Antoine Quint  <graouts@apple.com>
258
259         [Web Animations] Perform accelerated animations when possible
260         https://bugs.webkit.org/show_bug.cgi?id=179973
261         <rdar://problem/34953922>
262
263         Reviewed by Dean Jackson.
264
265         When we're entering and leaving the active duration of an animation effect, we now check
266         whether the animation can be accelerated, using the existing CSSPropertyAnimation::animationOfPropertyIsAccelerated()
267         utility, and start and stop animations using the startAnimation() and animationFinished() functions on RenderBoxModelObject.
268
269         This patch is only a first step towards full support for accelerated animations,
270         there are two known issues at the moment. Because we're not blending the styles to perform
271         the animation, getComputedStyle() will not return the animated value (webkit.org/b/179974).
272         Additionally, if other animations happen to run later during the active state of an animation
273         that can run accelerated, we will not fall back to software-only animation for this
274         element and these animations will appear not to run (webkit.org/b/179975). These will be
275         addressed in follow-up patches.
276
277         Tests: webanimations/left-and-opacity-animation-yields-no-compositing.html
278                webanimations/opacity-animation-no-longer-composited-upon-completion.html
279                webanimations/opacity-animation-yields-compositing.html
280                webanimations/width-and-opacity-separate-animation-yields-no-compositing.html
281
282         * animation/DocumentTimeline.cpp:
283         (WebCore::DocumentTimeline::updateAnimations): Check in the map of pending accelerated animations
284         to see if any animation requires toggling their active state after their styles have been invalidated.
285         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): New function to
286         let animations indicate that they need to have their accelerated backing animation toggled after
287         style invalidation has been completed.
288         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): This function is used
289         in RenderLayerCompositor::requiresCompositingForAnimation() to identify whether an element requires
290         hardware compositing due to running accelerated animations. We check all running animations for the
291         provided element to see if they can all be running accelerated and return true in this situation only.
292         * animation/DocumentTimeline.h:
293         * animation/KeyframeEffect.cpp:
294         (WebCore::KeyframeEffect::applyAtLocalTime): Identify if we're crossing into or out of the active state
295         for an animation and check if it will be or has been running accelerated such that we can notify the
296         DocumentTimeline, through the associated animation, that the accelerated backing animation will need to
297         be toggled after style invalidation has been completed.
298         (WebCore::KeyframeEffect::shouldRunAccelerated): Check that all properties for this animation
299         effect can be accelerated according to CSSPropertyAnimation::animationOfPropertyIsAccelerated().
300         (WebCore::KeyframeEffect::startOrStopAccelerated): Start or stop the associated accelerated
301         animation through the associated element's RenderBoxModelObject renderer.
302         * animation/KeyframeEffect.h:
303         * animation/WebAnimation.cpp:
304         (WebCore::WebAnimation::acceleratedRunningStateDidChange): Called from AnimationEffect::applyAtLocalTime(),
305         we forward to the DocumentTimeline the information that the animation will cross an active state boundary while
306         allowing to be backed by hardware compositing.
307         (WebCore::WebAnimation::startOrStopAccelerated): Forward to the associated KeyframeEffect that accelerated
308         animation backing should be toggled.
309         * animation/WebAnimation.h:
310         * rendering/RenderLayerCompositor.cpp:
311         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Check via the renderer's element's
312         DocumentTimeline that all running animations for this particular element are accelerated to ensure that
313         the element will be hardware-composited.
314
315 2017-11-23  Fujii Hironori  <Hironori.Fujii@sony.com>
316
317         [Win] PasteboardWin.cpp(653): error C2039: 'containsOnlyASCII': is not a member of 'WTF::String'
318         https://bugs.webkit.org/show_bug.cgi?id=179991
319
320         Unreviewed build fix.
321
322         No new tests (No behaviour change).
323
324         * platform/win/PasteboardWin.cpp:
325         (WebCore::Pasteboard::writeURLToDataObject): Renamed containsOnlyASCII() to isAllASCII().
326
327 2017-11-23  Carlos Alberto Lopez Perez  <clopez@igalia.com>
328
329         [GTK] [Debug] Fix build after r225117.
330         https://bugs.webkit.org/show_bug.cgi?id=179907
331
332         Unreviewed build fix.
333
334         r225117 renamed containsOnlyASCII() to isAllASCII().
335         And this reference was not updated for the GTK Debug build.
336
337         No new tests, its a build fix.
338
339         * loader/archive/mhtml/MHTMLArchive.cpp:
340         (WebCore::MHTMLArchive::generateMHTMLData):
341
342 2017-11-23  Simon Fraser  <simon.fraser@apple.com>
343
344         FELighting cleanup and optimization
345         https://bugs.webkit.org/show_bug.cgi?id=179933
346
347         Reviewed by Darin Adler.
348
349         Make FELighting about 25% faster by maintaining an "alpha" window of the alpha
350         values of the 9 pixels surrounding the current pixel, and sliding this window over
351         when moving to the next pixel. This avoids reading the same alpha values from the original
352         buffer multiple times.
353
354         Clean up LightSource and subclasses, adding SPECIALIZE_TYPE_TRAITS macros,
355         and turning updatePaintingData() into a function with no side effects that returns
356         the required data.
357
358         Remove explicit 'inline' keywords, allowing the compiler to make inlining decisions.
359
360         * platform/graphics/cpu/arm/filters/FELightingNEON.h:
361         (WebCore::FELighting::platformApplyNeon):
362         * platform/graphics/filters/DistantLightSource.cpp:
363         (WebCore::DistantLightSource::initPaintingData):
364         (WebCore::DistantLightSource::computePixelLightingData const):
365         (WebCore::DistantLightSource::updatePaintingData): Deleted.
366         * platform/graphics/filters/DistantLightSource.h:
367         * platform/graphics/filters/FELighting.cpp:
368         (WebCore::FELighting::LightingData::interiorNormal const):
369         (WebCore::FELighting::setPixel):
370         (WebCore::FELighting::setPixelInternal):
371         (WebCore::FELighting::platformApplyGenericPaint):
372         (WebCore::FELighting::platformApplyGeneric):
373         (WebCore::FELighting::platformApply):
374         (WebCore::FELighting::drawLighting):
375         (WebCore::FELighting::inlineSetPixel): Deleted.
376         * platform/graphics/filters/FELighting.h:
377         (WebCore::FELighting::AlphaWindow::topLeft const):
378         (WebCore::FELighting::AlphaWindow::left const):
379         (WebCore::FELighting::AlphaWindow::bottomLeft const):
380         (WebCore::FELighting::AlphaWindow::top const):
381         (WebCore::FELighting::AlphaWindow::center const):
382         (WebCore::FELighting::AlphaWindow::bottom const):
383         (WebCore::FELighting::AlphaWindow::setTop):
384         (WebCore::FELighting::AlphaWindow::setCenter):
385         (WebCore::FELighting::AlphaWindow::setBottom):
386         (WebCore::FELighting::AlphaWindow::setTopRight):
387         (WebCore::FELighting::AlphaWindow::setRight):
388         (WebCore::FELighting::AlphaWindow::setBottomRight):
389         (WebCore::FELighting::AlphaWindow::shiftRow):
390         (WebCore::FELighting::AlphaWindow::shift):
391         * platform/graphics/filters/LightSource.h:
392         * platform/graphics/filters/PointLightSource.cpp:
393         (WebCore::PointLightSource::computePixelLightingData const):
394         (WebCore::PointLightSource::updatePaintingData): Deleted.
395         * platform/graphics/filters/PointLightSource.h:
396         * platform/graphics/filters/SpotLightSource.cpp:
397         (WebCore::SpotLightSource::initPaintingData):
398         (WebCore::SpotLightSource::computePixelLightingData const):
399         (WebCore::SpotLightSource::updatePaintingData): Deleted.
400         * platform/graphics/filters/SpotLightSource.h:
401
402 2017-11-23  Simon Fraser  <simon.fraser@apple.com>
403
404         Add support for CanvasPattern.setTransform()
405         https://bugs.webkit.org/show_bug.cgi?id=179935
406
407         Reviewed by Sam Weinig.
408         
409         Add support for setTransform() on CanvasPattern, per
410         <https://html.spec.whatwg.org/multipage/canvas.html#dom-canvaspattern-settransform>
411         It uses [MayThrowException] since the "validate and fixup" steps for DOMMatrix can throw
412         an exception.
413         
414         Under the hood, the transform is just pushed onto Pattern as the patternSpaceTransform().
415         
416         Minor cleanup in Pattern.
417
418         Test: fast/canvas/canvas-pattern-with-transform.html
419
420         * html/canvas/CanvasPattern.cpp:
421         (WebCore::CanvasPattern::setTransform):
422         * html/canvas/CanvasPattern.h:
423         * html/canvas/CanvasPattern.idl:
424         * platform/graphics/Pattern.h:
425
426 2017-11-23  Sam Weinig  <sam@webkit.org>
427
428         Remove unneeded ScriptController::processingUserGesture() forwarding functions
429         https://bugs.webkit.org/show_bug.cgi?id=179954
430
431         Reviewed by Darin Adler.
432
433         Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia()
434         with direct calls to the corresponding UserGestureIndicator functions.
435
436         * Modules/applepay/ApplePaySession.cpp:
437         (WebCore::ApplePaySession::create):
438         (WebCore::ApplePaySession::openPaymentSetup):
439         * Modules/speech/SpeechSynthesis.cpp:
440         (WebCore::SpeechSynthesis::speak):
441         * bindings/js/ScriptController.cpp:
442         (WebCore::ScriptController::processingUserGesture): Deleted.
443         (WebCore::ScriptController::processingUserGestureForMedia): Deleted.
444         * bindings/js/ScriptController.h:
445         * dom/Document.cpp:
446         (WebCore::Document::processingUserGestureForMedia const):
447         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
448         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
449         * html/ColorInputType.cpp:
450         (WebCore::ColorInputType::handleDOMActivateEvent):
451         * html/FileInputType.cpp:
452         (WebCore::FileInputType::handleDOMActivateEvent):
453         * html/HTMLFormElement.cpp:
454         (WebCore::HTMLFormElement::submitFromJavaScript):
455         * html/HTMLPlugInImageElement.cpp:
456         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
457         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
458         * loader/FrameLoader.cpp:
459         (WebCore::FrameLoader::submitForm):
460         (WebCore::shouldOpenExternalURLsPolicyToApply):
461         * page/DOMWindow.cpp:
462         (WebCore::DOMWindow::allowPopUp):
463         (WebCore::DOMWindow::setLocation):
464         (WebCore::DOMWindow::createWindow):
465         (WebCore::DOMWindow::open):
466         * page/PointerLockController.cpp:
467         (WebCore::PointerLockController::requestPointerLock):
468
469 2017-11-22  Dean Jackson  <dino@apple.com>
470
471         Add a base class for HTMLCanvasElement and OffscreenCanvas
472         https://bugs.webkit.org/show_bug.cgi?id=179701
473         <rdar://problem/35545195>
474
475         Post-review updates from Darin Adler review.
476
477         * html/CanvasBase.cpp:
478         (WebCore::CanvasBase::asHTMLCanvasElement): Deleted. Replaced by having the call
479         sites get the reference and do the correct downcast<>.
480         * html/CanvasBase.h: Remove asHTMLCanvasElement. Add pure virtual ref/deref functions
481         so they can be overridden by subclasses. Unfortunately they can't be called ref/deref otherwise
482         they conflict with Node.
483         * html/HTMLCanvasElement.h: Add the type traits, so is<HTMLCanvasElement>(canvasBase) will
484         work.
485         * html/HTMLTagNames.in: Specify the <canvas> element as having custom type traits.
486         * html/OffscreenCanvas.h: Lots of overrides to finals.
487         * html/canvas/CanvasRenderingContext.cpp: Use canvasBase.de/refCanvasBase rather than
488         casting.
489         (WebCore::CanvasRenderingContext::ref):
490         (WebCore::CanvasRenderingContext::deref):
491         * html/canvas/CanvasRenderingContext.h: Lots of overrides to finals.
492         * html/canvas/CanvasRenderingContext2D.h:
493         * html/canvas/ImageBitmapRenderingContext.cpp:
494         (WebCore::ImageBitmapRenderingContext::canvas const):
495         * html/canvas/WebGLRenderingContextBase.cpp:
496         (WebCore::WebGLRenderingContextBase::create):
497         (WebCore::WebGLRenderingContextBase::canvas):
498         * html/canvas/WebGPURenderingContext.cpp:
499         (WebCore::WebGPURenderingContext::canvas const):
500         * inspector/InspectorInstrumentation.h:
501         (WebCore::InspectorInstrumentation::recordCanvasAction):
502         * inspector/agents/InspectorCanvasAgent.cpp:
503         (WebCore::InspectorCanvasAgent::recordCanvasAction):
504
505 2017-11-23  Darin Adler  <darin@apple.com>
506
507         Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
508         https://bugs.webkit.org/show_bug.cgi?id=179907
509
510         Reviewed by Sam Weinig.
511
512         * Modules/plugins/YouTubePluginReplacement.cpp:
513         (WebCore::hasCaseInsensitivePrefix): Deleted.
514         (WebCore::processAndCreateYouTubeURL): Use startsWithLettersIgnoringASCIICase.
515
516         * Modules/websockets/WebSocketHandshake.cpp:
517         (WebCore::WebSocketHandshake::readHTTPHeaders): Use isAllASCII.
518
519         * accessibility/atk/AccessibilityObjectAtk.cpp:
520         (WebCore::AccessibilityObject::getLengthForTextRange const): Use text().length().
521
522         * accessibility/AXObjectCache.cpp:
523         (WebCore::AXObjectCache::traverseToOffsetInRange): Use isHTMLSpace instead of
524         isSpaceOrNewline since the code is trying to skip collapsible HTML spaces, not
525         arbitrary Unicode whitespace.
526         * accessibility/AccessibilityList.cpp:
527         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers): Use
528         isAllSpecialCharacters<isHTMLSpace> for the same reason as above.
529
530         * accessibility/AccessibilityNodeObject.cpp:
531         (WebCore::AccessibilityNodeObject::isSearchField const): Use containsIgnoringASCIICase.
532
533         * accessibility/AccessibilityObject.cpp:
534         (WebCore::AccessibilityObject::accessibilityObjectContainsText const): Use
535         new findPlainText function exported from TextIterator so this can share the
536         same search matching logic used to find text in webpages.
537         (WebCore::AccessibilityObject::selectText): Use capitalize and its return value
538         rather than makeCapitalize modifying a string in place.
539
540         * accessibility/AccessibilityRenderObject.cpp:
541         (WebCore::objectInclusionFromAltText): Use isAllSpecialCharacters<isHTMLSpace>
542         for the same reason as above.
543         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): Ditto.
544
545         * bindings/js/JSDOMConvertStrings.cpp:
546         (WebCore::stringToByteString): Use isAllLatin1.
547
548         * contentextensions/ContentExtensionParser.cpp:
549         (WebCore::ContentExtensions::containsOnlyASCIIWithNoUppercase): Use
550         StringView::codeUnits instead of String::at.
551
552         * contentextensions/ContentExtensionsBackend.cpp:
553         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
554         Use isAllASCII.
555         * contentextensions/URLFilterParser.cpp:
556         (WebCore::ContentExtensions::URLFilterParser::addPattern): Ditto.
557
558         * css/CSSFontFaceSrcValue.cpp:
559         (WebCore::CSSFontFaceSrcValue::isSupportedFormat const): Use protocolIs and
560         endsWithIgnoringASCIICase.
561
562         * css/DOMCSSNamespace.cpp:
563         (WebCore::valueWithoutImportant): Use endsWithIgnoringASCIICase.
564
565         * css/parser/CSSPropertyParser.cpp:
566         (WebCore::parseGridTemplateAreasRow): Use isAllSpecialCharacters<isCSSSpace>,
567         for the preflight, which matches what the actual parsing code uses.
568
569         * dom/CharacterData.cpp:
570         (WebCore::CharacterData::containsOnlyWhitespace const): Deleted. Callers can
571         efficiently get at the data and do this kind of check on the data directly.
572         * dom/CharacterData.h: Updated for the above.
573
574         * dom/DataTransfer.cpp:
575         (WebCore::normalizeType): Use startsWith since the string is already converted
576         to ASCII lowercase.
577
578         * dom/Position.cpp:
579         (WebCore::Position::leadingWhitespacePosition const): Use isHTMLSpace since
580         since the code is trying to check for collapsible HTML spaces, not general
581         Unicode spaces. Other call sites of isSpaceOrNewline need to be checked for
582         this, but I did not fix them all at this time.
583         (WebCore::Position::trailingWhitespacePosition const): Ditto.
584
585         * editing/Editor.cpp:
586         (WebCore::Editor::editorUIUpdateTimerFired): Use noBreakSpace.
587
588         * editing/FrameSelection.cpp:
589         (WebCore::FrameSelection::debugRenderer const): Use text().length() instead
590         of textLength.
591         (WebCore::FrameSelection::selectionAtWordStart const): Use noBreakSpace.
592         (WebCore::FrameSelection::wordSelectionContainingCaretSelection): Ditto.
593         (WebCore::FrameSelection::actualSelectionAtSentenceStart const): Ditto.
594
595         * editing/TextIterator.cpp:
596         (WebCore::textNodeOffsetInFlow): Use text().length().
597         (WebCore::TextIterator::handleTextNode): Ditto.
598         (WebCore::collapsedSpaceLength): Updated since RenderText::text now returns
599         a reference rather than a pointer.
600         (WebCore::findPlainText): Added. Uses SearchBuffer to search for one string
601         within another. Exported so accessibility code can do this operation.
602         * editing/TextIterator.h: Updated for the above.
603
604         * editing/TypingCommand.cpp:
605         (WebCore::TypingCommand::markMisspellingsAfterTyping): Use noBreakSpace.
606
607         * editing/VisibleUnits.cpp:
608         (WebCore::findStartOfParagraph): Updated since RenderText::text now returns
609         a reference.
610         (WebCore::findEndOfParagraph): Ditto.
611
612         * editing/cocoa/HTMLConverter.mm:
613         (HTMLConverter::_processText): Use String::characterAt instead of String::at.
614         Use capitalize instead of makeCapitalized.
615
616         * editing/cocoa/WebContentReaderCocoa.mm:
617         (WebCore::stripMicrosoftPrefix): Use findIgnoringASCIICase.
618
619         * html/Autofill.cpp:
620         (WebCore::AutofillData::createFromHTMLFormControlElement): Use
621         startsWithLettersIgnoringASCIICase.
622
623         * html/BaseTextInputType.cpp:
624         (WebCore::BaseTextInputType::patternMismatch const): Removed explicit
625         TextCaseSensitive since it now is the default, and needed to touch this anyway
626         because the enumeration is now in a different namespace.
627
628         * html/EmailInputType.cpp:
629         (WebCore::isValidEmailAddress): Updated to use JSC::Yarr::TextCaseInsensitive.
630
631         * html/HTMLObjectElement.cpp:
632         (WebCore::HTMLObjectElement::hasFallbackContent const): Use
633         isAllSpecialCharacters<isHTMLSpace>.
634         (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use
635         startsWithLettersIgnoringASCIICase.
636         (WebCore::HTMLObjectElement::hasValidClassId): Use protocolIs.
637         (WebCore::preventsParentObjectFromExposure): Use isAllSpecialCharacters<isHTMLSpace>.
638
639         * html/parser/HTMLConstructionSite.cpp:
640         (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype):
641         Use startsWithLettersIgnoringASCIICase.
642
643         * html/parser/HTMLMetaCharsetParser.cpp:
644         (WebCore::extractCharset): Use findIgnoringASCIICase.
645
646         * html/parser/XSSAuditor.cpp:
647         (WebCore::XSSAuditor::isContainedInRequest): Use containsIgnoringASCIICase.
648
649         * html/track/WebVTTParser.cpp:
650         (WebCore::WebVTTParser::hasRequiredFileIdentifier): Don't pass the length to
651         the String::startsWith function. There has never been a version of that function
652         that takes the length, there is no need to pass the length since the function
653         handles null-terminated strings like the one here, and in the past the length
654         has been getting converted to a boolean making the comparison be case sensitive.
655         Removing the argument entirely leaves it case sensitive.
656
657         * inspector/InspectorNodeFinder.cpp:
658         (WebCore::InspectorNodeFinder::matchesElement): Use startsWithIgnoringASCIICase
659         and endsWithIgnoringASCIICase.
660
661         * inspector/InspectorStyleSheet.cpp:
662         (WebCore::selectorsFromSource): Use JSC::Yarr::TextCaseSensitive.
663
664         * inspector/agents/InspectorDOMAgent.cpp:
665         (WebCore::containsOnlyHTMLWhitespace): Made this a non-member function
666         and reimplemented using isAllSpecialCharacters<isHTMLSpace>().
667         (WebCore::InspectorDOMAgent::innerFirstChild): Use containsOnlyHTMLWhitespace.
668         (WebCore::InspectorDOMAgent::innerNextSibling): Ditto.
669         (WebCore::InspectorDOMAgent::innerPreviousSibling): Ditto.
670         (WebCore::InspectorDOMAgent::innerChildNodeCount): Ditto.
671         (WebCore::InspectorDOMAgent::didInsertDOMNode): Ditto.
672         (WebCore::InspectorDOMAgent::didRemoveDOMNode): Ditto.
673         * inspector/agents/InspectorDOMAgent.h: Updated for above change.
674
675         * loader/appcache/ApplicationCacheStorage.cpp:
676         (WebCore::ApplicationCacheStorage::shouldStoreResourceAsFlatFile):
677         Use startsWithLettersIgnoringASCIICase.
678
679         * page/Base64Utilities.cpp:
680         (WebCore::Base64Utilities::btoa): Use isAllLatin1.
681
682         * page/Frame.cpp:
683         (WebCore::createRegExpForLabels): Removed TextCaseSensitive argument since
684         that is now the default and also used JSC::Yarr::TextCaseInsensitive.
685         (WebCore::matchLabelsAgainstString): More of the same.
686
687         * page/FrameView.cpp:
688         (WebCore::countRenderedCharactersInRenderObjectWithThreshold): Use
689         text().length().
690
691         * page/SecurityOrigin.cpp:
692         (WebCore::isFeedWithNestedProtocolInHTTPFamily): Use
693         startsWithLettersIgnoringASCIICase.
694
695         * page/UserContentURLPattern.cpp:
696         (WebCore::UserContentURLPattern::matchesHost const):
697         Use endsWithIgnoringASCIICase.
698         * page/csp/ContentSecurityPolicySource.cpp:
699         (WebCore::ContentSecurityPolicySource::hostMatches const): Ditto.
700
701         * page/csp/ContentSecurityPolicySourceList.cpp:
702         (WebCore::ContentSecurityPolicySourceList::parseNonceSource):
703         Use startsWithIgnoringASCIICase.
704
705         * page/ios/FrameIOS.mm:
706         (WebCore::Frame::wordsInCurrentParagraph const): Use noBreakSpace.
707
708         * platform/ContentType.cpp:
709         (WebCore::ContentType::parameter const): Use findIgnoringASCIICase.
710
711         * platform/MIMETypeRegistry.cpp:
712         (WebCore::MIMETypeRegistry::isSupportedFontMIMEType): Use
713         startsWithLettersIgnoringASCIICase.
714         (WebCore::MIMETypeRegistry::isSupportedJSONMIMEType): Use
715         mimeType.endsWithIgnoringASCIICase.
716         (WebCore::MIMETypeRegistry::isTextMIMEType): Use
717         startsWithLettersIgnoringASCIICase.
718         (WebCore::MIMETypeRegistry::isXMLMIMEType): Use endsWithIgnoringASCIICase.
719         (WebCore::MIMETypeRegistry::isJavaAppletMIMEType): Use
720         startsWithLettersIgnoringASCIICase.
721         (WebCore::MIMETypeRegistry::canShowMIMEType): Ditto.
722
723         * platform/URL.cpp:
724         (WebCore::isAllASCII): Renamed from containsOnlyASCII.
725         (WebCore::appendEncodedHostname): Use isAllASCII.
726
727         * platform/URLParser.cpp:
728         (WebCore::containsOnlyASCII): Deleted.
729         (WebCore::URLParser::domainToASCII): Use StringImpl::isAllASCII. Changed
730         to take StringImpl& to guarantee we won't keep doing null checks since
731         the caller already checks for null.
732         (WebCore::URLParser::parseHostAndPort): Pass StringImpl&.
733         * platform/URLParser.h: Updated for above.
734
735         * platform/graphics/MediaPlayer.cpp:
736         (WebCore::MediaPlayer::supportsType): Use endsWithIgnoringASCIICase
737         and startsWithLettersIgnoringASCIICase.
738
739         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
740         (WebCore::validKeySystemRE): Use JSC::Yarr::TextCaseInsensitive.
741
742         * platform/graphics/cocoa/FontCacheCoreText.cpp:
743         (WebCore::FontCache::similarFont): Use containsIgnoringASCIICase for
744         the Geeza font special cases.
745
746         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
747         (WebCore::shouldRejectMIMEType): Use startsWithLettersIgnoringASCIICase.
748
749         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
750         (WebCore::GraphicsContext3D::getUnmangledInfoLog): Removed
751         TextCaseSensitive since it now is the default.
752
753         * platform/mac/PublicSuffixMac.mm:
754         (WebCore::topPrivatelyControlledDomain): Use isAllASCII.
755
756         * platform/mac/SSLKeyGeneratorMac.mm:
757         (WebCore::signedPublicKeyAndChallengeString): Use isAllASCII.
758
759         * platform/mac/StringUtilities.mm:
760         (WebCore::stringMatchesWildcardString): Use JSC::Yarr::TextCaseInsensitive.
761
762         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
763         (WebCore::addStringToSHA1): Use isAllASCII.
764
765         * platform/network/CacheValidation.cpp:
766         (WebCore::parseCacheControlDirectives): Use containsIgnoringASCIICase.
767
768         * platform/network/HTTPParsers.cpp:
769         (WebCore::parseHTTPRefresh): Use findIgnoringASCIICase.
770         (WebCore::findCharsetInMediaType): Ditto.
771         (WebCore::parseRange): Use startsWithLettersIgnoringASCIICase.
772
773         * platform/network/curl/AuthenticationChallengeCurl.cpp:
774         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
775         Use findIgnoringASCIICase.
776         * platform/network/curl/MultipartHandle.cpp:
777         (WebCore::MultipartHandle::extractBoundary): Ditto.
778         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
779         (WebCore::ResourceHandleCurlDelegate::handleDataURL): Use
780         endsWithIgnoringASCIICase.
781         * platform/network/curl/ResourceResponseCurl.cpp:
782         (WebCore::ResourceResponse::isAppendableHeader): Use
783         startsWithLettersIgnoringASCIICase.
784         (WebCore::ResourceResponse::appendHTTPHeaderField): Ditto.
785
786         * platform/win/ClipboardUtilitiesWin.cpp:
787         (WebCore::extractMarkupFromCFHTML): Use findIgnoringASCIICase.
788         (WebCore::fragmentFromCFHTML): Ditto.
789
790         * rendering/BidiRun.cpp:
791         (WebCore::BidiRun::BidiRun): Use text().length().
792         * rendering/HitTestResult.cpp:
793         (WebCore::HitTestResult::absolutePDFURL const): Use
794         endsWithIgnoringASCIICase.
795         * rendering/InlineFlowBox.cpp:
796         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection): Use text().length().
797         * rendering/InlineIterator.h:
798         (WebCore::InlineIterator::fastIncrementInTextNode): Ditto.
799         (WebCore::InlineIterator::increment): Dtto.
800         * rendering/InlineTextBox.cpp:
801         (WebCore::InlineTextBox::isLineBreak const): Updated since RenderText::text
802         now returns a StringImpl&.
803         (WebCore::InlineTextBox::selectionStartEnd const): Use text().length().
804         (WebCore::InlineTextBox::text const): Updated since RenderText::text
805         now returns a StringImpl&.
806         * rendering/RenderBlock.cpp:
807         (WebCore::RenderBlock::constructTextRun): Use text().length().
808         * rendering/RenderBlockFlow.cpp:
809         (WebCore::isVisibleRenderText): Use isAllSpecialCharacters<isHTMLSpace>().
810         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
811         Use the new trimmedPreferredWidths that returns a structure instead of the
812         old one with lots of arguments. Also use text().length().
813         * rendering/RenderBlockLineLayout.cpp:
814         (WebCore::endsWithHTMLSpaces): Renamed and changed to use isHTMLSpace
815         instead of isASCIISpace.
816         (WebCore::reachedEndOfTextRenderer): Use endsWithHTMLSpaces.
817         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
818         Updated for hcanges to RenderText.
819         (WebCore::RenderBlockFlow::handleTrailingSpaces): Ditto.
820         (WebCore::RenderBlockFlow::determineStartPosition): Ditto.
821
822         * rendering/RenderCombineText.cpp:
823         (WebCore::RenderCombineText::combineTextIfNeeded): Use
824         isAllSpecialCharacters<isHTMLSpace>.
825         * rendering/RenderLayer.cpp:
826         (WebCore::RenderLayer::calculateClipRects const): Ditto.
827
828         * rendering/RenderListBox.cpp:
829         (WebCore::bolder): Added. Helper function.
830         (WebCore::RenderListBox::updateFromElement): Rewrote to
831         only compute the bolder font once rather than for every item.
832         (WebCore::RenderListBox::paintItemForeground): Updated for
833         change to applyTextTransform.
834
835         * rendering/RenderMenuList.cpp:
836         (WebCore::RenderMenuList::adjustInnerStyle): Updated for change
837         to RenderText::text.
838         (RenderMenuList::updateOptionsWidth): Updated for change to
839         applyTextTransform.
840         (RenderMenuList::itemText const): Ditto.
841
842         * rendering/RenderText.cpp:
843         (WebCore::capitalize): Renamed from makeCapitalized. Changed to
844         take and return a String instead of taking a String*.
845         (WebCore::RenderText::RenderText): Use isAllASCII. Also moved
846         initialization of most non-bitfield members to the class definition.
847         (WebCore::RenderText::positionForPoint): Use text().
848         (WebCore::RenderText::widthFromCache const): Ditto.
849         (WebCore::RenderText::hangablePunctuationStartWidth const): Ditto.
850         (WebCore::RenderText::hangablePunctuationEndWidth const): Ditto.
851         (WebCore::RenderText::isHangableStopOrComma): Ditto.
852         (WebCore::RenderText::firstCharacterIndexStrippingSpaces const): Ditto.
853         (WebCore::RenderText::lastCharacterIndexStrippingSpaces const): Ditto.
854         (WebCore::RenderText::trimmedPreferredWidths): Changed to return values
855         in a structure instead of taking lots of arguments.
856         (WebCore::RenderText::computePreferredLogicalWidths): Updated to use
857         the text() function.
858         (WebCore::isAllCollapsibleWhitespace): Added.
859         (WebCore::RenderText::isAllCollapsibleWhitespace const): Updated to
860         use a tighter loop.
861         (WebCore::isAllPossiblyCollapsibleWhitespace): Added.
862         (WebCore::RenderText::containsOnlyHTMLWhitespace const): Updated to
863         use a tighter loop. Renamed from containsOnlyWhitespace.
864         (WebCore::RenderText::setTextWithOffset): Updated to  use text().
865         (WebCore::isInlineFlowOrEmptyText): Rewrote to be easier to read.
866         (WebCore::RenderText::previousCharacter const): Got rid of unneeded
867         null check and simplified.
868         (WebCore::applyTextTransform): Changed to return a String rather
869         than modifying one that is passed in.
870         (WebCore::RenderText::setRenderedText): Updated use of applyTextTransform.
871         (WebCore::RenderText::secureText): More of the same.
872         (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const): Ditto.
873         (WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const): Ditto.
874         (WebCore::RenderText::width const): Ditto.
875         (WebCore::RenderText::collectSelectionRectsForLineBoxes): Ditto.
876         (WebCore::RenderText::previousOffset const): Ditto.
877         (WebCore::RenderText::previousOffsetForBackwardDeletion const): Ditto.
878         (WebCore::RenderText::nextOffset const): Ditto.
879         (WebCore::RenderText::computeCanUseSimpleFontCodePath const): Ditto.
880         (WebCore::RenderText::stringView const): Ditto.
881
882         * rendering/RenderText.h: Made some more members private and final.
883         Updated for above, including adding the Widths structure. Got rid of the
884         textLength function, which existed as a workaround before we could mark
885         a function like length final. Made the text function return a StringImpl&,
886         which is good since the m_text string is never null, and so callers end
887         up using StringImpl directly and saving null checks. Removed functions
888         that are not needed, including is8Bit, characters8, characters16,
889         uncheckedCharacterAt, operator[], and isAllASCII.
890
891         * rendering/RenderTextFragment.cpp:
892         (WebCore::RenderTextFragment::setText): Use text().length().
893         * rendering/RenderTextLineBoxes.cpp:
894         (WebCore::RenderTextLineBoxes::caretMaxOffset const): Ditto.
895         (WebCore::RenderTextLineBoxes::positionForPoint const): Ditto.
896         (WebCore::RenderTextLineBoxes::setSelectionState): Ditto.
897         (WebCore::RenderTextLineBoxes::absoluteQuads const): Ditto.
898         * rendering/SimpleLineLayout.cpp:
899         (WebCore::SimpleLineLayout::canUseForFontAndText): Ditto.
900         * rendering/SimpleLineLayoutCoverage.cpp:
901         (WebCore::SimpleLineLayout::textLengthForSubtree): Ditto.
902         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Ditto.
903         * rendering/SimpleLineLayoutFlowContents.cpp:
904         (WebCore::SimpleLineLayout::initializeSegments): Ditto.
905         * rendering/SimpleLineLayoutFunctions.cpp:
906         (WebCore::SimpleLineLayout::textOffsetForPoint): Ditto.
907         * rendering/SimpleLineLayoutFunctions.h:
908         (WebCore::SimpleLineLayout::findCaretMaximumOffset): Ditto.
909         * rendering/line/BreakingContext.h:
910         (WebCore::shouldAddBorderPaddingMargin): Ditto.
911         (WebCore::shouldSkipWhitespaceAfterStartObject): Ditto.
912         (WebCore::iteratorIsBeyondEndOfRenderCombineText): Ditto.
913         (WebCore::textWidth): Ditto.
914         (WebCore::BreakingContext::handleText): Ditto.
915         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Ditto.
916         * rendering/line/TrailingObjects.cpp:
917         (WebCore::TrailingObjects::updateWhitespaceCollapsingTransitionsForTrailingBoxes): Ditto.
918
919         * rendering/mathml/RenderMathMLFenced.cpp:
920         (WebCore::RenderMathMLFenced::updateFromElement): Removed stray use of "unsigned int".
921
922         * rendering/svg/RenderSVGInlineText.cpp:
923         (WebCore::RenderSVGInlineText::characterStartsNewTextChunk const): Use text().length().
924         (WebCore::RenderSVGInlineText::positionForPoint): Ditto.
925         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
926         (WebCore::processRenderSVGInlineText): Ditto.
927         * rendering/svg/SVGTextLayoutEngine.cpp:
928         (WebCore::SVGTextLayoutEngine::currentLogicalCharacterAttributes): Ditto.
929         * rendering/svg/SVGTextQuery.cpp:
930         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures const): Ditto.
931
932         * style/RenderTreeUpdater.cpp:
933         (WebCore::RenderTreeUpdater::updateRenderTree): Use isAllSpecialCharacters<isHTMLSpace>.
934         (WebCore::RenderTreeUpdater::textRendererIsNeeded): Ditto.
935
936         * svg/SVGTests.cpp:
937         (WebCore::SVGTests::hasFeatureForLegacyBindings): Use startsWithLettersIgnoringASCIICase.
938         * xml/parser/XMLDocumentParserLibxml2.cpp:
939         (WebCore::shouldAllowExternalLoad): Ditto.
940
941 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
942
943         [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
944         https://bugs.webkit.org/show_bug.cgi?id=179972
945
946         Reviewed by Carlos Garcia Campos.
947
948         During layer flushes, when a CoordinatedGraphicsLayer's tiled backing store
949         has dirty tiles that need to be updated, the following chain of calls would
950         be invoked to perform the painting, starting in
951         CoordinatedGraphicsLayer::updateContentBuffers():
952         |- CoordinatedGraphicsLayer::updateContentBuffers()
953          |- TiledBackingStore::updateTileBuffers()
954           |- Tile::updateBackBuffer()
955            |- CoordinatedGraphicsLayer::paintToSurface()
956             |- CompositingCoordinator::paintToSurface()
957              |- UpdateAtlas::paintOnAvailableBuffer()
958               |- ThreadSafeCoordinatedSurface::paintToSurface()
959                |- Tile::paintToSurfaceContext()
960                 |- CoordinatedGraphicsLayer::tiledBackingStorePaint()
961                  |- GraphicsLayer::paintGraphicsLayerContents()
962
963         That's a bit much.
964
965         In CoordinatedGraphicsLayer::updateContentBuffers(), we now first retrieve
966         all the dirty layers in our TiledBackingStore. We then iterate through them,
967         first establishing their ID and then retrieving an available CoordinatedBuffer
968         that we can use for painting. The CoordinatedBuffer is retrieved through
969         CompositingCoordinator, which is still caching these buffers via UpdateAtlas
970         objects.
971
972         With a CoordinatedBuffer available, we can then proceed with painting. The
973         painting context has to be properly set up to paint into the correct area of
974         the given buffer, and the alpha channel, if necessary, has to be addressed.
975         After properly positioning and scaling ourselves on the given context, we
976         can proceed with the GraphicsLayer::paintGraphicsLayerContents() call.
977
978         What's left is filling out the missing SurfaceUpdateInfo information which is
979         then passed to the updateTile() method that properly registers the tile
980         update we've just performed. The tile itself is marked clean. After the
981         iteration, we call the didUpdateTileBuffers() method in case any successful
982         tile update was indeed performed, incrementing the repaint counter.
983
984         That's it -- we clipped 8 calls from the call chain. We can now also remove
985         the CoordinatedBuffer::Client interface, as well as slim down the
986         TiledBackingStore interface. The Tile class is cleaned up a bit, with methods
987         shifted into a more sensible order.
988
989         No new tests -- no change in functionality.
990
991         * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:
992         * platform/graphics/texmap/coordinated/CoordinatedBuffer.h:
993         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
994         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
995         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
996         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaint): Deleted.
997         (WebCore::CoordinatedGraphicsLayer::paintToSurface): Deleted.
998         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
999         * platform/graphics/texmap/coordinated/Tile.cpp:
1000         (WebCore::Tile::ensureTileID):
1001         (WebCore::Tile::isDirty const):
1002         (WebCore::Tile::invalidate):
1003         (WebCore::Tile::markClean):
1004         (WebCore::Tile::updateBackBuffer): Deleted.
1005         (WebCore::Tile::paintToSurfaceContext): Deleted.
1006         * platform/graphics/texmap/coordinated/Tile.h:
1007         (WebCore::Tile::tileID const):
1008         (WebCore::Tile::dirtyRect const):
1009         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1010         (WebCore::TiledBackingStore::dirtyTiles):
1011         (WebCore::TiledBackingStore::updateTileBuffers): Deleted.
1012         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1013         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1014
1015 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1016
1017         [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations
1018         https://bugs.webkit.org/show_bug.cgi?id=179970
1019
1020         Reviewed by Carlos Garcia Campos.
1021
1022         Drop CoordinatedBuffer::painToSurface() in favor of a simpler
1023         GraphicsContext reference getter that returns a reference to the
1024         GraphicsContext object of the internal ImageBuffer.
1025
1026         Remove the ImageBackingSurfaceClient class that only acted as a relay
1027         that enabled a CoordinatedBuffer to draw an image through its context.
1028         Instead, we use the GraphicsContext of the allocated CoordinatedBuffer
1029         to draw the image directly. We still use a rectangle whose size
1030         matches the size of the given Image as the clipping area and as the
1031         source and destination rectangle for the image.
1032
1033         No new tests -- no change in behavior.
1034
1035         * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:
1036         (WebCore::CoordinatedBuffer::context):
1037         (WebCore::CoordinatedBuffer::paintToSurface): Deleted.
1038         * platform/graphics/texmap/coordinated/CoordinatedBuffer.h:
1039         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1040         (WebCore::CoordinatedImageBacking::update):
1041         (WebCore::ImageBackingSurfaceClient::ImageBackingSurfaceClient): Deleted.
1042
1043 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1044
1045         [CoordGraphics] TiledBackingStore: use a reference to the client
1046         https://bugs.webkit.org/show_bug.cgi?id=179969
1047
1048         Reviewed by Carlos Garcia Campos.
1049
1050         TiledBackingStore should keep a C++ reference to the TiledBackingStoreClient
1051         object, and not a pointer. client() method is updated to reflect that, and
1052         uses of this method and the member variable are updated accordingly.
1053
1054         No new tests -- no change in behavior.
1055
1056         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1057         (WebCore::CoordinatedGraphicsLayer::createBackingStore):
1058         * platform/graphics/texmap/coordinated/Tile.cpp:
1059         (WebCore::Tile::~Tile):
1060         (WebCore::Tile::updateBackBuffer):
1061         (WebCore::Tile::paintToSurfaceContext):
1062         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1063         (WebCore::TiledBackingStore::TiledBackingStore):
1064         (WebCore::TiledBackingStore::updateTileBuffers):
1065         (WebCore::TiledBackingStore::createTiles):
1066         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1067         (WebCore::TiledBackingStore::client):
1068
1069 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1070
1071         [CoordGraphics] Early tile buffer update in TiledBackingStore::createTiles() is unnecessary
1072         https://bugs.webkit.org/show_bug.cgi?id=179968
1073
1074         Reviewed by Carlos Garcia Campos.
1075
1076         Under CoordinatedGraphicsLayer::updateContentBuffers(), the TiledBackingStore
1077         object has the createTilesIfNeeded() method invoked, if necessary. This
1078         invokes createTiles(), where the edge tiles are resized if necessary, and
1079         the missing tiles are created. If any of those two cases is fulfilled, the
1080         updateTileBuffers() method is invoked, updating any dirty tiles (i.e. the
1081         ones that were resized or newly-created).
1082
1083         This specific invocation of updateTileBuffers() is not needed since it's the
1084         very next method that's invoked on the TiledBackingStore object by
1085         CoordinatedGraphicsLayer::updateContentBuffers(). It's therefore removed,
1086         and the resizeEdgeTiles() method is changed to not return any value.
1087
1088         No new tests -- no change in behavior.
1089
1090         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1091         (WebCore::TiledBackingStore::createTiles):
1092         (WebCore::TiledBackingStore::resizeEdgeTiles):
1093         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1094
1095 2017-11-23  Antti Koivisto  <antti@apple.com>
1096
1097         RenderBlockFlow::layoutRunsAndFloatsInRange is O(n^2) for runs of inlines without any text
1098         https://bugs.webkit.org/show_bug.cgi?id=179950
1099
1100         Reviewed by Simon Fraser.
1101
1102         It calls createBidiRunsForLine for each line. createBidiRunsForLine traverses past the end of the line until
1103         it finds the end of the current bidi run. If there is no text in the flow, it never finds anything and traverses
1104         the entire flow. This is O(n^2) for the number of renderers in the flow.
1105
1106         Tested by PerformanceTests/Layout/inline-layout-no-text.html
1107
1108         * platform/text/BidiResolver.h:
1109         (WebCore::BidiResolverBase::needsContinuePastEnd const):
1110         (WebCore::BidiResolverBase::needsContinuePastEndInternal const):
1111         (WebCore::DerivedClass>::createBidiRunsForLine):
1112
1113             When past end of line call needsContinuePastEnd() to see if we need to continue searching for the end of the bidi run.
1114
1115         * rendering/InlineIterator.h:
1116         (WebCore::InlineBidiResolver::needsContinuePastEndInternal const):
1117
1118             InlineBidiResolver only returns runs up to the last renderer on the line and can bail out.
1119
1120 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1121
1122         [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
1123         https://bugs.webkit.org/show_bug.cgi?id=179967
1124
1125         Reviewed by Carlos Garcia Campos.
1126
1127         Roll the CoordinatedSurface and ThreadSafeCoordinatedSurface classes
1128         into one CoordinatedBuffer class.
1129
1130         CoordinatedBuffer class mimics CoordinatedSurface in providing the
1131         Client class that allows specifying how the client should paint using a
1132         GraphicsContext object. supportsAlpha() and size() methods are also
1133         present, as well as paintToSurface(). uploadImage() retrieves the
1134         Image that's created from the contained ImageBuffer, allowing the user
1135         to then manually upload the buffer data onto the GPU.
1136
1137         CoordinatedBuffer otherwise serves as a drop-in replacement for the
1138         CoordinatedSurface class, and the remaining changes in the
1139         CoordiantedGraphics code reflect that.
1140
1141         No new tests -- no change in behavior.
1142
1143         * platform/TextureMapper.cmake:
1144         * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp: Added.
1145         (WebCore::CoordinatedBuffer::create):
1146         (WebCore::CoordinatedBuffer::CoordinatedBuffer):
1147         (WebCore::CoordinatedBuffer::paintToSurface):
1148         (WebCore::CoordinatedBuffer::uploadImage):
1149         * platform/graphics/texmap/coordinated/CoordinatedBuffer.h: Added.
1150         (WebCore::CoordinatedBuffer::supportsAlpha const):
1151         (WebCore::CoordinatedBuffer::size const):
1152         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1153         (WebCore::CoordinatedGraphicsLayer::paintToSurface):
1154         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1155         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1156         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1157         (WebCore::CoordinatedImageBacking::update):
1158         (WebCore::CoordinatedImageBacking::releaseSurfaceIfNeeded):
1159         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
1160         * platform/graphics/texmap/coordinated/CoordinatedSurface.cpp: Removed.
1161         * platform/graphics/texmap/coordinated/CoordinatedSurface.h: Removed.
1162         * platform/graphics/texmap/coordinated/Tile.h:
1163         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1164
1165 2017-11-22  Simon Fraser  <simon.fraser@apple.com>
1166
1167         FEComponentTransfer cleanup and optimization
1168         https://bugs.webkit.org/show_bug.cgi?id=179952
1169
1170         Reviewed by Darin Adler.
1171
1172         Change terminology for FEComponentTransfer to be more explicit about the fact
1173         that it's creating and using lookup tables. Use std::array for the lookup tables.
1174         
1175         Use uint8_t instead of unsigned char.
1176         
1177         Avoid confusing arrays for channels in computeLookupTables; just setup the lut for
1178         each channel manually.
1179         
1180         This is about 1.25x faster than before.
1181
1182         * platform/graphics/filters/FEComponentTransfer.cpp:
1183         (WebCore::FEComponentTransfer::computeIdentityTable):
1184         (WebCore::FEComponentTransfer::computeTabularTable):
1185         (WebCore::FEComponentTransfer::computeDiscreteTable):
1186         (WebCore::FEComponentTransfer::computeLinearTable):
1187         (WebCore::FEComponentTransfer::computeGammaTable):
1188         (WebCore::FEComponentTransfer::platformApplySoftware):
1189         (WebCore::FEComponentTransfer::computeLookupTables):
1190         (WebCore::operator<<):
1191         (WebCore::identity): Deleted.
1192         (WebCore::table): Deleted.
1193         (WebCore::discrete): Deleted.
1194         (WebCore::linear): Deleted.
1195         (WebCore::gamma): Deleted.
1196         (WebCore::FEComponentTransfer::getValues): Deleted.
1197         * platform/graphics/filters/FEComponentTransfer.h:
1198         (WebCore::ComponentTransferFunction::ComponentTransferFunction): Deleted.
1199
1200 2017-11-22  Javier Fernandez  <jfernandez@igalia.com>
1201
1202         [css-grid] Refactoring and new namespace with grid related utility functions
1203         https://bugs.webkit.org/show_bug.cgi?id=179633
1204
1205         Reviewed by Darin Adler.
1206
1207         Added a new namespace with several utility functions to share logic
1208         between RenderGrid and GridTrackSizingAlgorithm.
1209
1210         No new tests, since no new functionality is added.
1211
1212         * Sources.txt:
1213         * WebCore.xcodeproj/project.pbxproj:
1214         * rendering/GridLayoutUtils.cpp: Added.
1215         (WebCore::GridLayoutUtils::computeMarginLogicalSizeForChild):
1216         (WebCore::GridLayoutUtils::marginLogicalSizeForChild):
1217         (WebCore::GridLayoutUtils::isOrthogonalChild):
1218         (WebCore::GridLayoutUtils::flowAwareDirectionForChild):
1219         * rendering/GridLayoutUtils.h: Added.
1220         * rendering/GridTrackSizingAlgorithm.cpp:
1221         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild const):
1222         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
1223         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
1224         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
1225         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1226         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
1227         * rendering/RenderGrid.cpp:
1228         (WebCore::RenderGrid::layoutBlock):
1229         (WebCore::RenderGrid::placeItemsOnGrid const):
1230         (WebCore::RenderGrid::layoutPositionedObject):
1231         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching const):
1232         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1233         (WebCore::RenderGrid::isInlineBaselineAlignedChild const):
1234         (WebCore::RenderGrid::firstLineBaseline const):
1235         (WebCore::RenderGrid::columnAxisPositionForChild const):
1236         (WebCore::RenderGrid::rowAxisPositionForChild const):
1237         (WebCore::RenderGrid::columnAxisOffsetForChild const):
1238         (WebCore::RenderGrid::rowAxisOffsetForChild const):
1239         (WebCore::RenderGrid::findChildLogicalPosition const):
1240
1241 2017-11-22  Ali Juma  <ajuma@chromium.org>
1242
1243         Implement VisualViewport API attributes
1244         https://bugs.webkit.org/show_bug.cgi?id=179385
1245
1246         Reviewed by Frédéric Wang.
1247
1248         Add a visualViewport attribute to Window, and implement the VisualViewport
1249         interface (https://wicg.github.io/visual-viewport/#the-visualviewport-interface).
1250
1251         This is behind a newly-added VisualViewportAPI experimental feature flag.
1252
1253         Tests: fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html
1254                fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html
1255                fast/visual-viewport/viewport-dimensions-iframe.html
1256                fast/visual-viewport/viewport-dimensions-under-page-zoom.html
1257                fast/visual-viewport/viewport-dimensions.html
1258
1259         * CMakeLists.txt:
1260         * DerivedSources.cpp:
1261         * DerivedSources.make:
1262         * Sources.txt:
1263         * WebCore.xcodeproj/project.pbxproj:
1264         * bindings/js/WebCoreBuiltinNames.h:
1265         * dom/EventTargetFactory.in:
1266         * page/DOMWindow.cpp:
1267         (WebCore::DOMWindow::~DOMWindow):
1268         (WebCore::DOMWindow::resetDOMWindowProperties):
1269         (WebCore::DOMWindow::visualViewport const):
1270         * page/DOMWindow.h:
1271         * page/DOMWindow.idl:
1272         * page/Settings.yaml:
1273         * page/VisualViewport.cpp: Added.
1274         (WebCore::VisualViewport::VisualViewport):
1275         (WebCore::VisualViewport::eventTargetInterface const):
1276         (WebCore::VisualViewport::scriptExecutionContext const):
1277         (WebCore::getFrameViewAndLayoutIfNonNull):
1278         (WebCore::VisualViewport::offsetLeft const):
1279         (WebCore::VisualViewport::offsetTop const):
1280         (WebCore::VisualViewport::pageLeft const):
1281         (WebCore::VisualViewport::pageTop const):
1282         (WebCore::VisualViewport::width const):
1283         (WebCore::VisualViewport::height const):
1284         (WebCore::VisualViewport::scale const):
1285         * page/VisualViewport.h: Added.
1286         * page/VisualViewport.idl: Added.
1287
1288 2017-11-22  Manuel Rego Casasnovas  <rego@igalia.com>
1289
1290         Available height is wrong for positioned elements with "box-sizing: border-box"
1291         https://bugs.webkit.org/show_bug.cgi?id=178783
1292
1293         Reviewed by Darin Adler.
1294
1295         These methods were returning a wrong value for positioned items
1296         in combination with "box-sizing: border-box".
1297         The problem was that if the height of the element is given
1298         by its offset properties (top and bottom) we don't need to call
1299         adjustContentBoxLogicalHeightForBoxSizing().
1300
1301         Tests: fast/box-sizing/fill-available.html
1302                fast/box-sizing/replaced.html
1303
1304         * rendering/RenderBox.cpp:
1305         (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
1306         (WebCore::RenderBox::availableLogicalHeightUsing const):
1307
1308 2017-11-22  Christopher Reid  <chris.reid@sony.com>
1309
1310         WebCoreObjCExtras.h is being included in too many places
1311         https://bugs.webkit.org/show_bug.cgi?id=179931
1312
1313         Reviewed by Darin Adler.
1314
1315         No new tests no change in behavior.
1316
1317         Fixing cases where WebCoreObjCExtras.h is imported but not used.
1318
1319         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1320         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1321         * platform/mac/WebCoreNSURLExtras.mm:
1322
1323 2017-11-22  Antoine Quint  <graouts@apple.com>
1324
1325         [Web Animations] Adopt KeyframeList in KeyframeEffect
1326         https://bugs.webkit.org/show_bug.cgi?id=179941
1327         <rdar://problem/35666924>
1328
1329         Reviewed by Darin Adler.
1330
1331         KeyframeEffect used to model its keyframes by creating a new Keyframe struct and storing them in a Vector<Keyframe>.
1332         However, there already is a way to model keyframes in WebCore using the KeyframeList class. We now adopt this class
1333         in KeyframeEffect, which makes it possible to run hardware-composited animations using RenderBoxModelObject::startAnimation()
1334         in a follow-up patch, since this function expects a KeyframeList.
1335
1336         No news tests, this is an internals change and does not yield any changes in Web content.
1337
1338         * animation/KeyframeEffect.cpp:
1339         (WebCore::KeyframeEffect::KeyframeEffect): Create a default m_keyframes at construction time.
1340         (WebCore::KeyframeEffect::processKeyframes): Create a temporary KeyframeList as we parse keyframes passed from the JS API
1341         and assign it to m_keyframes upon successful parsing. We also use cssPropertyId to refer to a CSSPropertyID to make the code
1342         clearer and ensure there is no confusion with JS properties that we manipulate in this function.
1343         (WebCore::KeyframeEffect::computeStackingContextImpact): Use the list of CSS properties exposed on KeyframeList directly rather
1344         than enumerating each keyframe and use cssPropertyId to refer to individual CSSPropertyID values for consistency.
1345         (WebCore::KeyframeEffect::applyAtLocalTime): Use the list of CSS properties exposed on KeyframeList directly rather than
1346         using the properties specified on the first keyframe only. We also remove a stale FIXME comment which was addressed in r224957.
1347         * animation/KeyframeEffect.h: Remove the Keyframe struct and change the type of m_keyframes from Vector<Keyframe> to KeyframeList.
1348         * rendering/style/KeyframeList.h:
1349         (WebCore::KeyframeList::KeyframeList): We remove the default insertions at KeyframeList construction time since it requires
1350         an immediate call to clear() when doing any meaningful work with a KeyframeList. We also add the default move assignment operator
1351         to allow KeyframeEffect::processKeyframes() to make a move assignment from the temporary keyframe list we build at parsing to the
1352         member variable.
1353
1354 2017-11-22  Commit Queue  <commit-queue@webkit.org>
1355
1356         Unreviewed, rolling out r225093.
1357         https://bugs.webkit.org/show_bug.cgi?id=179938
1358
1359         Compilation failed on WinCairo 64-bit Release (Requested by
1360         fredw on #webkit).
1361
1362         Reverted changeset:
1363
1364         "Implement VisualViewport API attributes"
1365         https://bugs.webkit.org/show_bug.cgi?id=179385
1366         https://trac.webkit.org/changeset/225093
1367
1368 2017-11-21  Ali Juma  <ajuma@chromium.org>
1369
1370         Implement VisualViewport API attributes
1371         https://bugs.webkit.org/show_bug.cgi?id=179385
1372
1373         Reviewed by Frédéric Wang.
1374
1375         Add a visualViewport attribute to Window, and implement the VisualViewport
1376         interface (https://wicg.github.io/visual-viewport/#the-visualviewport-interface).
1377
1378         This is behind a newly-added VisualViewportAPI experimental feature flag.
1379
1380         Tests: fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html
1381                fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html
1382                fast/visual-viewport/viewport-dimensions-iframe.html
1383                fast/visual-viewport/viewport-dimensions-under-page-zoom.html
1384                fast/visual-viewport/viewport-dimensions.html
1385
1386         * CMakeLists.txt:
1387         * DerivedSources.cpp:
1388         * DerivedSources.make:
1389         * Sources.txt:
1390         * WebCore.xcodeproj/project.pbxproj:
1391         * bindings/js/WebCoreBuiltinNames.h:
1392         * dom/EventTargetFactory.in:
1393         * page/DOMWindow.cpp:
1394         (WebCore::DOMWindow::~DOMWindow):
1395         (WebCore::DOMWindow::resetDOMWindowProperties):
1396         (WebCore::DOMWindow::visualViewport const):
1397         * page/DOMWindow.h:
1398         * page/DOMWindow.idl:
1399         * page/Settings.yaml:
1400         * page/VisualViewport.cpp: Added.
1401         (WebCore::VisualViewport::VisualViewport):
1402         (WebCore::VisualViewport::eventTargetInterface const):
1403         (WebCore::VisualViewport::scriptExecutionContext const):
1404         (WebCore::getFrameViewAndLayoutIfNonNull):
1405         (WebCore::VisualViewport::offsetLeft const):
1406         (WebCore::VisualViewport::offsetTop const):
1407         (WebCore::VisualViewport::pageLeft const):
1408         (WebCore::VisualViewport::pageTop const):
1409         (WebCore::VisualViewport::width const):
1410         (WebCore::VisualViewport::height const):
1411         (WebCore::VisualViewport::scale const):
1412         * page/VisualViewport.h: Added.
1413         * page/VisualViewport.idl: Added.
1414
1415 2017-11-21  Frederic Wang  <fwang@igalia.com>
1416
1417         Async frame scrolling: handle fixed root backgrounds in frames
1418         https://bugs.webkit.org/show_bug.cgi?id=176261
1419
1420         Based on patch by Simon Fraser <simon.fraser@apple.com>
1421         Reviewed by Antonio Gomes.
1422
1423         For frames with tiled backing, we register a slow-repaint object because we hit
1424         RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
1425         view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
1426         ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
1427         called. It also removes the opaque background of non-main frames with tiled backing.
1428         This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.
1429
1430         Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
1431
1432         * rendering/RenderLayerBacking.cpp:
1433         (WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
1434         tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
1435         (WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
1436         return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
1437         repaint object previously registered for this frame. Also add an ASSERT to ensure that a
1438         fixed root background is only set for frames with async scrolling.
1439         (WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
1440         of background and opaqueness to the main frame.
1441
1442 2017-11-21  Zan Dobersek  <zdobersek@igalia.com>
1443
1444         Drop ENABLE_IMAGE_DECODER_DOWN_SAMPLING code
1445         https://bugs.webkit.org/show_bug.cgi?id=179921
1446
1447         Reviewed by Carlos Garcia Campos.
1448
1449         Drop the ENABLE_IMAGE_DECODER_DOWN_SAMPLING code, along with the build
1450         guard definitions in WTF and CMake.
1451
1452         This was apparently in use in the Qt port, but since then no port
1453         enables this. It's not exposed in the Xcode build, and the CMake option
1454         is disabled by default, with no way to enable it through build-webkit.
1455
1456         While the code guarded with this build guard is removed, there's still
1457         code in the ScalableImageDecoder class that only operated when this
1458         feature was enabled. This should be addressed in the future, after
1459         evaluating the need for this scaling capability.
1460
1461         No new tests -- no change in behavior.
1462
1463         * platform/graphics/Image.cpp:
1464         (WebCore::Image::adjustSourceRectForDownSampling const): Deleted.
1465         * platform/graphics/Image.h:
1466         * platform/graphics/cairo/CairoOperations.cpp:
1467         (WebCore::Cairo::drawNativeImage):
1468         * platform/image-decoders/ScalableImageDecoder.h:
1469         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1470         (WebCore::JPEGImageReader::decode):
1471         * platform/image-decoders/png/PNGImageDecoder.cpp:
1472         (WebCore::PNGImageDecoder::rowAvailable):
1473         (WebCore::PNGImageDecoder::frameComplete):
1474
1475 2017-11-21  Commit Queue  <commit-queue@webkit.org>
1476
1477         Unreviewed, rolling out r225089.
1478         https://bugs.webkit.org/show_bug.cgi?id=179937
1479
1480         This patch caused compilation failures (Requested by fredw on
1481         #webkit).
1482
1483         Reverted changeset:
1484
1485         "Async frame scrolling: handle fixed root backgrounds in
1486         frames"
1487         https://bugs.webkit.org/show_bug.cgi?id=176261
1488         https://trac.webkit.org/changeset/225089
1489
1490 2017-11-21  Frederic Wang  <fwang@igalia.com>
1491
1492         Async frame scrolling: handle fixed root backgrounds in frames
1493         https://bugs.webkit.org/show_bug.cgi?id=176261
1494
1495         Based on patch by Simon Fraser <simon.fraser@apple.com>
1496         Reviewed by Antonio Gomes.
1497
1498         For frames with tiled backing, we register a slow-repaint object because we hit
1499         RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
1500         view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
1501         ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
1502         called. It also removes the opaque background of non-main frames with tiled backing.
1503         This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.
1504
1505         Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
1506
1507         * rendering/RenderLayerBacking.cpp:
1508         (WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
1509         tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
1510         (WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
1511         return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
1512         repaint object previously registered for this frame. Also add an ASSERT to ensure that a
1513         fixed root background is only set for frames with async scrolling.
1514         (WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
1515         of background and opaqueness to the main frame.
1516
1517 2017-11-21  Simon Fraser  <simon.fraser@apple.com>
1518
1519         Some FELighting cleanup
1520         https://bugs.webkit.org/show_bug.cgi?id=179924
1521
1522         Reviewed by Sam Weinig.
1523
1524         Make the normal-computation functions const and have them return an IntSize.
1525         Replace bit shifting with multiply by two (compilers know how to do this, folks).
1526
1527         * platform/graphics/filters/FELighting.cpp:
1528         (WebCore::FELighting::LightingData::topLeftNormal const):
1529         (WebCore::FELighting::LightingData::topRowNormal const):
1530         (WebCore::FELighting::LightingData::topRightNormal const):
1531         (WebCore::FELighting::LightingData::leftColumnNormal const):
1532         (WebCore::FELighting::LightingData::interiorNormal const):
1533         (WebCore::FELighting::LightingData::rightColumnNormal const):
1534         (WebCore::FELighting::LightingData::bottomLeftNormal const):
1535         (WebCore::FELighting::LightingData::bottomRowNormal const):
1536         (WebCore::FELighting::LightingData::bottomRightNormal const):
1537         (WebCore::FELighting::inlineSetPixel):
1538         (WebCore::FELighting::setPixel):
1539         (WebCore::FELighting::platformApplyGenericPaint):
1540         (WebCore::FELighting::drawLighting):
1541         (WebCore::FELighting::LightingData::topLeft): Deleted.
1542         (WebCore::FELighting::LightingData::topRow): Deleted.
1543         (WebCore::FELighting::LightingData::topRight): Deleted.
1544         (WebCore::FELighting::LightingData::leftColumn): Deleted.
1545         (WebCore::FELighting::LightingData::interior): Deleted.
1546         (WebCore::FELighting::LightingData::rightColumn): Deleted.
1547         (WebCore::FELighting::LightingData::bottomLeft): Deleted.
1548         (WebCore::FELighting::LightingData::bottomRow): Deleted.
1549         (WebCore::FELighting::LightingData::bottomRight): Deleted.
1550         * platform/graphics/filters/FELighting.h:
1551
1552 2017-11-21  Christopher Reid  <chris.reid@sony.com>
1553
1554         [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras
1555         https://bugs.webkit.org/show_bug.cgi?id=179504
1556
1557         Reviewed by Darin Adler.
1558
1559         No new tests no change in behavior.
1560
1561         Removed WebCoreNSStringExtras.
1562         Replaced calls to string helpers in WebCoreNSStringExtras with calls to WTF::String.
1563         Moved filenameByFixingIllegalCharacters into LoaderNSURLExtras.
1564         Moved preferredBundleLocalizationName into WebKitLegacy.
1565
1566         * PlatformMac.cmake: Removed WebCoreNSStringExtras.mm
1567         * SourcesCocoa.txt: Removed WebCoreNSStringExtras.mm
1568         * WebCore.xcodeproj/project.pbxproj: Removed WebCoreNSStringExtras
1569         * loader/mac/LoaderNSURLExtras.h:
1570         * loader/mac/LoaderNSURLExtras.mm:
1571         * platform/graphics/mac/FontCacheMac.mm:
1572         * platform/mac/PasteboardMac.mm:
1573         * platform/mac/WebCoreNSURLExtras.mm:
1574
1575 2017-11-21  Simon Fraser  <simon.fraser@apple.com>
1576
1577         Use vImage to do alpha premultiplication/unpremultiplication in FilterEffect
1578         https://bugs.webkit.org/show_bug.cgi?id=179928
1579
1580         Reviewed by Tim Horton.
1581
1582         The vImage functions are about twice as fast as the existing code.
1583
1584         * platform/graphics/filters/FilterEffect.cpp:
1585         (WebCore::copyPremultiplyingAlpha):
1586         (WebCore::copyUnpremultiplyingAlpha):
1587         (WebCore::FilterEffect::copyUnmultipliedImage):
1588         (WebCore::FilterEffect::copyPremultipliedImage):
1589
1590 2017-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1591
1592         [GLIB] Test FileMonitorTest.DetectChangeAndThenDelete sometimes crashes
1593         https://bugs.webkit.org/show_bug.cgi?id=179909
1594
1595         Reviewed by Michael Catanzaro.
1596
1597         The problem sems to be that the GFileMonitor is created in the main thread, but destroyed in the WorkQueue
1598         thread. We can create the monitor in the WorkQueue thread and do the monitoring there.
1599
1600         Fixes unit test FileMonitorTest.DetectChangeAndThenDelete.
1601
1602         * platform/glib/FileMonitorGLib.cpp:
1603         (WebCore::FileMonitor::FileMonitor): Create the GFileMonitor in the WorkQueue.
1604         (WebCore::FileMonitor::didChange): No need to dispatch the handler in the WorkQueue, since this is now called in
1605         the WorkQueue.
1606
1607 2017-11-21  Zan Dobersek  <zdobersek@igalia.com>
1608
1609         [Cairo] drawNativeImage(), drawPattern() in CairoOperations should operate directly with cairo_surface_t objects
1610         https://bugs.webkit.org/show_bug.cgi?id=179888
1611
1612         Reviewed by Carlos Garcia Campos.
1613
1614         Cairo::drawNativeImage() should receive a valid cairo_surface_t pointer
1615         and work with that, instead of using a NativeImagePtr. Callers are thus
1616         forced to pass the pointer into the drawNativeImage() call, and the
1617         CairoOperations implementation file drops the need to know about the
1618         NativeImagePtr type alias.
1619
1620         Cairo::drawPattern() now accepts pointer to the cairo_surface_t object,
1621         along with an IntSize object that descibes the surface's size. This way
1622         it's up to the caller to retrieve any valid native image for the current
1623         frame and pass that to the drawPattern() call. The need to use IntSize
1624         here is strange, but we should investigate this later.
1625
1626         No new tests -- no change in behavior.
1627
1628         * platform/graphics/cairo/CairoOperations.cpp:
1629         (WebCore::Cairo::drawNativeImage):
1630         (WebCore::Cairo::drawPattern):
1631         * platform/graphics/cairo/CairoOperations.h: Include the Cairo header.
1632         Also fix forward declaration of Cairo::drawGlyphs().
1633         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1634         (WebCore::GraphicsContext::drawNativeImage):
1635         (WebCore::GraphicsContext::drawPattern):
1636         * platform/graphics/cairo/NativeImageCairo.cpp:
1637         (WebCore::drawNativeImage): Execute operation through GraphicsContext,
1638         kicking into effect any recording that could be done this way.
1639
1640 2017-11-21  Zan Dobersek  <zdobersek@igalia.com>
1641
1642         [Cairo] Gradient::fill() should only operate on PlatformContextCairo
1643         https://bugs.webkit.org/show_bug.cgi?id=179887
1644
1645         Reviewed by Carlos Garcia Campos.
1646
1647         In Gradient::fill(), directly invoke Cairo::save() and Cairo::restore(),
1648         instead of doing so indirectly through GraphicsContext::save() and
1649         GraphicsContext::restore(). The latter pair stashes the internal state
1650         that's managed in GraphicsContext, but that doesn't get modified at all
1651         in this case.
1652
1653         No new tests -- no change in behavior.
1654
1655         * platform/graphics/cairo/GradientCairo.cpp:
1656         (WebCore::Gradient::fill):
1657
1658 2017-11-21  Frederic Wang  <fwang@igalia.com>
1659
1660         Remove unintentionally committed .orig file.
1661         https://bugs.webkit.org/show_bug.cgi?id=174131
1662
1663         Unreviewed, fix previous commit.
1664
1665         * rendering/mathml/RenderMathMLScripts.cpp.orig: Removed.
1666
1667 2017-11-21  Frederic Wang  <fwang@igalia.com>
1668
1669         ASSERTION FAILED: !needsLayout() in WebCore::RenderMathMLScripts::firstLineBaseline
1670         https://bugs.webkit.org/show_bug.cgi?id=174131
1671
1672         Reviewed by Alejandro G. Castro.
1673
1674         RenderMathMLScripts::firstLineBaseline() has an ASSERT at the beginning to ensure that the function
1675         is called after the element was laid out. However, this is not respected by HTML table layout as
1676         RenderBlock::firstLineBaseline() is called for elements in a table cell before they are laid out.
1677         This happens for example for RenderGrid::firstLineBaseline() and probably for other renderers.
1678         Additionally, RenderMathMLScripts::firstLineBaseline() only involves calling firstLineBaseline();
1679         logicalTop() or logicalHeight() on the first child box so it is safe to call it before layout, even
1680         if the return value might be wrong at that time. This patch removes this too restrictive ASSERT for
1681         RenderMathMLScripts, for consistency with other implementations of firstLineBaseline().
1682
1683         Test: mathml/cells-and-scripts-crash.html
1684
1685         * rendering/mathml/RenderMathMLScripts.cpp:
1686         (WebCore::RenderMathMLScripts::firstLineBaseline const): Remove the ASSERT.
1687
1688 2017-11-20  Mario Sanchez Prada  <mario@endlessm.com>
1689
1690         [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager
1691         https://bugs.webkit.org/show_bug.cgi?id=177932
1692
1693         Reviewed by Carlos Garcia Campos.
1694
1695         Implemented setCookie(), getCookies() and deleteCookie() in the Soup
1696         backend, and refactored some utility functions and conversions out of
1697         NetworkStorageSessionSoup into a new CookieSoup.cpp file, so
1698         that we now can convert between SoupCookie* and WebCore::Cookie
1699         easily from anywhere (this is now needed from the UI Process).
1700
1701         * platform/Cookie.h: Add declarations for the new conversions.
1702         * platform/SourcesSoup.txt: Add CookieSoup.cpp.
1703         * platform/network/soup/CookieSoup.cpp: Added.
1704         (WebCore::Cookie::Cookie): New constructor, creates a WebCore::Cookie out of a SoupCookie*.
1705         (WebCore::msToSoupDate): Moved from NetworkStorageSessionSoup.cpp.
1706         (WebCore::Cookie::toSoupCookie): New, based on toSoupCookie() from NetworkStorageSessionSoup.cpp.
1707         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1708         (WebCore::NetworkStorageSession::setCookies): Used the new implicit conversion.
1709         (WebCore::NetworkStorageSession::setCookie): Newly implemented.
1710         (WebCore::NetworkStorageSession::deleteCookie): Newly implemented.
1711         (WebCore::NetworkStorageSession::getCookies): Newly implemented.
1712
1713 2017-11-20  Zalan Bujtas  <zalan@apple.com>
1714
1715         Remove slow repaint object from FrameView when style changes.
1716         https://bugs.webkit.org/show_bug.cgi?id=179871
1717
1718         Reviewed by Antti Koivisto.
1719
1720         The "oldStyleSlowScroll" value does not need to be computed. We already know its value
1721         by checking the HashSet. This code is also unnecessarily complicated and error prone
1722         (could lead to UAF errors by leaving stale renderers in the slow paint list).
1723
1724         Test: fast/repaint/slow-repaint-object-crash.html
1725
1726         * rendering/RenderElement.cpp:
1727         (WebCore::RenderElement::styleWillChange):
1728
1729 2017-11-20  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1730
1731         [WPE] GLContextEGLWPE.cpp:44:96: error: invalid cast from type ‘GLNativeWindowType {aka long long unsigned int}’ to type ‘EGLNativeWindowType {aka unsigned int}
1732         https://bugs.webkit.org/show_bug.cgi?id=179511
1733
1734         Reviewed by Žan Doberšek.
1735
1736         r217208 changed the definition of GLNativeWindowType from EGLNativeWindowType to uint64_t for platform WPE.
1737         This built fine on a 64-bit platform since uint64_t matches the size of a pointer, but fails on 32-bits.
1738
1739         This switches back the definition to EGLNativeWindowType.
1740         And we need to include <EGL/eglplatform.h> first in order to get a definition for EGLNativeWindowType itself.
1741
1742         This commit pretty much reverts the changes r217208 did on platform/graphics/GLContext.h
1743
1744         No new tests, it is a build fix.
1745
1746         * platform/graphics/GLContext.h:
1747
1748 2017-11-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1749
1750         Remove ENABLE_ALLINONE_BUILD option
1751         https://bugs.webkit.org/show_bug.cgi?id=179823
1752
1753         Reviewed by Darin Adler.
1754
1755         * CMakeLists.txt:
1756
1757 2017-11-20  Emilio Cobos Álvarez  <emilio@crisal.io>
1758
1759         Incorrect computed style in pseudo-elements with display: contents
1760         https://bugs.webkit.org/show_bug.cgi?id=179812
1761
1762         Reviewed by Antti Koivisto.
1763
1764         Bug 178513 gave them an anon renderer as the main renderer. Unfortunately, the
1765         style of that box is exposed via getComputedStyle, so that needs to be handled
1766         somehow to return the correct style.
1767
1768         Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
1769
1770         * css/CSSComputedStyleDeclaration.cpp:
1771         (WebCore::ComputedStyleExtractor::styledRenderer const):
1772           Don't return a display: contents pseudo anon box.
1773         * dom/Element.cpp:
1774         (WebCore::Element::hasDisplayContents const):
1775           Just look at the rare data style.
1776         (WebCore::Element::existingComputedStyle const):
1777           Look at the rare data first. This also fixes an inefficiency in the
1778           sense that before then we'd compare the anon box style to the
1779           pseudo-element style during style update, that may be more changes
1780           than needed.
1781         * style/RenderTreeUpdaterGeneratedContent.cpp:
1782         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1783         * style/StyleTreeResolver.cpp:
1784         (WebCore::Style::TreeResolver::resolvePseudoStyle):
1785           Move the anon box creation to render tree update instead of style
1786           resolution.
1787
1788 2017-11-19  Tim Horton  <timothy_horton@apple.com>
1789
1790         Remove unused TOUCH_ICON_LOADING feature flag
1791         https://bugs.webkit.org/show_bug.cgi?id=179873
1792
1793         Reviewed by Simon Fraser.
1794
1795         * Configurations/FeatureDefines.xcconfig:
1796
1797 2017-11-19  Tim Horton  <timothy_horton@apple.com>
1798
1799         Remove unused LEGACY_VENDOR_PREFIXES feature flag
1800         https://bugs.webkit.org/show_bug.cgi?id=179872
1801
1802         Reviewed by Darin Adler.
1803
1804         * Configurations/FeatureDefines.xcconfig:
1805
1806 2017-11-18  Darin Adler  <darin@apple.com>
1807
1808         Eliminate some cases of double hashing, other related refactoring
1809         https://bugs.webkit.org/show_bug.cgi?id=179867
1810
1811         Reviewed by Sam Weinig.
1812
1813         * Modules/indexeddb/IDBTransaction.cpp:
1814         (WebCore::IDBTransaction::objectStore): Use get instead of find.
1815
1816         * Modules/mediasource/MediaSourceRegistry.cpp:
1817         (WebCore::MediaSourceRegistry::unregisterURL): Use take instead of find/remove.
1818
1819         * accessibility/AXObjectCache.cpp:
1820         (WebCore::AXObjectCache::~AXObjectCache): Call setAXObjectID instead of
1821         using the removeAXID, which doesn't do anything else useful in the destructor.
1822         (WebCore::AXObjectCache::remove): Use take instead of get/remove. Also rearrange
1823         logic to eliminate the removeAXID function.
1824         (WebCore::AXObjectCache::removeAXID): Deleted. This only did two things,
1825         setAXObjectID(0) and remove from m_idsInUse, and was only called in one place
1826         besides the destructor. Clearer to not have this funtion.
1827         (WebCore::AXObjectCache::visiblePositionForTextMarkerData): Use m_idsInUse
1828         directly instead of using a function.
1829
1830         * accessibility/AXObjectCache.h: Deleted removeAXID and isIDinUse.
1831
1832         * dom/Document.cpp:
1833         (WebCore::Document::removedLastRef): Call UserActionElementSet::clear instead
1834         of UserActionElementSet::documentDidRemoveLastRef; new name fo the same function.
1835         (WebCore::Document::updateHoverActiveState): Use a reference when calling
1836         setInActiveChain.
1837
1838         * dom/Element.cpp:
1839         (WebCore::Element::isUserActionElementInActiveChain const): Pass reference
1840         instead of pointer.
1841         (WebCore::Element::isUserActionElementActive const): Ditto.
1842         (WebCore::Element::isUserActionElementFocused const): Ditto.
1843         (WebCore::Element::isUserActionElementHovered const): Ditto.
1844         (WebCore::Element::setActive): Ditto.
1845         (WebCore::Element::setFocus): Ditto.
1846         (WebCore::Element::setHovered): Ditto.
1847         (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer): Ditto.
1848
1849         * dom/GenericEventQueue.cpp:
1850         (WebCore::GenericEventQueue::resume): Removed unneeded speical case for
1851         empty vector.
1852
1853         * dom/ProcessingInstruction.cpp:
1854         (WebCore::ProcessingInstruction::checkStyleSheet): Updated now that
1855         parseAttributes returns an optional instead of using a boolean "OK" out argument.
1856
1857         * dom/SelectorQuery.cpp:
1858         (WebCore::SelectorQueryCache::add): Use get instead of find.
1859
1860         * dom/UserActionElementSet.cpp:
1861         (WebCore::UserActionElementSet::didDetach): Deleted. Moved to class definition and
1862         named clearActiveAndHovered.
1863         (WebCore::UserActionElementSet::clear): Renamed documentDidRemoveLastRef to clear.
1864         (WebCore::UserActionElementSet::hasFlag const): Renamed from hasFlags and also
1865         take reference and enumeration instead of pointer and unsigned. Makes it clearer
1866         this does not allow null and that it works on a single flag, not a set of flags.
1867         (WebCore::UserActionElementSet::clearFlags): Changed argument types to reference
1868         and OptionSet to make it clear this works on a set of flags.
1869         (WebCore::UserActionElementSet::setFlags): Ditto.
1870
1871         * dom/UserActionElementSet.h: Updated for changes above. Also made some name
1872         changes, and used an enum class instead of an enum.
1873
1874         * html/BaseCheckableInputType.cpp:
1875         (WebCore::BaseCheckableInputType::saveFormControlState const): Updated since
1876         FormControlState is now just a vector, not a class.
1877         * html/FileInputType.cpp:
1878         (WebCore::FileInputType::filesFromFormControlState): Ditto.
1879         (WebCore::FileInputType::restoreFormControlState): Removed unneeded check that
1880         valueSize is a multiple of 2. Code will ignore any extra strings at the end, so
1881         there is no need for the validity check.
1882
1883         * html/FormController.cpp:
1884         (WebCore::serializeFormControlStateTo): Made a non-member function since
1885         FormControlState is now just a vector, not a class.
1886         (WebCore::deserializeFormControlState): Ditto. Also return optional instead
1887         of relying on a special failure state.
1888         (WebCore::SavedFormState::deserialize): Updated for above changes.
1889         (WebCore::SavedFormState::serializeTo const): Ditto.
1890         (WebCore::SavedFormState::appendControlState): Use add instead of both find and add
1891         to avoid double hashing.
1892         (WebCore::SavedFormState::takeControlState): Removed unneeded check for empty
1893         hash table and tweaked coding style.
1894         (WebCore::SavedFormState::referencedFilePaths const): Renamed to remove "get".
1895         (WebCore::FormKeyGenerator::formKey): Use ensure instead of find and add.
1896         (WebCore::FormController::formElementsCharacterCount const): Don't call
1897         saveFormControlState for non-text-form-controls since we ignored those values.
1898         (WebCore::FormController::willDeleteForm): Take a reference.
1899         (WebCore::FormController::restoreControlStateFor): Update since FormControlState
1900         is now a vector.
1901         (WebCore::FormController::restoreControlStateIn): Use is/downcast and update
1902         since FormControlState is now a vector.
1903         (WebCore::FormController::referencedFilePaths): Renamed to remove "get".
1904         (WebCore::FormController::registerFormElementWithState):Take a reference.
1905         (WebCore::FormController::unregisterFormElementWithState): Ditto.
1906
1907         * html/FormController.h: Removed FormControlState class since it was just a
1908         Vector<String> with various unneeded features, such as a "failure" state,
1909         and a never-looked-at type of "skip" or "restore". Updated for other changes
1910         above.
1911
1912         * html/HTMLFormControlElementWithState.cpp:
1913         (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Pass reference.
1914         (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Ditto.
1915         * html/HTMLFormControlElementWithState.h: Updated for the above. Also added
1916         support for using is/downcast on this.
1917
1918         * html/HTMLFormElement.cpp:
1919         (WebCore::HTMLFormElement::~HTMLFormElement): Pass reference.
1920
1921         * html/HTMLSelectElement.cpp:
1922         (WebCore::HTMLSelectElement::saveFormControlState const): Use reserveInitialCapacit
1923         and uncheckedAppend.
1924         (WebCore::HTMLSelectElement::restoreFormControlState): Updated since state is now
1925         a vector.
1926         * html/HTMLTextAreaElement.cpp:
1927         (WebCore::HTMLTextAreaElement::saveFormControlState const): Ditto.
1928         * html/HiddenInputType.cpp:
1929         (WebCore::HiddenInputType::saveFormControlState const): Ditto.
1930         * html/InputType.cpp:
1931         (WebCore::InputType::saveFormControlState const): Ditto.
1932
1933         * inspector/agents/InspectorCSSAgent.cpp:
1934         (WebCore::InspectorCSSAgent::forcePseudoState): Use get instead of find/end and got
1935         rid of uneeded special case. In another overload, ue add and remove instead of
1936         a find followed by a set or a remove.
1937         (WebCore::InspectorCSSAgent::asInspectorStyleSheet): Use ensure instead of find/set.
1938         (WebCore::InspectorCSSAgent::didRemoveDOMNode): Use take instead of find/remove.
1939         (WebCore::InspectorCSSAgent::didModifyDOMAttr): Use get instead of find.
1940         * inspector/agents/InspectorCSSAgent.h: Removed unneeded NodeToInspectorStyleSheet
1941         typedef and changed value type to Ref instead of RefPtr.
1942
1943         * inspector/agents/InspectorDOMAgent.cpp:
1944         (WebCore::InspectorDOMAgent::unbind): Use remove instead of contains/remove.
1945         (WebCore::InspectorDOMAgent::nodeForId): Use isValidKey instead of just checking for
1946         0 and use get instead of find.
1947         (WebCore::InspectorDOMAgent::setAttributesAsText): Take out bogus const.
1948         (WebCore::InspectorDOMAgent::moveTo): Ditto.
1949         (WebCore::InspectorDOMAgent::resolveNode): Ditto.
1950         (WebCore::InspectorDOMAgent::isWhitespace): Added FIXME. Use is<Text> instead of
1951         slower nodeType.
1952         * inspector/agents/InspectorDOMAgent.h: Removed bogus const.
1953
1954         * inspector/agents/InspectorLayerTreeAgent.cpp:
1955         (WebCore::InspectorLayerTreeAgent::bind): Use ensure instead of get/set.
1956         (WebCore::InspectorLayerTreeAgent::unbind): Use take instead of find/remove.
1957         (WebCore::InspectorLayerTreeAgent::bindPseudoElement): Use ensure instead of get/set.
1958         (WebCore::InspectorLayerTreeAgent::unbindPseudoElement): Use take instead of
1959         find/remove.
1960
1961         * inspector/agents/InspectorPageAgent.cpp:
1962         (WebCore::InspectorPageAgent::getCookies): Use add instead of contains/add.
1963         (WebCore::InspectorPageAgent::frameDetached): Use take instead of find/remove.
1964         (WebCore::InspectorPageAgent::frameId): Use ensure instead of get/set.
1965         (WebCore::InspectorPageAgent::loaderId): Use ensure instead of get/set.
1966         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin): Got rid of unneeded
1967         local variable.
1968
1969         * loader/cache/CachedResourceLoader.cpp:
1970         (WebCore::CachedResourceLoader::sessionID const): Tweaked coding style and added
1971         a null check for page.
1972         (WebCore::CachedResourceLoader::requestResource): Call page directly on the frame
1973         instead of first getting the main frame. Also use take instead of find/remove.
1974         (WebCore::CachedResourceLoader::removeCachedResource): Rewrite assertion.
1975
1976         * platform/graphics/FontGenericFamilies.cpp:
1977         (WebCore::setGenericFontFamilyForScript): Use remove instead of find/remove.
1978         Simplified the logic a bit in the add case.
1979
1980         * platform/graphics/ca/GraphicsLayerCA.cpp:
1981         (WebCore::GraphicsLayerCA::pauseAnimation): Use add instead of find/add.
1982         Removed code that said "if (action != Remove) action = Pause" since that is a
1983         no-op; there are only two actions, Remove and Pause.
1984
1985         * rendering/RenderThemeMac.mm:
1986         (WebCore::RenderThemeMac::mediaControlsScript): Use makeString instead of StringBuilder.
1987         (WebCore::RenderThemeMac::systemColor const): Rewrote to use ensure instead of add.
1988         Also crunched the code a little.
1989
1990         * testing/Internals.cpp:
1991         (WebCore::Internals::getReferencedFilePaths const): Updated function name.
1992
1993         * xml/parser/XMLDocumentParser.h: Updated for change below.
1994         * xml/parser/XMLDocumentParserLibxml2.cpp:
1995         (WebCore::attributesStartElementNsHandler): Updated to use std::optional instead of
1996         a separate boolean for AttributeParseState.
1997         (WebCore::parseAttributes): Ditto. Also changed the return value to work the same way.
1998
1999 2017-11-19  Sam Weinig  <sam@webkit.org>
2000
2001         Clean up gradient code in preparation for conic gradients
2002         https://bugs.webkit.org/show_bug.cgi?id=179595
2003
2004         Reviewed by Darin Adler.
2005
2006         - Switches Gradient to use a Varient with type specific data structs and makes the 
2007           points / radii immutable.
2008         - Replaces CSSGradientValue::addStops with template function CSSGradientValue::computeStops
2009           which dispatches to a helper adoptor struct which is passed in for gradient type specific
2010           values, rather than switching on type in the function itself. In addition, the function no
2011           longer mutates a Gradient, but rather mutates type specific the data struct (e.g. Linear or
2012           Radial for now).
2013
2014         * css/CSSGradientValue.cpp:
2015         (WebCore::LinearGradientAdaptor::LinearGradientAdaptor):
2016         (WebCore::RadialGradientAdaptor::RadialGradientAdaptor):
2017
2018             Add helper structs for the now templatized CSSGradientValue::computeStops that
2019             implement type specific functionality.
2020
2021         (WebCore::CSSGradientValue::computeStops):
2022         
2023             Renamed from addStops. Now takes a GradientAdaptor wrapper which abstracts out
2024             the gradient type specific functionlity.
2025         
2026         (WebCore::CSSLinearGradientValue::createGradient):
2027         (WebCore::CSSRadialGradientValue::createGradient):
2028         (WebCore::CSSConicGradientValue::createGradient):
2029         
2030             Update to call computeStops and use new Gradient create function. 
2031         
2032         * css/CSSGradientValue.h:
2033         
2034             Update for new signature for computeStops.
2035         
2036         * html/canvas/CanvasGradient.cpp:
2037         (WebCore::CanvasGradient::CanvasGradient):
2038         
2039             Update to use new Gradient create function.
2040         
2041         * inspector/InspectorCanvas.cpp:
2042         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
2043         
2044             Update to get gradient point / radii information from the data accessor.
2045
2046         * platform/graphics/Gradient.cpp:
2047         (WebCore::Gradient::Gradient):
2048         
2049             Update constructors to the new data structs.
2050         
2051         (WebCore::Gradient::type const):
2052         
2053             Add helper to get the type of the varient, need for inspector code.
2054         
2055         (WebCore::Gradient::adjustParametersForTiledDrawing):
2056         (WebCore::Gradient::isZeroSize const):
2057         (WebCore::Gradient::hash const):
2058         
2059             Update to switch on the underlying variant to get data values.
2060         
2061         (WebCore::Gradient::addColorStop):
2062         
2063             Simplify by having one addColorStop call the other.
2064             
2065         (WebCore::Gradient::setSortedColorStops):
2066         
2067             Added. Replaces setStopsSorted. Used now that CSSGradientValue computes and sorts
2068             its color stops before creating the gradient.
2069
2070         * platform/graphics/Gradient.h:
2071         (WebCore::Gradient::create):
2072         
2073             Replace create functions with ones that take data structs.
2074         
2075         (WebCore::Gradient::data const):
2076
2077             Add accessor for the underlying variant.
2078
2079         (WebCore::Gradient::isRadial const): Deleted.
2080         
2081             Replaced by type accessor.
2082         
2083         (WebCore::Gradient::p0 const): Deleted.
2084         (WebCore::Gradient::p1 const): Deleted.
2085         (WebCore::Gradient::setP0): Deleted.
2086         (WebCore::Gradient::setP1): Deleted.
2087         (WebCore::Gradient::startRadius const): Deleted.
2088         (WebCore::Gradient::endRadius const): Deleted.
2089         (WebCore::Gradient::setStartRadius): Deleted.
2090         (WebCore::Gradient::setEndRadius): Deleted.
2091         
2092             Point and radii are now immutable.
2093         
2094         (WebCore::Gradient::setStopsSorted): Deleted.
2095         
2096             Replaced by setSortedColorStops function.
2097         
2098         * platform/graphics/GraphicsContext.cpp:
2099         (WebCore::GraphicsContext::fillRect):
2100         
2101             Pass the GraphicsContext by reference.
2102         
2103         * platform/graphics/cairo/GradientCairo.cpp:
2104         (WebCore::Gradient::createPlatformGradient):
2105
2106             Update to switch on the underlying variant to get data values.
2107
2108         (WebCore::Gradient::fill):
2109         
2110             Pass the GraphicsContext by reference.
2111         
2112         * platform/graphics/cg/GradientCG.cpp:
2113         (WebCore::Gradient::platformDestroy):
2114         
2115             Use nullptr.
2116         
2117         (WebCore::Gradient::fill):
2118         
2119             Pass the GraphicsContext by reference.
2120         
2121         (WebCore::Gradient::paint):
2122
2123             Update to switch on the underlying variant to get data values.
2124
2125         * platform/graphics/cg/GraphicsContextCG.cpp:
2126         (WebCore::GraphicsContext::fillPath):
2127         (WebCore::GraphicsContext::strokePath):
2128         (WebCore::GraphicsContext::fillRect):
2129         (WebCore::GraphicsContext::strokeRect):
2130         
2131             Pass the GraphicsContext by reference.
2132         
2133         * platform/graphics/win/GradientDirect2D.cpp:
2134         (WebCore::Gradient::generateGradient):
2135
2136             Update to switch on the underlying variant to get data values.
2137         
2138         (WebCore::Gradient::fill):
2139     
2140             Pass the GraphicsContext by reference.
2141         
2142         * rendering/RenderThemeIOS.mm:
2143         (WebCore::RenderThemeIOS::paintProgressBar):
2144         * rendering/svg/RenderSVGResourceLinearGradient.cpp:
2145         (WebCore::RenderSVGResourceLinearGradient::buildGradient const):
2146         * rendering/svg/RenderSVGResourceRadialGradient.cpp:
2147         (WebCore::RenderSVGResourceRadialGradient::buildGradient const):
2148         
2149             Update for new Gradient create function signature.
2150
2151 2017-11-19  Simon Fraser  <simon.fraser@apple.com>
2152
2153         Use TypedArrayView's setRange() in FETurbulence
2154         https://bugs.webkit.org/show_bug.cgi?id=179878
2155
2156         Reviewed by Sam Weinig.
2157
2158         Writing the 4 component values at once makes the function about 10% faster.
2159
2160         * platform/graphics/filters/FETurbulence.cpp:
2161         (WebCore::FETurbulence::fillRegion const):
2162
2163 2017-11-18  Chris Dumez  <cdumez@apple.com>
2164
2165         ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
2166         https://bugs.webkit.org/show_bug.cgi?id=179846
2167
2168         Reviewed by Darin Adler.
2169
2170         We have seen crashes on the bots in SWServerJobQueue because methods such as scriptContextStarted()
2171         can get called after the jobQueue has been cleared. This is because when a jobQueue is cleared,
2172         an asynchronous operation may be pending (e.g. script fetch, service worker starting, install event).
2173
2174         To address the issue, we now pass the identifier of the job that started the asynchronous operation
2175         when calling the methods on SWServerJobQueue. If the identifier does not match the identifier of
2176         the current job in the JobQueue, we ignore it.
2177
2178         This patch also starts using a strongly typed identifier (ServiceWorkerJobIdentifier) for
2179         ServiceWorkerJob, instead of a uint64_t. It also introduces a ServiceWorkerJobDataIdentifier type
2180         which contains both a SWServerConnectionIdentifier and a ServiceWorkerJobIdentifier. This is useful
2181         because ServiceWorkerJobData is passed to the StorageProcess and it needs a globally unique identifier.
2182         ServiceWorkerJobIdentifier is only guaranteed to be unique within a single WebProcess. Augmenting it
2183         with the SWServerConnectionIdentifier of the WebProcess makes it globally unique.
2184
2185         No new tests, unskipped exiting test.
2186
2187         * WebCore.xcodeproj/project.pbxproj:
2188         * workers/service/ServiceWorkerContainer.cpp:
2189         (WebCore::ServiceWorkerContainer::scheduleJob):
2190         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2191         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2192         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2193         (WebCore::ServiceWorkerContainer::jobDidFinish):
2194         * workers/service/ServiceWorkerContainer.h:
2195         * workers/service/ServiceWorkerContextData.cpp:
2196         (WebCore::ServiceWorkerContextData::isolatedCopy const):
2197         * workers/service/ServiceWorkerContextData.h:
2198         (WebCore::ServiceWorkerContextData::encode const):
2199         (WebCore::ServiceWorkerContextData::decode):
2200         * workers/service/ServiceWorkerFetchResult.h:
2201         (WebCore::ServiceWorkerFetchResult::encode const):
2202         (WebCore::ServiceWorkerFetchResult::decode):
2203         * workers/service/ServiceWorkerJob.h:
2204         (WebCore::ServiceWorkerJob::identifier const):
2205         * workers/service/ServiceWorkerJobData.cpp:
2206         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
2207         (WebCore::ServiceWorkerJobData::isolatedCopy const):
2208         * workers/service/ServiceWorkerJobData.h:
2209         (WebCore::ServiceWorkerJobData::connectionIdentifier const):
2210         (WebCore::ServiceWorkerJobData::identifier const):
2211         (WebCore::ServiceWorkerJobData::encode const):
2212         (WebCore::ServiceWorkerJobData::decode):
2213         * workers/service/ServiceWorkerJobDataIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerFetchResult.h.
2214         (WebCore::ServiceWorkerJobDataIdentifier::operator== const):
2215         (WebCore::ServiceWorkerJobDataIdentifier::loggingString const):
2216         (WebCore::ServiceWorkerJobDataIdentifier::encode const):
2217         (WebCore::ServiceWorkerJobDataIdentifier::decode):
2218         * workers/service/ServiceWorkerTypes.h:
2219         * workers/service/context/SWContextManager.cpp:
2220         (WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
2221         * workers/service/context/SWContextManager.h:
2222         * workers/service/context/ServiceWorkerThread.cpp:
2223         (WebCore::ServiceWorkerThread::fireInstallEvent):
2224         * workers/service/server/SWClientConnection.cpp:
2225         (WebCore::SWClientConnection::scheduleJob):
2226         (WebCore::SWClientConnection::finishedFetchingScript):
2227         (WebCore::SWClientConnection::failedFetchingScript):
2228         (WebCore::SWClientConnection::jobRejectedInServer):
2229         (WebCore::SWClientConnection::registrationJobResolvedInServer):
2230         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
2231         (WebCore::SWClientConnection::startScriptFetchForServer):
2232         * workers/service/server/SWClientConnection.h:
2233         * workers/service/server/SWServer.cpp:
2234         (WebCore::SWServer::Connection::scheduleJobInServer):
2235         (WebCore::SWServer::rejectJob):
2236         (WebCore::SWServer::resolveRegistrationJob):
2237         (WebCore::SWServer::startScriptFetch):
2238         (WebCore::SWServer::scriptFetchFinished):
2239         (WebCore::SWServer::scriptContextFailedToStart):
2240         (WebCore::SWServer::scriptContextStarted):
2241         (WebCore::SWServer::didFinishInstall):
2242         (WebCore::SWServer::updateWorker):
2243         * workers/service/server/SWServer.h:
2244         * workers/service/server/SWServerJobQueue.cpp:
2245         (WebCore::SWServerJobQueue::isCurrentlyProcessingJob const):
2246         (WebCore::SWServerJobQueue::scriptFetchFinished):
2247         (WebCore::SWServerJobQueue::scriptContextFailedToStart):
2248         (WebCore::SWServerJobQueue::scriptContextStarted):
2249         (WebCore::SWServerJobQueue::didFinishInstall):
2250         * workers/service/server/SWServerJobQueue.h:
2251         * workers/service/server/SWServerToContextConnection.cpp:
2252         (WebCore::SWServerToContextConnection::scriptContextFailedToStart):
2253         (WebCore::SWServerToContextConnection::scriptContextStarted):
2254         (WebCore::SWServerToContextConnection::didFinishInstall):
2255         * workers/service/server/SWServerToContextConnection.h:
2256         * workers/service/server/SWServerWorker.cpp:
2257         (WebCore::SWServerWorker::scriptContextFailedToStart):
2258         (WebCore::SWServerWorker::scriptContextStarted):
2259         (WebCore::SWServerWorker::didFinishInstall):
2260         * workers/service/server/SWServerWorker.h:
2261
2262 2017-11-18  Nan Wang  <n_wang@apple.com>
2263
2264         AX: AOM: Implement number type properties
2265         https://bugs.webkit.org/show_bug.cgi?id=179497
2266
2267         Reviewed by Chris Fleizach.
2268
2269         Accessibility Object Model
2270         Explainer: https://wicg.github.io/aom/explainer.html
2271         Spec: https://wicg.github.io/aom/spec/
2272
2273         Implemented the number type properties for Accessibility Object Modal.
2274
2275         Test: accessibility/mac/AOM-number-properties.html
2276
2277         * accessibility/AXObjectCache.cpp:
2278         (WebCore::isNodeAriaVisible):
2279         * accessibility/AccessibilityARIAGrid.cpp:
2280         (WebCore::AccessibilityARIAGrid::isMultiSelectable const):
2281         * accessibility/AccessibilityARIAGridCell.cpp:
2282         (WebCore::AccessibilityARIAGridCell::rowIndexRange const):
2283         (WebCore::AccessibilityARIAGridCell::axRowSpanWithRowIndex const):
2284         (WebCore::AccessibilityARIAGridCell::columnIndexRange const):
2285         (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex const): Deleted.
2286         * accessibility/AccessibilityARIAGridCell.h:
2287         * accessibility/AccessibilityNodeObject.cpp:
2288         (WebCore::AccessibilityNodeObject::isEnabled const):
2289         (WebCore::AccessibilityNodeObject::isMultiSelectable const):
2290         (WebCore::AccessibilityNodeObject::isRequired const):
2291         (WebCore::AccessibilityNodeObject::headingLevel const):
2292         (WebCore::AccessibilityNodeObject::valueForRange const):
2293         (WebCore::AccessibilityNodeObject::maxValueForRange const):
2294         (WebCore::AccessibilityNodeObject::minValueForRange const):
2295         (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
2296         * accessibility/AccessibilityObject.cpp:
2297         (WebCore::AccessibilityObject::intValueForProperty const):
2298         (WebCore::AccessibilityObject::unsignedValueForProperty const):
2299         (WebCore::AccessibilityObject::doubleValueForProperty const):
2300         (WebCore::AccessibilityObject::supportsSetSize const):
2301         (WebCore::AccessibilityObject::supportsPosInSet const):
2302         (WebCore::AccessibilityObject::setSize const):
2303         (WebCore::AccessibilityObject::posInSet const):
2304         (WebCore::AccessibilityObject::supportsARIASetSize const): Deleted.
2305         (WebCore::AccessibilityObject::supportsARIAPosInSet const): Deleted.
2306         (WebCore::AccessibilityObject::ariaSetSize const): Deleted.
2307         (WebCore::AccessibilityObject::ariaPosInSet const): Deleted.
2308         * accessibility/AccessibilityObject.h:
2309         * accessibility/AccessibilityRenderObject.cpp:
2310         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
2311         (WebCore::AccessibilityRenderObject::liveRegionAtomic const):
2312         * accessibility/AccessibilityTable.cpp:
2313         (WebCore::AccessibilityTable::isDataTable const):
2314         (WebCore::AccessibilityTable::axColumnCount const):
2315         (WebCore::AccessibilityTable::axRowCount const):
2316         (WebCore::AccessibilityTable::ariaColumnCount const): Deleted.
2317         (WebCore::AccessibilityTable::ariaRowCount const): Deleted.
2318         * accessibility/AccessibilityTable.h:
2319         * accessibility/AccessibilityTableCell.cpp:
2320         (WebCore::AccessibilityTableCell::AccessibilityTableCell):
2321         (WebCore::AccessibilityTableCell::rowIndexRange const):
2322         (WebCore::AccessibilityTableCell::columnIndexRange const):
2323         (WebCore::AccessibilityTableCell::axColumnIndex const):
2324         (WebCore::AccessibilityTableCell::axRowIndex const):
2325         (WebCore::AccessibilityTableCell::axColumnSpan const):
2326         (WebCore::AccessibilityTableCell::axRowSpan const):
2327         (WebCore::AccessibilityTableCell::ariaColumnIndex const): Deleted.
2328         (WebCore::AccessibilityTableCell::ariaRowIndex const): Deleted.
2329         (WebCore::AccessibilityTableCell::ariaColumnSpan const): Deleted.
2330         (WebCore::AccessibilityTableCell::ariaRowSpan const): Deleted.
2331         * accessibility/AccessibilityTableCell.h:
2332         (WebCore::AccessibilityTableCell::setAXColIndexFromRow):
2333         (WebCore::AccessibilityTableCell::setARIAColIndexFromRow): Deleted.
2334         * accessibility/AccessibilityTableRow.cpp:
2335         (WebCore::AccessibilityTableRow::addChildren):
2336         (WebCore::AccessibilityTableRow::axColumnIndex const):
2337         (WebCore::AccessibilityTableRow::axRowIndex const):
2338         (WebCore::AccessibilityTableRow::ariaColumnIndex const): Deleted.
2339         (WebCore::AccessibilityTableRow::ariaRowIndex const): Deleted.
2340         * accessibility/AccessibilityTableRow.h:
2341         * accessibility/AccessibleNode.cpp:
2342         (WebCore::ariaAttributeMap):
2343         (WebCore::isPropertyValueInt):
2344         (WebCore::isPropertyValueUnsigned):
2345         (WebCore::isPropertyValueFloat):
2346         (WebCore::AccessibleNode::setProperty):
2347         (WebCore::AccessibleNode::setOptionalProperty):
2348         (WebCore::AccessibleNode::setStringProperty):
2349         (WebCore::AccessibleNode::optionalValueForProperty):
2350         (WebCore::AccessibleNode::effectiveBoolValueForElement):
2351         (WebCore::AccessibleNode::effectiveIntValueForElement):
2352         (WebCore::AccessibleNode::effectiveUnsignedValueForElement):
2353         (WebCore::AccessibleNode::effectiveDoubleValueForElement):
2354         (WebCore::AccessibleNode::atomic const):
2355         (WebCore::AccessibleNode::setAtomic):
2356         (WebCore::AccessibleNode::setAutocomplete):
2357         (WebCore::AccessibleNode::busy const):
2358         (WebCore::AccessibleNode::setBusy):
2359         (WebCore::AccessibleNode::setChecked):
2360         (WebCore::AccessibleNode::colCount const):
2361         (WebCore::AccessibleNode::setColCount):
2362         (WebCore::AccessibleNode::colIndex const):
2363         (WebCore::AccessibleNode::setColIndex):
2364         (WebCore::AccessibleNode::colSpan const):
2365         (WebCore::AccessibleNode::setColSpan):
2366         (WebCore::AccessibleNode::setCurrent):
2367         (WebCore::AccessibleNode::disabled const):
2368         (WebCore::AccessibleNode::setDisabled):
2369         (WebCore::AccessibleNode::expanded const):
2370         (WebCore::AccessibleNode::setExpanded):
2371         (WebCore::AccessibleNode::setHasPopUp):
2372         (WebCore::AccessibleNode::hidden const):
2373         (WebCore::AccessibleNode::setHidden):
2374         (WebCore::AccessibleNode::setInvalid):
2375         (WebCore::AccessibleNode::setKeyShortcuts):
2376         (WebCore::AccessibleNode::label const):
2377         (WebCore::AccessibleNode::setLabel):
2378         (WebCore::AccessibleNode::level const):
2379         (WebCore::AccessibleNode::setLevel):
2380         (WebCore::AccessibleNode::live const):
2381         (WebCore::AccessibleNode::setLive):
2382         (WebCore::AccessibleNode::modal const):
2383         (WebCore::AccessibleNode::setModal):
2384         (WebCore::AccessibleNode::multiline const):
2385         (WebCore::AccessibleNode::setMultiline):
2386         (WebCore::AccessibleNode::multiselectable const):
2387         (WebCore::AccessibleNode::setMultiselectable):
2388         (WebCore::AccessibleNode::setOrientation):
2389         (WebCore::AccessibleNode::setPlaceholder):
2390         (WebCore::AccessibleNode::posInSet const):
2391         (WebCore::AccessibleNode::setPosInSet):
2392         (WebCore::AccessibleNode::setPressed):
2393         (WebCore::AccessibleNode::readOnly const):
2394         (WebCore::AccessibleNode::setReadOnly):
2395         (WebCore::AccessibleNode::setRelevant):
2396         (WebCore::AccessibleNode::required const):
2397         (WebCore::AccessibleNode::setRequired):
2398         (WebCore::AccessibleNode::setRole):
2399         (WebCore::AccessibleNode::setRoleDescription):
2400         (WebCore::AccessibleNode::rowCount const):
2401         (WebCore::AccessibleNode::setRowCount):
2402         (WebCore::AccessibleNode::rowIndex const):
2403         (WebCore::AccessibleNode::setRowIndex):
2404         (WebCore::AccessibleNode::rowSpan const):
2405         (WebCore::AccessibleNode::setRowSpan):
2406         (WebCore::AccessibleNode::selected const):
2407         (WebCore::AccessibleNode::setSelected):
2408         (WebCore::AccessibleNode::setSize const):
2409         (WebCore::AccessibleNode::setSetSize):
2410         (WebCore::AccessibleNode::setSort):
2411         (WebCore::AccessibleNode::valueMax const):
2412         (WebCore::AccessibleNode::setValueMax):
2413         (WebCore::AccessibleNode::valueMin const):
2414         (WebCore::AccessibleNode::setValueMin):
2415         (WebCore::AccessibleNode::valueNow const):
2416         (WebCore::AccessibleNode::setValueNow):
2417         (WebCore::AccessibleNode::setValueText):
2418         (WebCore::AccessibleNode::boolValueForProperty): Deleted.
2419         (WebCore::AccessibleNode::setBoolProperty): Deleted.
2420         * accessibility/AccessibleNode.h:
2421         * accessibility/AccessibleNode.idl:
2422         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
2423         (webkitAccessibleTableGetNColumns):
2424         (webkitAccessibleTableGetNRows):
2425         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
2426         (webkitAccessibleTableCellGetPosition):
2427         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2428         (webkitAccessibleGetAttributes):
2429         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2430         (-[WebAccessibilityObjectWrapper accessibilityARIARowCount]):
2431         (-[WebAccessibilityObjectWrapper accessibilityARIAColumnCount]):
2432         (-[WebAccessibilityObjectWrapper accessibilityARIARowIndex]):
2433         (-[WebAccessibilityObjectWrapper accessibilityARIAColumnIndex]):
2434         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2435         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
2436         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2437
2438 2017-11-18  Tim Horton  <timothy_horton@apple.com>
2439
2440         Fix typos in closing ENABLE() comments
2441         https://bugs.webkit.org/show_bug.cgi?id=179869
2442
2443         Unreviewed.
2444
2445         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
2446         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
2447
2448 2017-11-18  Maciej Stachowiak  <mjs@apple.com>
2449
2450         Remove TEC support and all TEC-only encodings except EUC-TW (which now uses ICU)
2451         https://bugs.webkit.org/show_bug.cgi?id=179582
2452
2453         Reviewed by Darin Adler.
2454
2455         Already covered by fast/encoding/legacy-tec-encodings.html
2456
2457         * platform/text/TextCodecICU.cpp: Add support for EUC-TW.
2458
2459         Remove all vestiges of TEC text codec and its related autogeneration scripts.
2460         
2461         * DerivedSources.make:
2462         * PlatformMac.cmake:
2463         * SourcesMac.txt:
2464         * WebCore.order:
2465         * WebCore.xcodeproj/project.pbxproj:
2466         * platform/ThreadGlobalData.cpp:
2467         (WebCore::ThreadGlobalData::ThreadGlobalData): No more cached TEC decoder.
2468         (WebCore::ThreadGlobalData::destroy): ditto
2469         * platform/ThreadGlobalData.h:
2470         (WebCore::ThreadGlobalData::ThreadGlobalData::cachedConverterTEC): Deleted.
2471         * platform/text/TextEncodingRegistry.cpp:
2472         (WebCore::extendTextCodecMaps): Don't add TEC decoders on MAc.
2473         * platform/text/mac/CharsetData.h: Removed.
2474         * platform/text/mac/TextCodecMac.cpp: Removed.
2475         * platform/text/mac/TextCodecMac.h: Removed.
2476         * platform/text/mac/character-sets.txt: Removed.
2477         * platform/text/mac/ios-encodings.txt: Removed.
2478         * platform/text/mac/mac-encodings.txt: Removed.
2479         * platform/text/mac/make-charset-table.pl: Removed.
2480
2481 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
2482
2483         Mechanical cleanup of FE* files
2484         https://bugs.webkit.org/show_bug.cgi?id=179868
2485
2486         Reviewed by Wenson Hsieh.
2487
2488         Remove unused dump() functions.
2489         Make overridden member functions in derived classes private.
2490         Make simple getters inline.
2491         
2492         Move common FESpecularLighting and FEDiffuseLighting functions into the 
2493         FELighting base class.
2494
2495         * platform/graphics/filters/FEBlend.cpp:
2496         (WebCore::FEBlend::blendMode const): Deleted.
2497         (WebCore::FEBlend::dump): Deleted.
2498         * platform/graphics/filters/FEBlend.h:
2499         (WebCore::FEBlend::blendMode const):
2500         * platform/graphics/filters/FEColorMatrix.cpp:
2501         (WebCore::FEColorMatrix::type const): Deleted.
2502         (WebCore::FEColorMatrix::values const): Deleted.
2503         (WebCore::FEColorMatrix::dump): Deleted.
2504         * platform/graphics/filters/FEColorMatrix.h:
2505         (WebCore::FEColorMatrix::type const):
2506         (WebCore::FEColorMatrix::values const):
2507         * platform/graphics/filters/FEComponentTransfer.cpp:
2508         (WebCore::FEComponentTransfer::redFunction const): Deleted.
2509         (WebCore::FEComponentTransfer::greenFunction const): Deleted.
2510         (WebCore::FEComponentTransfer::blueFunction const): Deleted.
2511         (WebCore::FEComponentTransfer::alphaFunction const): Deleted.
2512         (WebCore::FEComponentTransfer::dump): Deleted.
2513         * platform/graphics/filters/FEComponentTransfer.h:
2514         (WebCore::FEComponentTransfer::redFunction const):
2515         (WebCore::FEComponentTransfer::greenFunction const):
2516         (WebCore::FEComponentTransfer::blueFunction const):
2517         (WebCore::FEComponentTransfer::alphaFunction const):
2518         * platform/graphics/filters/FEComposite.cpp:
2519         (WebCore::FEComposite::operation const): Deleted.
2520         (WebCore::FEComposite::k1 const): Deleted.
2521         (WebCore::FEComposite::k2 const): Deleted.
2522         (WebCore::FEComposite::k3 const): Deleted.
2523         (WebCore::FEComposite::k4 const): Deleted.
2524         (WebCore::FEComposite::dump): Deleted.
2525         * platform/graphics/filters/FEComposite.h:
2526         (WebCore::FEComposite::operation const):
2527         (WebCore::FEComposite::k1 const):
2528         (WebCore::FEComposite::k2 const):
2529         (WebCore::FEComposite::k3 const):
2530         (WebCore::FEComposite::k4 const):
2531         * platform/graphics/filters/FEConvolveMatrix.cpp:
2532         (WebCore::FEConvolveMatrix::kernelSize const): Deleted.
2533         (WebCore::FEConvolveMatrix::kernel const): Deleted.
2534         (WebCore::FEConvolveMatrix::divisor const): Deleted.
2535         (WebCore::FEConvolveMatrix::bias const): Deleted.
2536         (WebCore::FEConvolveMatrix::targetOffset const): Deleted.
2537         (WebCore::FEConvolveMatrix::edgeMode const): Deleted.
2538         (WebCore::FEConvolveMatrix::kernelUnitLength const): Deleted.
2539         (WebCore::FEConvolveMatrix::preserveAlpha const): Deleted.
2540         (WebCore::FEConvolveMatrix::dump): Deleted.
2541         * platform/graphics/filters/FEConvolveMatrix.h:
2542         (WebCore::FEConvolveMatrix::kernelSize const):
2543         (WebCore::FEConvolveMatrix::kernel const):
2544         (WebCore::FEConvolveMatrix::divisor const):
2545         (WebCore::FEConvolveMatrix::bias const):
2546         (WebCore::FEConvolveMatrix::targetOffset const):
2547         (WebCore::FEConvolveMatrix::edgeMode const):
2548         (WebCore::FEConvolveMatrix::kernelUnitLength const):
2549         (WebCore::FEConvolveMatrix::preserveAlpha const):
2550         * platform/graphics/filters/FEDiffuseLighting.cpp:
2551         (WebCore::FEDiffuseLighting::lightingColor const): Deleted.
2552         (WebCore::FEDiffuseLighting::setLightingColor): Deleted.
2553         (WebCore::FEDiffuseLighting::surfaceScale const): Deleted.
2554         (WebCore::FEDiffuseLighting::setSurfaceScale): Deleted.
2555         (WebCore::FEDiffuseLighting::diffuseConstant const): Deleted.
2556         (WebCore::FEDiffuseLighting::kernelUnitLengthX const): Deleted.
2557         (WebCore::FEDiffuseLighting::setKernelUnitLengthX): Deleted.
2558         (WebCore::FEDiffuseLighting::kernelUnitLengthY const): Deleted.
2559         (WebCore::FEDiffuseLighting::setKernelUnitLengthY): Deleted.
2560         (WebCore::FEDiffuseLighting::lightSource const): Deleted.
2561         (WebCore::FEDiffuseLighting::dump): Deleted.
2562         * platform/graphics/filters/FEDiffuseLighting.h:
2563         (WebCore::FEDiffuseLighting::diffuseConstant const):
2564         * platform/graphics/filters/FEDisplacementMap.cpp:
2565         (WebCore::FEDisplacementMap::xChannelSelector const): Deleted.
2566         (WebCore::FEDisplacementMap::yChannelSelector const): Deleted.
2567         (WebCore::FEDisplacementMap::scale const): Deleted.
2568         (WebCore::FEDisplacementMap::dump): Deleted.
2569         * platform/graphics/filters/FEDisplacementMap.h:
2570         (WebCore::FEDisplacementMap::xChannelSelector const):
2571         (WebCore::FEDisplacementMap::yChannelSelector const):
2572         (WebCore::FEDisplacementMap::scale const):
2573         * platform/graphics/filters/FEDropShadow.cpp:
2574         (WebCore::FEDropShadow::dump): Deleted.
2575         * platform/graphics/filters/FEDropShadow.h:
2576         * platform/graphics/filters/FEFlood.cpp:
2577         (WebCore::FEFlood::floodColor const): Deleted.
2578         (WebCore::FEFlood::floodOpacity const): Deleted.
2579         (WebCore::FEFlood::dump): Deleted.
2580         * platform/graphics/filters/FEFlood.h:
2581         (WebCore::FEFlood::floodColor const):
2582         (WebCore::FEFlood::floodOpacity const):
2583         * platform/graphics/filters/FEGaussianBlur.cpp:
2584         (WebCore::FEGaussianBlur::stdDeviationX const): Deleted.
2585         (WebCore::FEGaussianBlur::stdDeviationY const): Deleted.
2586         (WebCore::FEGaussianBlur::edgeMode const): Deleted.
2587         (WebCore::FEGaussianBlur::dump): Deleted.
2588         * platform/graphics/filters/FEGaussianBlur.h:
2589         (WebCore::FEGaussianBlur::stdDeviationX const):
2590         (WebCore::FEGaussianBlur::stdDeviationY const):
2591         (WebCore::FEGaussianBlur::edgeMode const):
2592         * platform/graphics/filters/FELighting.cpp:
2593         (WebCore::FELighting::setSurfaceScale):
2594         (WebCore::FELighting::setLightingColor):
2595         (WebCore::FELighting::setKernelUnitLengthX):
2596         (WebCore::FELighting::setKernelUnitLengthY):
2597         * platform/graphics/filters/FELighting.h:
2598         (WebCore::FELighting::surfaceScale const):
2599         (WebCore::FELighting::lightingColor const):
2600         (WebCore::FELighting::kernelUnitLengthX const):
2601         (WebCore::FELighting::kernelUnitLengthY const):
2602         (WebCore::FELighting::lightSource const):
2603         * platform/graphics/filters/FEMerge.cpp:
2604         (WebCore::FEMerge::dump): Deleted.
2605         * platform/graphics/filters/FEMerge.h:
2606         * platform/graphics/filters/FEMorphology.cpp:
2607         (WebCore::FEMorphology::dump): Deleted.
2608         * platform/graphics/filters/FEMorphology.h:
2609         * platform/graphics/filters/FEOffset.cpp:
2610         (WebCore::FEOffset::dx const): Deleted.
2611         (WebCore::FEOffset::dy const): Deleted.
2612         (WebCore::FEOffset::dump): Deleted.
2613         * platform/graphics/filters/FEOffset.h:
2614         (WebCore::FEOffset::dx const):
2615         (WebCore::FEOffset::dy const):
2616         * platform/graphics/filters/FESpecularLighting.cpp:
2617         (WebCore::FESpecularLighting::lightingColor const): Deleted.
2618         (WebCore::FESpecularLighting::setLightingColor): Deleted.
2619         (WebCore::FESpecularLighting::surfaceScale const): Deleted.
2620         (WebCore::FESpecularLighting::setSurfaceScale): Deleted.
2621         (WebCore::FESpecularLighting::specularConstant const): Deleted.
2622         (WebCore::FESpecularLighting::specularExponent const): Deleted.
2623         (WebCore::FESpecularLighting::kernelUnitLengthX const): Deleted.
2624         (WebCore::FESpecularLighting::setKernelUnitLengthX): Deleted.
2625         (WebCore::FESpecularLighting::kernelUnitLengthY const): Deleted.
2626         (WebCore::FESpecularLighting::setKernelUnitLengthY): Deleted.
2627         (WebCore::FESpecularLighting::lightSource const): Deleted.
2628         (WebCore::FESpecularLighting::dump): Deleted.
2629         * platform/graphics/filters/FESpecularLighting.h:
2630         (WebCore::FESpecularLighting::specularConstant const):
2631         (WebCore::FESpecularLighting::specularExponent const):
2632         * platform/graphics/filters/FETile.cpp:
2633         (WebCore::FETile::dump): Deleted.
2634         * platform/graphics/filters/FETile.h:
2635         * platform/graphics/filters/FETurbulence.cpp:
2636         (WebCore::FETurbulence::dump): Deleted.
2637         * platform/graphics/filters/FETurbulence.h:
2638         * platform/graphics/filters/FilterEffect.h:
2639         * platform/graphics/filters/SourceAlpha.cpp:
2640         (WebCore::SourceAlpha::dump): Deleted.
2641         * platform/graphics/filters/SourceAlpha.h:
2642         * platform/graphics/filters/SourceGraphic.cpp:
2643         (WebCore::SourceGraphic::dump): Deleted.
2644         * platform/graphics/filters/SourceGraphic.h:
2645         * svg/graphics/filters/SVGFEImage.cpp:
2646         (WebCore::FEImage::dump): Deleted.
2647         * svg/graphics/filters/SVGFEImage.h:
2648
2649 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
2650
2651         Attempt to fix Windows build failures seen in EWS.
2652         
2653         Remove default constructor for ColorComponents, which was ambiguous with the
2654         one that takes 4 values.
2655
2656         * platform/graphics/ColorUtilities.h:
2657
2658 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
2659
2660         Line of garbage pixels at the bottom of an feTurbulence sometimes
2661         https://bugs.webkit.org/show_bug.cgi?id=179866
2662
2663         Reviewed by Wenson Hsieh.
2664         
2665         The ParallelJobs logic was broken in that the sum of the computed job
2666         heights was one too short sometimes. Fix and clean up the logic.
2667
2668         Test: svg/filters/feTurbulence-parallel-jobs.html
2669
2670         * platform/graphics/filters/FETurbulence.cpp:
2671         (WebCore::FETurbulence::platformApplySoftware):
2672
2673 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
2674
2675         Use #pragma once in FE* files.
2676         
2677         Rubber-stamped by Dan Bates.
2678
2679         * platform/graphics/filters/FEBlend.h:
2680         * platform/graphics/filters/FEColorMatrix.h:
2681         * platform/graphics/filters/FEComponentTransfer.h:
2682         * platform/graphics/filters/FEComposite.h:
2683         * platform/graphics/filters/FEConvolveMatrix.h:
2684         * platform/graphics/filters/FEDiffuseLighting.h:
2685         * platform/graphics/filters/FEDisplacementMap.h:
2686         * platform/graphics/filters/FEDropShadow.h:
2687         * platform/graphics/filters/FEFlood.h:
2688         * platform/graphics/filters/FEGaussianBlur.h:
2689         * platform/graphics/filters/FELighting.h:
2690         * platform/graphics/filters/FEMerge.h:
2691         * platform/graphics/filters/FEOffset.h:
2692         * platform/graphics/filters/FESpecularLighting.h:
2693         * platform/graphics/filters/FETile.h:
2694
2695 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
2696
2697         Remove a TimingScope that I left in by mistake.
2698
2699         * platform/graphics/filters/FETurbulence.cpp:
2700         (WebCore::FETurbulence::platformApplySoftware):
2701
2702 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
2703
2704         FETurbulence: round the result according to the spec
2705         https://bugs.webkit.org/show_bug.cgi?id=179865
2706
2707         Reviewed by Zalan Bujtas.
2708
2709         The spec explicitly says that the floating point results are multiplied by 255 then
2710         clamped between 0 and 255, so do this instead of using lroundf().
2711         
2712         This is also faster (about 10%).
2713
2714         * platform/graphics/ColorUtilities.h:
2715         (WebCore::ColorComponents::ColorComponents):
2716         * platform/graphics/filters/FETurbulence.cpp:
2717         (WebCore::toColorComponents):
2718         (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):
2719
2720 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
2721
2722         More FETurbulence cleanup
2723         https://bugs.webkit.org/show_bug.cgi?id=179863
2724
2725         Reviewed by Zalan Bujtas.
2726         
2727         Hoist computation of initial StitchData up to be done once per filter,
2728         not once per pixel. Passing initial StitchData by value to calculateTurbulenceValueForPoint()
2729         ensures that each pixel gets the initial state.
2730         
2731         Also, adjusted baseFrequencyX and baseFrequencyY can be computed just once at the start,
2732         and passed through via PaintingData.
2733         
2734         Change enum TurbulenceType to be an enum class (requiring casts in a couple of places)
2735         and undo the capitalization of the values.
2736
2737         Fix spelling of TURBULANCE -> TURBULENCE in test output.
2738
2739         * platform/graphics/filters/FETurbulence.cpp:
2740         (WebCore::FETurbulence::computeStitching const):
2741         (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):
2742         (WebCore::FETurbulence::fillRegion const):
2743         (WebCore::FETurbulence::fillRegionWorker):
2744         (WebCore::FETurbulence::platformApplySoftware):
2745         (WebCore::operator<<):
2746         * platform/graphics/filters/FETurbulence.h:
2747         (WebCore::FETurbulence::PaintingData::PaintingData):
2748         (WebCore::FETurbulence::StitchData::StitchData): Deleted.
2749         * svg/SVGAnimatedEnumeration.cpp:
2750         (WebCore::enumerationValueForTargetAttribute):
2751         * svg/SVGFETurbulenceElement.cpp:
2752         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
2753         (WebCore::SVGFETurbulenceElement::parseAttribute):
2754         * svg/SVGFETurbulenceElement.h:
2755         (WebCore::SVGPropertyTraits<TurbulenceType>::highestEnumValue):
2756         (WebCore::SVGPropertyTraits<TurbulenceType>::toString):
2757         (WebCore::SVGPropertyTraits<TurbulenceType>::fromString):
2758
2759 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
2760
2761         feTurbulence with stitchTiles is broken
2762         https://bugs.webkit.org/show_bug.cgi?id=179862
2763
2764         Reviewed by Zalan Bujtas.
2765         
2766         The "stitchTiles" logic was broken, and not equivalent to the spec sample code,
2767         because it didn't compute and wrap the bx1 and by1 equivalents separately from
2768         bx0 and by0.
2769         
2770         Annotated the code with the equivalent sample code from the spec for ease of
2771         comparison.
2772         
2773         Also make some functions const.
2774
2775         Test: svg/filters/feTurbulence-stitchTiles.html
2776
2777         * platform/graphics/filters/FETurbulence.cpp:
2778         (WebCore::FETurbulence::noise2D const):
2779         (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):
2780         (WebCore::FETurbulence::fillRegion const):
2781         (WebCore::checkNoise): Deleted.
2782         (WebCore::FETurbulence::noise2D): Deleted.
2783         (WebCore::FETurbulence::calculateTurbulenceValueForPoint): Deleted.
2784         (WebCore::FETurbulence::fillRegion): Deleted.
2785         * platform/graphics/filters/FETurbulence.h:
2786         * platform/graphics/filters/FilterEffect.h:
2787         (WebCore::FilterEffect::filter const):
2788
2789 2017-11-18  Antti Koivisto  <antti@apple.com>
2790
2791         REGRESSION (r220646): REGRESSION (r220646): RenderTreePosition::computeNextSibling hits assertion with certain first-letter mutations
2792         https://bugs.webkit.org/show_bug.cgi?id=179855
2793         <rdar://problem/35464071>
2794
2795         Reviewed by Zalan Bujtas.
2796
2797         Test: fast/css-generated-content/first-letter-update-crash.html
2798
2799         * style/RenderTreeUpdaterFirstLetter.cpp:
2800         (WebCore::styleForFirstLetter):
2801         (WebCore::updateFirstLetterStyle):
2802         (WebCore::createFirstLetterRenderer):
2803
2804             Tighten these to take RenderBlock.
2805
2806         (WebCore::supportsFirstLetter):
2807
2808             Test exact conditions where first letter renderer is allowed for fast rejection.
2809
2810         (WebCore::RenderTreeUpdater::FirstLetter::update):
2811
2812             If update was called on a block that doesn't support first letter, getFirstLetter could in
2813             some cases return an ancestor of the block and we would end up mutating a first letter renderer
2814             that wasn't current block's descendant. This violates assumptions of the RenderTreeUpdater
2815             and could cause cached render tree position to become invalid.
2816
2817             Fix by ensuring we are always updating first letter for the current block only.
2818
2819 2017-11-17  Chris Dumez  <cdumez@apple.com>
2820
2821         [Service Workers] Implement "Notify Controller Change" algorithm
2822         https://bugs.webkit.org/show_bug.cgi?id=179822
2823
2824         Reviewed by Youenn Fablet.
2825
2826         Implement "Notify Controller Change" algorithm:
2827         - https://w3c.github.io/ServiceWorker/#notify-controller-change
2828
2829         Use it to support step 7 of "Activate" algorithm:
2830         - https://w3c.github.io/ServiceWorker/#activate
2831
2832         Test: http/tests/workers/service/controller-change.html
2833
2834         * workers/service/ServiceWorkerContainer.cpp:
2835         (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
2836         * workers/service/ServiceWorkerContainer.h:
2837         * workers/service/server/SWClientConnection.cpp:
2838         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
2839         * workers/service/server/SWClientConnection.h:
2840         * workers/service/server/SWServer.h:
2841         * workers/service/server/SWServerJobQueue.cpp:
2842         (WebCore::SWServerJobQueue::activate):
2843         * workers/service/server/SWServerRegistration.cpp:
2844         (WebCore::SWServerRegistration::notifyClientsOfControllerChange):
2845         * workers/service/server/SWServerRegistration.h:
2846
2847 2017-11-17  Chris Dumez  <cdumez@apple.com>
2848
2849         Unreviewed attempt to fix build after r225006.
2850
2851         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2852         (WebCore::NetworkStorageSession::setStorageAccessGranted):
2853
2854 2017-11-17  Simon Fraser  <simon.fraser@apple.com>
2855
2856         FETurbulence: compute all 4 channels at once
2857         https://bugs.webkit.org/show_bug.cgi?id=179833
2858
2859         Reviewed by Sam Weinig.
2860
2861         Introduce some new helper classes for storing float color components, and use
2862         them in calculateTurbulenceValueForPoint() and noise2D() for all the channels in one
2863         pass. This makes FETurbulence about twice as fast.
2864
2865         * Sources.txt:
2866         * WebCore.xcodeproj/project.pbxproj:
2867         * platform/graphics/ColorUtilities.cpp: Added.
2868         (WebCore::ColorComponents::ColorComponents):
2869         * platform/graphics/ColorUtilities.h: Added.
2870         (WebCore::FloatComponents::FloatComponents):
2871         (WebCore::FloatComponents::operator +=):
2872         (WebCore::FloatComponents::operator + const):
2873         (WebCore::FloatComponents::operator / const):
2874         (WebCore::FloatComponents::operator * const):
2875         (WebCore::FloatComponents::abs const):
2876         (WebCore::clampedColorComponent):
2877         * platform/graphics/filters/FETurbulence.cpp:
2878         (WebCore::FETurbulence::noise2D):
2879         (WebCore::FETurbulence::calculateTurbulenceValueForPoint):
2880         (WebCore::FETurbulence::fillRegion):
2881         (WebCore::FETurbulence::platformApplySoftware):
2882         * platform/graphics/filters/FETurbulence.h:
2883
2884 2017-11-17  Chris Dumez  <cdumez@apple.com>
2885
2886         Use a strongly typed identifier for SWServer::Connection
2887         https://bugs.webkit.org/show_bug.cgi?id=179848
2888
2889         Reviewed by Brady Eidson.
2890
2891         Use a strongly typed identifier for SWServer::Connection, for clarity.
2892
2893         * workers/service/ServiceWorker.cpp:
2894         (WebCore::ServiceWorker::postMessage):
2895         * workers/service/ServiceWorkerClient.cpp:
2896         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
2897         (WebCore::ServiceWorkerClient::id const):
2898         (WebCore::ServiceWorkerClient::postMessage):
2899         * workers/service/ServiceWorkerClient.h:
2900         (WebCore::ServiceWorkerClient::create):
2901         (WebCore::ServiceWorkerClient::identifier const):
2902         * workers/service/ServiceWorkerClientData.cpp:
2903         (WebCore::ServiceWorkerClientData::isolatedCopy const):
2904         (WebCore::ServiceWorkerClientData::from):
2905         * workers/service/ServiceWorkerClientData.h:
2906         (WebCore::ServiceWorkerClientData::encode const):
2907         (WebCore::ServiceWorkerClientData::decode):
2908         * workers/service/ServiceWorkerClientIdentifier.h:
2909         (WebCore::ServiceWorkerClientIdentifier::toString const):
2910         (WebCore::ServiceWorkerClientIdentifier::decode):
2911         * workers/service/ServiceWorkerContainer.cpp:
2912         (WebCore::ServiceWorkerContainer::addRegistration):
2913         (WebCore::ServiceWorkerContainer::removeRegistration):
2914         (WebCore::ServiceWorkerContainer::updateRegistration):
2915         (WebCore::ServiceWorkerContainer::connectionIdentifier):
2916         * workers/service/ServiceWorkerContainer.h:
2917         * workers/service/ServiceWorkerFetchResult.h:
2918         (WebCore::ServiceWorkerFetchResult::decode):
2919         * workers/service/ServiceWorkerJobClient.h:
2920         * workers/service/ServiceWorkerJobData.cpp:
2921         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
2922         * workers/service/ServiceWorkerJobData.h:
2923         (WebCore::ServiceWorkerJobData::connectionIdentifier const):
2924         (WebCore::ServiceWorkerJobData::decode):
2925         * workers/service/ServiceWorkerTypes.h:
2926         * workers/service/ServiceWorkerWindowClient.cpp:
2927         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
2928         * workers/service/ServiceWorkerWindowClient.h:
2929         * workers/service/context/SWContextManager.cpp:
2930         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
2931         * workers/service/context/SWContextManager.h:
2932         * workers/service/context/ServiceWorkerThread.cpp:
2933         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
2934         * workers/service/context/ServiceWorkerThread.h:
2935         * workers/service/server/SWClientConnection.h:
2936         * workers/service/server/SWServer.cpp:
2937         (WebCore::SWServer::Connection::Connection):
2938         (WebCore::SWServer::Connection::scheduleJobInServer):
2939         (WebCore::SWServer::rejectJob):
2940         (WebCore::SWServer::resolveRegistrationJob):
2941         (WebCore::SWServer::startScriptFetch):
2942         (WebCore::SWServer::scriptFetchFinished):
2943         * workers/service/server/SWServer.h:
2944         (WebCore::SWServer::Connection::identifier const):
2945         (WebCore::SWServer::getConnection):
2946         * workers/service/server/SWServerRegistration.cpp:
2947         (WebCore::SWServerRegistration::forEachConnection):
2948         (WebCore::SWServerRegistration::addClientServiceWorkerRegistration):
2949         (WebCore::SWServerRegistration::removeClientServiceWorkerRegistration):
2950         (WebCore::SWServerRegistration::unregisterServerConnection):
2951         * workers/service/server/SWServerRegistration.h:
2952
2953 2017-11-17  John Wilander  <wilander@apple.com>
2954
2955         Storage Access API: UI process should update network process about granted access
2956         https://bugs.webkit.org/show_bug.cgi?id=176943
2957         <rdar://problem/34440612>
2958
2959         Reviewed by Alex Christensen.
2960
2961         Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction.html
2962                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-recent-user-interaction.html
2963
2964         * platform/network/NetworkStorageSession.h:
2965         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2966         (WebCore::NetworkStorageSession::setStorageAccessAPIEnabled):
2967         (WebCore::NetworkStorageSession::cookieStoragePartition const):
2968             Now also checks if the resource has been granted storage access
2969             under this partition and if so, does not return a partition.
2970         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
2971             Now clears storage access when it is told to clear first.
2972         (WebCore::NetworkStorageSession::isStorageAccessGranted const):
2973         (WebCore::NetworkStorageSession::setStorageAccessGranted):
2974
2975 2017-11-17  Simon Fraser  <simon.fraser@apple.com>
2976
2977         Inadvertently swapped m_baseFrequencyX and m_baseFrequencyY in the previous commit.
2978
2979         * platform/graphics/filters/FETurbulence.h:
2980         (WebCore::FETurbulence::baseFrequencyY const):
2981         (WebCore::FETurbulence::baseFrequencyX const):
2982
2983 2017-11-17  Alex Christensen  <achristensen@webkit.org>
2984
2985         REGRESSION(224348): [mac-wk1] LayoutTest media/video-src-remove.html is a flaky timeout
2986         https://bugs.webkit.org/show_bug.cgi?id=179806
2987
2988         Reviewed by Jer Noble.
2989
2990         In r224348 I used callOnMainThread to fix UIWebView which uses the web thread, but Mac doesn't
2991         use the web thread. Something about the timing of operations in the media stack requires that
2992         dispatch_async be used instead of performSelectorOnMainThread.
2993         
2994         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2995         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
2996         Use callOnMainThread on iOS, dispatch_async on Mac.
2997
2998 2017-11-17  Per Arne Vollan  <pvollan@apple.com>
2999
3000         [Win] Compile error in InbandTextTrackPrivateAVCF::readNativeSampleBuffer.
3001         https://bugs.webkit.org/show_bug.cgi?id=179845
3002
3003         Reviewed by Jer Noble.
3004
3005         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
3006         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer):
3007
3008 2017-11-17  Chris Fleizach  <cfleizach@apple.com>
3009
3010         AX: VoiceOver in Safari does not read table header for first cell in first body row
3011         https://bugs.webkit.org/show_bug.cgi?id=179780
3012         <rdar://problem/35590551>
3013
3014         Reviewed by Joanmarie Diggs.
3015
3016         A table cell shouldn't be considered a row header if it's in a row of other headers.
3017
3018         Test: accessibility/table-header-calculation-for-header-rows.html
3019
3020         * accessibility/AccessibilityTableRow.cpp:
3021         (WebCore::AccessibilityTableRow::headerObject):
3022
3023 2017-11-17  Simon Fraser  <simon.fraser@apple.com>
3024
3025         Don't invert a matrix for every channel of every pixel of an FETurbulence filter
3026         https://bugs.webkit.org/show_bug.cgi?id=179829
3027
3028         Reviewed by Dean Jackson.
3029         
3030         FETurbulence::fillRegion() called filter().mapAbsolutePointToLocalPoint(point) for each
3031         of the 4 channels on a point, which is stupid.
3032         
3033         Fix to invert the matrix once, and then map the point once for each pixel. This reduces
3034         the time in fillRegion() function by about 30%.
3035
3036         * platform/graphics/filters/FETurbulence.cpp:
3037         (WebCore::FETurbulence::fillRegion):
3038         * platform/graphics/filters/Filter.h:
3039         (WebCore::Filter::absoluteTransform const):
3040         (WebCore::Filter::mapAbsolutePointToLocalPoint const): Deleted.
3041
3042 2017-11-17  Brent Fulgham  <bfulgham@apple.com>
3043
3044         REGRESSION(r224390): Revert unneeded Ref use.
3045         https://bugs.webkit.org/show_bug.cgi?id=179844
3046         <rdar://problem/35624718>
3047
3048         Reviewed by Chris Dumez.
3049
3050         A Ref was added to a simple code path used for type checking, which introduced a nullptr
3051         deref. The original change was not needed, so let's revert it.
3052
3053         * html/HTMLFrameOwnerElement.cpp:
3054         (WebCore::HTMLFrameOwnerElement::contentDocument const): Use 'nullptr' instead of 0.
3055         (WebCore::HTMLFrameOwnerElement::contentWindow const): Ditto.
3056         (WebCore::HTMLFrameOwnerElement::getSVGDocument const): Revert to original code here.
3057
3058 2017-11-17  Nan Wang  <n_wang@apple.com>
3059
3060         AX: AOM: Implement boolean type properties
3061         https://bugs.webkit.org/show_bug.cgi?id=179496
3062
3063         Reviewed by Chris Fleizach.
3064
3065         Accessibility Object Model
3066         Explainer: https://wicg.github.io/aom/explainer.html
3067         Spec: https://wicg.github.io/aom/spec/
3068
3069         Implemented the boolean type properties for Accessibility Object Modal.
3070
3071         Test: accessibility/mac/AOM-bool-properties.html
3072
3073         * accessibility/AXObjectCache.cpp:
3074         (WebCore::AXObjectCache::AXObjectCache):
3075         (WebCore::AXObjectCache::~AXObjectCache):
3076         (WebCore::AXObjectCache::findModalNodes):
3077         (WebCore::AXObjectCache::updateCurrentModalNode):
3078         (WebCore::AXObjectCache::modalNode):
3079         (WebCore::AXObjectCache::remove):
3080         (WebCore::AXObjectCache::handleMenuItemSelected):
3081         (WebCore::AXObjectCache::focusModalNode):
3082         (WebCore::AXObjectCache::focusModalNodeTimerFired):
3083         (WebCore::AXObjectCache::handleAttributeChanged):
3084         (WebCore::AXObjectCache::handleModalChange):
3085         (WebCore::isNodeAriaVisible):
3086         (WebCore::AXObjectCache::findAriaModalNodes): Deleted.
3087         (WebCore::AXObjectCache::updateCurrentAriaModalNode): Deleted.
3088         (WebCore::AXObjectCache::ariaModalNode): Deleted.
3089         (WebCore::AXObjectCache::focusAriaModalNode): Deleted.
3090         (WebCore::AXObjectCache::focusAriaModalNodeTimerFired): Deleted.
3091         (WebCore::AXObjectCache::handleAriaModalChange): Deleted.
3092         * accessibility/AXObjectCache.h:
3093         (WebCore::AXObjectCache::AXObjectCache):
3094         (WebCore::AXObjectCache::modalNode):
3095         (WebCore::AXObjectCache::focusModalNodeTimerFired):
3096         (WebCore::AXObjectCache::handleModalChange):
3097         (WebCore::AXObjectCache::ariaModalNode): Deleted.
3098         (WebCore::AXObjectCache::focusAriaModalNodeTimerFired): Deleted.
3099         (WebCore::AXObjectCache::handleAriaModalChange): Deleted.
3100         * accessibility/AccessibilityARIAGrid.cpp:
3101         (WebCore::AccessibilityARIAGrid::isMultiSelectable const):
3102         * accessibility/AccessibilityARIAGridCell.cpp:
3103         (WebCore::AccessibilityARIAGridCell::readOnlyValue const):
3104         (WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue const): Deleted.
3105         * accessibility/AccessibilityARIAGridCell.h:
3106         * accessibility/AccessibilityListBoxOption.cpp:
3107         (WebCore::AccessibilityListBoxOption::isEnabled const):
3108         * accessibility/AccessibilityNodeObject.cpp:
3109         (WebCore::AccessibilityNodeObject::isEnabled const):
3110         (WebCore::AccessibilityNodeObject::isMultiSelectable const):
3111         (WebCore::AccessibilityNodeObject::isRequired const):
3112         (WebCore::shouldUseAccessibilityObjectInnerText):
3113         (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
3114         * accessibility/AccessibilityObject.cpp:
3115         (WebCore::AccessibilityObject::supportsReadOnly const):
3116         (WebCore::AccessibilityObject::readOnlyValue const):
3117         (WebCore::AccessibilityObject::ariaIsMultiline const):
3118         (WebCore::AccessibilityObject::isModalDescendant const):
3119         (WebCore::AccessibilityObject::isModalNode const):
3120         (WebCore::AccessibilityObject::ignoredFromModalPresence const):
3121         (WebCore::AccessibilityObject::boolValueForProperty const):
3122         (WebCore::AccessibilityObject::supportsARIAAttributes const):
3123         (WebCore::AccessibilityObject::supportsExpanded const):
3124         (WebCore::AccessibilityObject::isExpanded const):
3125         (WebCore::AccessibilityObject::isAXHidden const):
3126         (WebCore::AccessibilityObject::defaultObjectInclusion const):
3127         (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
3128         (WebCore::AccessibilityObject::supportsARIAReadOnly const): Deleted.
3129         (WebCore::AccessibilityObject::ariaReadOnlyValue const): Deleted.
3130         (WebCore::AccessibilityObject::isAriaModalDescendant const): Deleted.
3131         (WebCore::AccessibilityObject::isAriaModalNode const): Deleted.
3132         (WebCore::AccessibilityObject::ignoredFromARIAModalPresence const): Deleted.
3133         (WebCore::AccessibilityObject::isARIAHidden const): Deleted.
3134         * accessibility/AccessibilityObject.h:
3135         (WebCore::AccessibilityObject::isHidden const):
3136         * accessibility/AccessibilityRenderObject.cpp:
3137         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
3138         (WebCore::AccessibilityRenderObject::isSelected const):
3139         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
3140         (WebCore::AccessibilityRenderObject::liveRegionAtomic const):
3141         (WebCore::AccessibilityRenderObject::isBusy const):
3142         * accessibility/AccessibleNode.cpp:
3143         (WebCore::ariaAttributeMap):
3144         (WebCore::isPropertyValueBoolean):
3145         (WebCore::AccessibleNode::effectiveBoolValueForElement):
3146         (WebCore::AccessibleNode::boolValueForProperty):
3147         (WebCore::AccessibleNode::setBoolProperty):
3148         (WebCore::AccessibleNode::atomic const):
3149         (WebCore::AccessibleNode::setAtomic):
3150         (WebCore::AccessibleNode::busy const):
3151         (WebCore::AccessibleNode::setBusy):
3152         (WebCore::AccessibleNode::disabled const):
3153         (WebCore::AccessibleNode::setDisabled):
3154         (WebCore::AccessibleNode::expanded const):
3155         (WebCore::AccessibleNode::setExpanded):
3156         (WebCore::AccessibleNode::hidden const):
3157         (WebCore::AccessibleNode::setHidden):
3158         (WebCore::AccessibleNode::modal const):
3159         (WebCore::AccessibleNode::setModal):
3160         (WebCore::AccessibleNode::multiline const):
3161         (WebCore::AccessibleNode::setMultiline):
3162         (WebCore::AccessibleNode::multiselectable const):
3163         (WebCore::AccessibleNode::setMultiselectable):
3164         (WebCore::AccessibleNode::readOnly const):
3165         (WebCore::AccessibleNode::setReadOnly):
3166         (WebCore::AccessibleNode::required const):
3167         (WebCore::AccessibleNode::setRequired):
3168         (WebCore::AccessibleNode::selected const):
3169         (WebCore::AccessibleNode::setSelected):
3170         * accessibility/AccessibleNode.h:
3171         * accessibility/AccessibleNode.idl:
3172         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3173         (webkitAccessibleGetAttributes):
3174         (setAtkStateSetFromCoreObject):
3175         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3176         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3177         * inspector/agents/InspectorDOMAgent.cpp:
3178         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3179
3180 2017-11-17  Alex Christensen  <achristensen@webkit.org>
3181
3182         Clean up URL.h
3183         https://bugs.webkit.org/show_bug.cgi?id=179710
3184
3185         Reviewed by Brady Eidson.
3186
3187         No change in behavior.
3188
3189         * Modules/fetch/FetchRequest.cpp:
3190         (WebCore::FetchRequest::urlString const):
3191         * Modules/fetch/FetchResponse.cpp:
3192         (WebCore::FetchResponse::url const):
3193         * platform/URL.cpp:
3194         (WebCore::URL::serialize const): Deleted.
3195         * platform/URL.h:
3196         * platform/mac/URLMac.mm:
3197         (WebCore::URL::createCFURL const):
3198
3199 2017-11-17  Alex Christensen  <achristensen@webkit.org>
3200
3201         Use RunLoop and Mode from NetworkingContext if they are given
3202         https://bugs.webkit.org/show_bug.cgi?id=179800
3203         <rdar://problem/35519421>
3204
3205         Reviewed by Brady Eidson.
3206
3207         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3208         (callOnMainThreadOrSchedule):
3209         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
3210         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
3211         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
3212         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3213         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
3214         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
3215         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
3216         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
3217         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
3218
3219 2017-11-17  Simon Fraser  <simon.fraser@apple.com>
3220
3221         FETurbulence const and inline cleanup
3222         https://bugs.webkit.org/show_bug.cgi?id=179832
3223
3224         Reviewed by Dean Jackson.
3225
3226         Pass the PaintingData& around as const, and remove some 'inline', letting the compiler
3227         decide. Also declare a few variables closer to first use.
3228         
3229         Speeds up FETurbulence by about 1%.
3230
3231         * platform/graphics/filters/FETurbulence.cpp:
3232         (WebCore::FETurbulence::initPaint):
3233         (WebCore::FETurbulence::noise2D):
3234         (WebCore::FETurbulence::calculateTurbulenceValueForPoint):
3235         (WebCore::FETurbulence::fillRegion):
3236         * platform/graphics/filters/FETurbulence.h:
3237
3238 2017-11-17  Antti Koivisto  <antti@apple.com>
3239
3240         Move destroyLeftoverChildren call to RenderObject::destroy
3241         https://bugs.webkit.org/show_bug.cgi?id=179819
3242
3243         Reviewed by Zalan Bujtas.
3244
3245         This is currently called inconsistenly from various willBeDestroyed implementations.
3246         We should always call it before invoking willBeDestroyed.
3247
3248         * rendering/RenderBlockFlow.cpp:
3249         (WebCore::RenderBlockFlow::willBeDestroyed):
3250         * rendering/RenderElement.cpp:
3251         (WebCore::RenderElement::willBeDestroyed):
3252         * rendering/RenderElement.h:
3253         (WebCore::RenderElement::setLastChild):
3254         * rendering/RenderInline.cpp:
3255         (WebCore::RenderInline::willBeDestroyed):
3256         * rendering/RenderLayer.cpp:
3257         (WebCore::RenderLayer::~RenderLayer):
3258
3259             Add some release asserts verifying layer has been detached before destruction.
3260             This would reveal cases where destroyLeftoverChildren was called too late.
3261
3262         * rendering/RenderObject.cpp:
3263         (WebCore::RenderObject::destroy):
3264
3265             Call destroyLeftoverChildren.
3266
3267 2017-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
3268
3269         SVG scrolling anchor should be reset if the fragmentIdentifier does not exist or is not provided
3270         https://bugs.webkit.org/show_bug.cgi?id=176577
3271
3272         Reviewed by Simon Fraser.
3273
3274         Because the SVGImage can be cached only once but used multiple times with
3275         different fragmentIdentifiers, SVGImage has to call FrameView::scrollToFragment()
3276         before the image is displayed. If the fragmentIdentifier is not provided
3277         in the URL or it does not exist in the SVGImage, FrameView::scrollToFragment()
3278         has to reset the scrolling anchor of the SVG as if it was not displayed before.
3279         We do not want the previous scrolling anchor to be used when the FrameView
3280         of SVGImage can't scroll to the current fragmentIdentifier for any reason.
3281
3282         Test: http/tests/svg/svg-fragment-url-special-cases.html
3283
3284         * page/FrameView.cpp:
3285         (WebCore::FrameView::scrollToFragment):
3286         (WebCore::FrameView::scrollToAnchor):
3287         (WebCore::FrameView::resetScrollAnchor):
3288         * page/FrameView.h:
3289         * platform/URL.cpp:
3290         (WebCore::URL::fragmentIdentifier const): Call hasFragmentIdentifier() 
3291         instead of repeating the same condition.
3292         (WebCore::decodeURLEscapeSequences):
3293         * svg/SVGSVGElement.cpp:
3294         (WebCore::SVGSVGElement::findViewAnchor const):
3295         (WebCore::SVGSVGElement::findRootAnchor const):
3296         (WebCore::SVGSVGElement::scrollToAnchor): We want to know whether the SVG 
3297         root element could scroll to the fragmentIdentifier or not. If it could not,
3298         FrameView::scrollToAnchor() can still try one last time to do the scrolling
3299         only if anchorElement is not nullptr.
3300         (WebCore::SVGSVGElement::resetScrollAnchor): Reset the FrameView scrolling
3301         state to its initial value.
3302         * svg/SVGSVGElement.h:
3303
3304 2017-11-17  Youenn Fablet  <youenn@apple.com>
3305
3306         ServiceWorker intercepted FetchRequest should have their referrer set appropriately.
3307         https://bugs.webkit.org/show_bug.cgi?id=179803
3308
3309         Reviewed by Chris Dumez.
3310
3311         Covered by updated tests.
3312
3313         * workers/service/context/ServiceWorkerFetch.cpp:
3314         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
3315
3316 2017-11-17  Joanmarie Diggs  <jdiggs@igalia.com>
3317
3318         AX: [GTK] Regression: accessibility/gtk/aria-keyshortcuts.html fails after r224953
3319         https://bugs.webkit.org/show_bug.cgi?id=179824
3320
3321         Reviewed by Chris Fleizach.
3322
3323         The failure was due to AXPropertyName::KeyShortcuts not being included in
3324         the group of properties whose value is a string. As a result, the new method
3325         to get string values, AccessibleNode::effectiveStringValueForElement(), was
3326         returning an empty String. This was not caught by the shared set of tests
3327         because at the present time, only WebKitGtk supports aria-keyshortcuts.
3328
3329         No new tests needed. The regression was caught by an existing test.
3330
3331         * accessibility/AccessibleNode.cpp:
3332         (WebCore::isPropertyValueString):
3333
3334 2017-11-17  Ryan Haddad  <ryanhaddad@apple.com>
3335
3336         Unreviewed, rolling out r224952.
3337
3338         This change introduced LayoutTest failures on WK1.
3339
3340         Reverted changeset:
3341
3342         "Use RunLoop and Mode from NetworkingContext if they are
3343         given"
3344         https://bugs.webkit.org/show_bug.cgi?id=179800
3345         https://trac.webkit.org/changeset/224952
3346
3347 2017-11-16  Antoine Quint  <graouts@apple.com>
3348
3349         [Web Animations] Force a stacking context during animations that animate properties that will force a stacking context
3350         https://bugs.webkit.org/show_bug.cgi?id=179811
3351
3352         Reviewed by Dean Jackson.
3353
3354         The Web Animations specification mandates in section 4.7 (w3c.github.io/web-animations/#side-effects-section) that
3355         "for every property targeted by at least one animation effect that is current or in effect, the user agent must act
3356         as if the will-change property ([css-will-change-1]) on the target element includes the property."
3357
3358         After parsing new keyframes, we check if any of the CSS properties that get animated would end up forcing a stacking
3359         context, and if so, enforce a stacking context during the entire active lifetime of the animation.
3360
3361         Test: webanimations/animation-opacity-animation-crash.html
3362
3363         * animation/KeyframeEffect.cpp:
3364         (WebCore::KeyframeEffect::processKeyframes):
3365         (WebCore::KeyframeEffect::computeStackingContextImpact):
3366         (WebCore::KeyframeEffect::applyAtLocalTime):
3367         * animation/KeyframeEffect.h:
3368
3369 2017-11-17  Ali Juma  <ajuma@chromium.org>
3370
3371         Update feature status for Visual Viewport API to "In Development"
3372         https://bugs.webkit.org/show_bug.cgi?id=179818
3373
3374         Reviewed by Frédéric Wang.
3375
3376         Work on this feature has started, tracked by bug 170982.
3377
3378         No new tests since there's no change in behavior.
3379
3380         * features.json:
3381
3382 2017-11-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3383
3384         [WinCairo] Add network (curl) files for wincairo webkit
3385         https://bugs.webkit.org/show_bug.cgi?id=179474
3386
3387         Reviewed by Alex Christensen.
3388
3389         No new behvaior, no new tests.
3390
3391         * PlatformWinCairo.cmake:
3392         * platform/Curl.cmake:
3393         * platform/network/curl/CookieStorageCurl.cpp: Added.
3394         (WebCore::startObservingCookieChanges):
3395         (WebCore::stopObservingCookieChanges):
3396         * platform/network/curl/NetworkStorageSessionCurl.cpp: Added.
3397         (WebCore::NetworkStorageSession::~NetworkStorageSession):
3398         (WebCore::NetworkStorageSession::context const):
3399         (WebCore::defaultSession):
3400         (WebCore::NetworkStorageSession::ensureSession):
3401         (WebCore::NetworkStorageSession::switchToNewTestingSession):
3402         (WebCore::NetworkStorageSession::setCookies):
3403         (WebCore::NetworkStorageSession::setCookie):
3404         (WebCore::NetworkStorageSession::deleteCookie):
3405         (WebCore::NetworkStorageSession::getAllCookies):
3406         (WebCore::NetworkStorageSession::getCookies):
3407         (WebCore::NetworkStorageSession::flushCookieStore):
3408
3409 2017-11-16  Alex Christensen  <achristensen@webkit.org>
3410
3411         Fix occasional crash when adding and removing videos
3412         https://bugs.webkit.org/show_bug.cgi?id=179792
3413
3414         Reviewed by Geoffrey Garen.
3415
3416         In taskCompleted we null out session, and in resume we call _restart on the main thread.
3417         If _restart is called after taskCompleted, we want to do nothing.
3418         Right now we are calling a method on self.session.loader which is a PlatformMediaResourceLoader&
3419         but in ObjC if session is null it will call PlatformMediaResourceLoader::requestResource with a
3420         null this pointer, which crashes.  Let's not crash.
3421
3422         * platform/network/cocoa/WebCoreNSURLSession.mm:
3423         (-[WebCoreNSURLSessionDataTask _restart]):
3424         Early return if we don't have a session.
3425
3426 2017-11-16  Don Olmstead  <don.olmstead@sony.com>
3427
3428         [WinCairo] Update WinCairoRequirements
3429         https://bugs.webkit.org/show_bug.cgi?id=179790
3430
3431         Reviewed by Alex Christensen.
3432
3433         No new tests. No change in behavior.
3434
3435         * PlatformWin.cmake:
3436
3437 2017-11-16  Antoine Quint  <graouts@apple.com>
3438
3439         [Web Animations] Allow KeyframeEffect to support CSS property animation blending
3440         https://bugs.webkit.org/show_bug.cgi?id=179810
3441
3442         Reviewed by Tim Horton.
3443
3444         We used to pass nullptr instead of a valid AnimationBase when calling CSSPropertyAnimation::blendProperties()
3445         in KeyframeEffect::applyAtLocalTime() when blending CSS styles during a keyframe animation. Without this
3446         AnimationBase, some blending functions would crash as certain supporting calls couldn't be made.
3447
3448         We now add a new CSSPropertyBlendingClient virtual interface that both KeyframeEffect and AnimationBase
3449         implement and that CSSPropertyAnimation::blendProperties() take as a parameter in order to support
3450         blending code.
3451
3452         * WebCore.xcodeproj/project.pbxproj:
3453         * animation/CSSPropertyBlendingClient.h: Added.
3454         * animation/KeyframeEffect.cpp:
3455         (WebCore::KeyframeEffect::applyAtLocalTime):
3456         (WebCore::KeyframeEffect::renderer const):
3457         (WebCore::KeyframeEffect::currentStyle const):
3458         * animation/KeyframeEffect.h:
3459         * page/animation/AnimationBase.h:
3460         (WebCore::AnimationBase::isAccelerated const):
3461         (WebCore::AnimationBase::transformFunctionListsMatch const):
3462         (WebCore::AnimationBase::filterFunctionListsMatch const):
3463         (WebCore::AnimationBase::backdropFilterFunctionListsMatch const):
3464         * page/animation/CSSPropertyAnimation.cpp:
3465         (WebCore::blendFunc):
3466         (WebCore::blendFilterOperations):
3467         (WebCore::blendFilter):
3468         (WebCore::crossfadeBlend):
3469         (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const):
3470         (WebCore::PropertyWrapperShadow::blendSimpleOrMatchedShadowLists const):
3471         (WebCore::PropertyWrapperShadow::blendMismatchedShadowLists const):
3472         (WebCore::CSSPropertyAnimation::blendProperties):
3473         * page/animation/CSSPropertyAnimation.h:
3474
3475 2017-11-16  Youenn Fablet  <youenn@apple.com>
3476
3477         Service Worker should get the body of intercepted requests
3478         https://bugs.webkit.org/show_bug.cgi?id=179776
3479
3480         Reviewed by Alex Christensen.
3481
3482         Test: http/tests/workers/service/service-worker-request-with-body.https.html
3483
3484         Make use of FetchBodyConsumer to store raw data for FetchRequest.
3485         This is used when setting FetchRequest body from a FormData.
3486         If FormData is only bytes (no blob, no file), FetchBodyConsumer will store that data.
3487         This allows Service Worker to get access to simple request bodies.
3488
3489         * Modules/fetch/FetchBody.cpp:
3490         (WebCore::FetchBody::fromFormData):
3491         (WebCore::FetchBody::consume):
3492         (WebCore::FetchBody::bodyAsFormData const): Making sure body is set appropriately when used to make fetch load.
3493         * Modules/fetch/FetchBody.h: Making some methods private.
3494         * Modules/fetch/FetchBodyConsumer.h: Adding accessors.
3495         (WebCore::FetchBodyConsumer::hasData const):
3496         (WebCore::FetchBodyConsumer::data const):
3497         * Modules/fetch/FetchRequest.h:
3498         (WebCore::FetchRequest::FetchRequest):
3499         * platform/network/FormData.cpp:
3500         (WebCore::FormData::asSharedBuffer const):
3501         * platform/network/FormData.h:
3502         * workers/service/context/ServiceWorkerFetch.cpp:
3503         (WebCore::ServiceWorkerFetch::dispatchFetchEvent): Setting FetchRequest body based on given FormData.
3504
3505 2017-11-16  Chris Dumez  <cdumez@apple.com>
3506
3507         Make sure service workers get terminated between tests
3508         https://bugs.webkit.org/show_bug.cgi?id=179774
3509
3510         Reviewed by Alex Christensen.
3511
3512         Make sure service workers get terminated between tests. Previously, we
3513         would merely clear all registrations and job queues but it would not
3514         cause the registrations' service workers to get terminated.
3515
3516         * workers/service/context/ServiceWorkerThread.cpp:
3517         (WebCore::ServiceWorkerThread::updateExtendedEventsSet):
3518         * workers/service/server/SWServer.cpp:
3519         (WebCore::SWServer::clearAll):
3520         * workers/service/server/SWServerJobQueue.cpp:
3521         (WebCore::SWServerJobQueue::scriptFetchFinished):
3522         (WebCore::SWServerJobQueue::scriptContextFailedToStart):
3523         (WebCore::SWServerJobQueue::didFinishInstall):
3524         (WebCore::SWServerJobQueue::tryClearRegistration):
3525         (WebCore::SWServerJobQueue::clearRegistration):
3526         * workers/service/server/SWServerJobQueue.h:
3527
3528 2017-11-16  Youenn Fablet  <youenn@apple.com>
3529
3530         FetchLoader should unregister its blob URL
3531         https://bugs.webkit.org/show_bug.cgi?id=179768
3532
3533         Reviewed by Alex Christensen.
3534
3535         No observable change.
3536
3537         Keep the blob URL used for reading and unregister it in destructor.
3538
3539         * Modules/fetch/FetchLoader.cpp:
3540         (WebCore::FetchLoader::~FetchLoader):
3541         (WebCore::FetchLoader::start):
3542         * Modules/fetch/FetchLoader.h:
3543
3544 2017-11-16  Nan Wang  <n_wang@apple.com>
3545
3546         AX: AOM: Implement string type properties
3547         https://bugs.webkit.org/show_bug.cgi?id=179495
3548
3549         Reviewed by Chris Fleizach.
3550
3551         Implemented the rest of the string type properties for Accessibility
3552         Object Model.
3553
3554         Test: accessibility/mac/AOM-string-properties.html
3555
3556         * accessibility/AXObjectCache.cpp:
3557         (WebCore::AXObjectCache::handleLiveRegionCreated):
3558         * accessibility/AccessibilityNodeObject.cpp:
3559         (WebCore::AccessibilityNodeObject::childrenChanged):
3560         (WebCore::AccessibilityNodeObject::isPressed const):
3561         (WebCore::AccessibilityNodeObject::isChecked const):
3562         (WebCore::AccessibilityNodeObject::valueDescription const):
3563         * accessibility/AccessibilityObject.cpp:
3564         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
3565         (WebCore::AccessibilityObject::supportsAutoComplete const):
3566         (WebCore::AccessibilityObject::autoCompleteValue const):
3567         (WebCore::AccessibilityObject::invalidStatus const):
3568         (WebCore::AccessibilityObject::supportsCurrent const):
3569         (WebCore::AccessibilityObject::currentState const):
3570         (WebCore::AccessibilityObject::currentValue const):
3571         (WebCore::AccessibilityObject::roleDescription const):
3572         (WebCore::AccessibilityObject::keyShortcutsValue const):
3573         (WebCore::AccessibilityObject::placeholderValue const):
3574         (WebCore::AccessibilityObject::isInsideLiveRegion const):
3575         (WebCore::AccessibilityObject::liveRegionAncestor const):
3576         (WebCore::AccessibilityObject::supportsARIAAttributes const):
3577         (WebCore::AccessibilityObject::supportsLiveRegion const):
3578         (WebCore::AccessibilityObject::sortDirection const):
3579         (WebCore::AccessibilityObject::supportsHasPopup const):
3580         (WebCore::AccessibilityObject::hasPopupValue const):
3581         (WebCore::AccessibilityObject::supportsPressed const):
3582         (WebCore::AccessibilityObject::checkboxOrRadioValue const):
3583         (WebCore::AccessibilityObject::pressedIsPresent const):
3584         (WebCore::AccessibilityObject::buttonRoleType const):
3585         (WebCore::AccessibilityObject::supportsARIAAutoComplete const): Deleted.
3586         (WebCore::AccessibilityObject::ariaAutoCompleteValue const): Deleted.
3587         (WebCore::AccessibilityObject::supportsARIACurrent const): Deleted.
3588         (WebCore::AccessibilityObject::ariaCurrentState const): Deleted.
3589         (WebCore::AccessibilityObject::ariaCurrentValue const): Deleted.
3590         (WebCore::AccessibilityObject::ariaKeyShortcutsValue const): Deleted.
3591         (WebCore::AccessibilityObject::isInsideARIALiveRegion const): Deleted.
3592         (WebCore::AccessibilityObject::ariaLiveRegionAncestor const): Deleted.
3593         (WebCore::AccessibilityObject::supportsARIALiveRegion const): Deleted.
3594         (WebCore::AccessibilityObject::supportsARIAHasPopup const): Deleted.
3595         (WebCore::AccessibilityObject::ariaPopupValue const): Deleted.
3596         (WebCore::AccessibilityObject::supportsARIAPressed const): Deleted.
3597         (WebCore::AccessibilityObject::ariaPressedIsPresent const): Deleted.
3598         * accessibility/AccessibilityObject.h:
3599         (WebCore::AccessibilityObject::hasPopup const):
3600         (WebCore::AccessibilityObject::liveRegionStatus const):
3601         (WebCore::AccessibilityObject::liveRegionRelevant const):
3602         (WebCore::AccessibilityObject::liveRegionAtomic const):
3603         (WebCore::AccessibilityObject::ariaHasPopup const): Deleted.
3604         (WebCore::AccessibilityObject::ariaLiveRegionStatus const): Deleted.
3605         (WebCore::AccessibilityObject::ariaLiveRegionRelevant const): Deleted.
3606         (WebCore::AccessibilityObject::ariaLiveRegionAtomic const): Deleted.
3607         * accessibility/AccessibilityRenderObject.cpp:
3608         (WebCore::AccessibilityRenderObject::hasPopup const):
3609         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3610         (WebCore::AccessibilityRenderObject::orientation const):
3611         (WebCore::AccessibilityRenderObject::textChanged):
3612         (WebCore::AccessibilityRenderObject::liveRegionStatus const):
3613         (WebCore::AccessibilityRenderObject::liveRegionRelevant const):
3614         (WebCore::AccessibilityRenderObject::liveRegionAtomic const):
3615         (WebCore::AccessibilityRenderObject::ariaHasPopup const): Deleted.
3616         (WebCore::AccessibilityRenderObject::ariaLiveRegionStatus const): Deleted.
3617         (WebCore::AccessibilityRenderObject::ariaLiveRegionRelevant const): Deleted.
3618         (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const): Deleted.
3619         * accessibility/AccessibilityRenderObject.h:
3620         * accessibility/AccessibleNode.cpp:
3621         (WebCore::ariaAttributeMap):
3622         (WebCore::isPropertyValueString):
3623         (WebCore::AccessibleNode::notifyAttributeChanged):
3624         (WebCore::AccessibleNode::autocomplete const):
3625         (WebCore::AccessibleNode::setAutocomplete):
3626         (WebCore::AccessibleNode::checked const):
3627         (WebCore::AccessibleNode::setChecked):
3628         (WebCore::AccessibleNode::current const):
3629         (WebCore::AccessibleNode::setCurrent):
3630         (WebCore::AccessibleNode::hasPopUp const):
3631         (WebCore::AccessibleNode::setHasPopUp):
3632         (WebCore::AccessibleNode::invalid const):
3633         (WebCore::AccessibleNode::setInvalid):
3634         (WebCore::AccessibleNode::keyShortcuts const):
3635         (WebCore::AccessibleNode::setKeyShortcuts):
3636         (WebCore::AccessibleNode::live const):
3637         (WebCore::AccessibleNode::setLive):
3638         (WebCore::AccessibleNode::setLabel):
3639         (WebCore::AccessibleNode::orientation const):
3640         (WebCore::AccessibleNode::setOrientation):
3641         (WebCore::AccessibleNode::placeholder const):
3642         (WebCore::AccessibleNode::setPlaceholder):
3643         (WebCore::AccessibleNode::pressed const):
3644         (WebCore::AccessibleNode::setPressed):
3645         (WebCore::AccessibleNode::relevant const):
3646         (WebCore::AccessibleNode::setRelevant):
3647         (WebCore::AccessibleNode::role const):
3648         (WebCore::AccessibleNode::setRole):
3649         (WebCore::AccessibleNode::roleDescription const):
3650         (WebCore::AccessibleNode::setRoleDescription):
3651         (WebCore::AccessibleNode::sort const):
3652         (WebCore::AccessibleNode::setSort):
3653         (WebCore::AccessibleNode::valueText const):
3654         (WebCore::AccessibleNode::setValueText):
3655         * accessibility/AccessibleNode.h:
3656         (WebCore::AXPropertyHashTraits::constructDeletedValue):
3657         (WebCore::AXPropertyHashTraits::isDeletedValue):
3658         * accessibility/AccessibleNode.idl:
3659         * accessibility/atk/AXObjectCacheAtk.cpp:
3660         (WebCore::AXObjectCache::postPlatformNotification):
3661         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3662         (webkitAccessibleGetAttributes):
3663         (atkRole):
3664         (setAtkStateSetFromCoreObject):
3665         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3666         (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
3667         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionStatus]):
3668         (-[WebAccessibilityObjectWrapper accessibilityARIARelevantStatus]):
3669         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
3670         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
3671         (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]):
3672         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3673         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
3674         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3675         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3676         * inspector/agents/InspectorDOMAgent.cpp:
3677         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3678
3679 2017-11-16  Alex Christensen  <achristensen@webkit.org>
3680
3681         Use RunLoop and Mode from NetworkingContext if they are given
3682         https://bugs.webkit.org/show_bug.cgi?id=179800
3683         <rdar://problem/35519421>
3684
3685         Reviewed by Brady Eidson.
3686
3687         We used to call [NSURLConnection scheduleInRunLoop:forMode:] before r224267.
3688         That change broke WebKitLegacy clients using custom run loop modes, which I partially fixed in r224687 and r224896,
3689         but that hangs if there are any non-scheduled calls to callOnMainThread and it ignores the CFRunLoop part of the SchedulePair.
3690         This is a more elegant solution that fixes all known bugs with custom run loop modes and makes the
3691         behavior as close to the pre-r224267 behavior as possible by using all parameters in a good way.
3692
3693         I verified the bug in the radar is fixed, the API test WebKitLegacy.ScheduleInRunLoop still passes,
3694         and UIWebView still works on iOS.
3695
3696         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3697         (callOnMainThreadOrSchedule):
3698         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
3699         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
3700         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
3701         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3702         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
3703         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
3704         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
3705         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
3706         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
3707
3708 2017-11-16  Daniel Bates  <dabates@apple.com>
3709
3710         Add feature define for alternative presentation button element
3711         https://bugs.webkit.org/show_bug.cgi?id=179692
3712         Part of <rdar://problem/34917108>
3713
3714         Reviewed by Andy Estes.
3715
3716         Only enabled on Cocoa platforms by default.
3717
3718         * Configurations/FeatureDefines.xcconfig:
3719
3720 2017-11-16  Chris Dumez  <cdumez@apple.com>
3721
3722         [Service Worker] Implement "Try Clear Registration" algorithm
3723         https://bugs.webkit.org/show_bug.cgi?id=179791
3724
3725         Reviewed by Youenn Fablet.
3726
3727         Implement "Try Clear Registration" algorithm:
3728         - https://w3c.github.io/ServiceWorker/#try-clear-registration-algorithm
3729
3730         In particular, a SWServerRegistration now knows if it is "in use" by a given
3731         service worker client (i.e. The registration's active service worker is
3732         controlling the service worker client). See:
3733         - https://w3c.github.io/ServiceWorker/#selection (last paragraph)
3734
3735         No new tests, rebaselined existing tests.
3736
3737         * dom/ScriptExecutionContext.cpp:
3738         (WebCore::ScriptExecutionContext::setActiveServiceWorker):
3739         * workers/service/server/SWClientConnection.h:
3740         * workers/service/server/SWServer.cpp:
3741         (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient):
3742         (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient):
3743         (WebCore::SWServer::serviceWorkerStartedControllingClient):
3744         (WebCore::SWServer::serviceWorkerStoppedControllingClient):
3745         * workers/service/server/SWServer.h:
3746         * workers/service/server/SWServerJobQueue.cpp:
3747         (WebCore::SWServerJobQueue::tryClearRegistration):
3748         * workers/service/server/SWServerRegistration.h:
3749         (WebCore::SWServerRegistration::hasClientsUsingRegistration const):
3750         (WebCore::SWServerRegistration::addClientUsingRegistration):
3751         (WebCore::SWServerRegistration::removeClientUsingRegistration):
3752
3753 2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>
3754
3755         REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState
3756         https://bugs.webkit.org/show_bug.cgi?id=179797
3757
3758         Reviewed by Simon Fraser.
3759
3760         Editor::canUndo and Editor::CanRedo no longer need to be exported.
3761
3762         * editing/Editor.h:
3763
3764 2017-11-16  Chris Dumez  <cdumez@apple.com>
3765
3766         Dispatching an event on a ServiceWorkerRegistration may fail or crash due to GC
3767         https://bugs.webkit.org/show_bug.cgi?id=179751
3768
3769         Reviewed by Geoffrey Garen.
3770
3771         Dispatching an event on a ServiceWorkerRegistration may fail or crash due to GC. We
3772         need to make sure that a ServiceWorkerRegistration's wrapper stays alive as long as
3773         we may dispatch events on it.
3774
3775         Keep the wrapper alive by making ServiceWorker an ActiveDOMObject and making sure the
3776         implementation object keeps a PendingActivity alive while it may dispatch JS events.
3777         The only event dispatched on ServiceWorkerRegistration objects is the "updatefound"
3778         one. We may dispatch updatefound events on a ServiceWorkerRegistration until the
3779         registration gets cleared on server side, in which case the ServiceWorkerRegistration
3780         object ends up with no service worker. We therefore take a PendingActivity when the
3781         ServiceWorkerRegistration is constructed and we release it once the registration has
3782         no more associated ServiceWorker or the ActiveDOMObject is stopped (to avoid leaks on
3783         navigation).
3784
3785         Test: http/tests/workers/service/service-worker-registration-gc-event.html
3786
3787         * workers/service/ServiceWorkerContainer.cpp:
3788         (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
3789         * workers/service/ServiceWorkerRegistration.cpp:
3790         (WebCore::ServiceWorkerRegistration::getOrCreate):
3791         (WebCore::ServiceWorkerRegistration::updateStateFromServer):
3792         (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
3793         (WebCore::ServiceWorkerRegistration::stop):
3794         (WebCore::ServiceWorkerRegistration::updatePendingActivityForEventDispatch):
3795         * workers/service/ServiceWorkerRegistration.h:
3796         * workers/service/ServiceWorkerRegistration.idl:
3797
3798 2017-11-16  Chris Dumez  <cdumez@apple.com>
3799
3800         Crash in WebCore::SWServerJobQueue::scriptFetchFinished(WebCore::SWServer::Connection&, WebCore::ServiceWorkerFetchResult const&) + 77
3801         https://bugs.webkit.org/show_bug.cgi?id=179394
3802         <rdar://problem/35478190>
3803
3804         Reviewed by Youenn Fablet.
3805
3806         In SWServerJobQueue::scriptFetchFinished(), make sure the job queue is still processing the
3807         job that triggered the fetch. If it is not, ignore the callback.
3808
3809         This could happen when calling SWServer::clear() while a script fetch was pending.
3810
3811         No new tests, already covered by existing tests that sometimes crash on the bots.
3812
3813         * workers/service/server/SWServerJobQueue.cpp:
3814         (WebCore::SWServerJobQueue::isCurrentlyProcessingJob const):
3815         (WebCore::SWServerJobQueue::scriptFetchFinished):
3816         * workers/service/server/SWServerJobQueue.h:
3817
3818 2017-11-16  Brady Eidson  <beidson@apple.com>
3819
3820         Crash in worker tests handling the m_stoppedCallback.
3821         <rdar://problem/35590875> and https://bugs.webkit.org/show_bug.cgi?id=179798
3822
3823         Reviewed by Chris Dumez.
3824
3825         No new tests (Covered by existing tests).
3826
3827         Protect manipulation of m_stoppedCallback with m_threadCreationAndWorkerGlobalScopeMutex.
3828
3829         * workers/WorkerThread.cpp:
3830         (WebCore::WorkerThread::workerThread):
3831         (WebCore::WorkerThread::stop):
3832
3833 2017-11-16  Antoine Quint  <graouts@apple.com>
3834
3835         [Web Animations] Express time in milliseconds through the API
3836         https://bugs.webkit.org/show_bug.cgi?id=179799
3837
3838         Reviewed by Simon Fraser.
3839
3840         While internally we use seconds to specify times and durations, the Web Animations API
3841         uses milliseconds, so we have to convert times and durations from and to milliseconds.
3842
3843         * animation/AnimationEffectTiming.h:
3844         * animation/AnimationTimeline.cpp:
3845         (WebCore::AnimationTimeline::bindingsCurrentTime):
3846         * animation/WebAnimation.cpp:
3847         (WebCore::WebAnimation::bindingsStartTime const):
3848         (WebCore::WebAnimation::setBindingsStartTime):
3849         (WebCore::WebAnimation::bindingsCurrentTime const):
3850         (WebCore::WebAnimation::setBindingsCurrentTime):
3851         * testing/Internals.cpp:
3852         (WebCore::Internals::setTimelineCurrentTime):
3853
3854 2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>
3855
3856         REGRESSION(r224887): GCC 5 build broken
3857         https://bugs.webkit.org/show_bug.cgi?id=179750
3858
3859         Reviewed by Jer Noble.
3860
3861         Add a legacy FourCC constructor that will be used only when building with GCC 5. This is
3862         bad, but it seems acceptable for use with a fallback codepath.
3863
3864         Unfortunately, this requires adjusting some initializations to avoid ambiguity with the
3865         uint32_t constructor.
3866
3867         * platform/graphics/FourCC.h:
3868         (WebCore::FourCC::FourCC):
3869         * platform/graphics/iso/ISOBox.cpp:
3870         (WebCore::ISOBox::peekBox):
3871         * platform/graphics/iso/ISOBox.h:
3872         * platform/graphics/iso/ISOOriginalFormatBox.h:
3873         * platform/graphics/iso/ISOSchemeTypeBox.h:
3874
3875 2017-11-16  Andy Estes  <aestes@apple.com>
3876
3877         [Payment Request] Update feature status to "Supported In Preview"
3878         https://bugs.webkit.org/show_bug.cgi?id=179793
3879
3880         Reviewed by Tim Horton.
3881
3882         * features.json:
3883
3884 2017-11-16  Antoine Quint  <graouts@apple.com>
3885
3886         Clean up KeyframeEffect
3887         https://bugs.webkit.org/show_bug.cgi?id=179777
3888
3889         Reviewed by Daniel Bates.
3890
3891         A few review comments came in after https://bugs.webkit.org/show_bug.cgi?id=179707 landed,
3892         addressing them with this follow-up patch.
3893
3894         * animation/KeyframeEffect.cpp:
3895         (WebCore::KeyframeEffect::create): Use "keyframeEffect" instead of "result" for clarity.
3896         (WebCore::KeyframeEffect::processKeyframes): Use consistent index and length types while iterating
3897         over properties in PropertyNameArray and explicitly size the properties array since we already
3898         know its final size.
3899         * dom/Element.cpp:
3900         (WebCore::Element::getAnimations):
3901
3902 2017-11-16  Zalan Bujtas  <zalan@apple.com>
3903
3904         Always invoke RenderObject::insertedIntoTree/willBeRemovedFromTree
3905         https://bugs.webkit.org/show_bug.cgi?id=178007
3906
3907         Reviewed by Antti Koivisto.
3908
3909         Based on Antti Koivisto's patch:
3910         These call are currently skipped in some cases making them bug prone and difficult to reason about.
3911         This is done as an optimization that doesn't appear to be valuable anymore.
3912
3913         Covered by existing tests.
3914
3915         * rendering/RenderBlock.cpp:
3916         (WebCore::RenderBlock::makeChildrenNonInline):
3917         (WebCore::RenderBlock::dropAnonymousBoxChild):
3918         (WebCore::RenderBlock::takeChild):
3919         * rendering/RenderBlock.h:
3920         (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
3921         * rendering/RenderBlockFlow.cpp:
3922         (WebCore::RenderBlockFlow::styleDidChange):
3923         (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
3924         * rendering/RenderBlockFlow.h:
3925         * rendering/RenderBox.cpp:
3926         (WebCore::RenderBox::splitAnonymousBoxesAroundChild):
3927         * rendering/RenderBoxModelObject.cpp:
3928         (WebCore::RenderBoxModelObject::moveChildTo):
3929         (WebCore::RenderBoxModelObject::moveChildrenTo):
3930         * rendering/RenderBoxModelObject.h:
3931         (WebCore::RenderBoxModelObject::moveChildTo):
3932         (WebCore::RenderBoxModelObject::moveAllChildrenTo):
3933         (WebCore::RenderBoxModelObject::moveChildrenTo):
3934         * rendering/RenderElement.cpp:
3935         (WebCore::RenderElement::addChild):
3936         (WebCore::RenderElement::takeChild):
3937         (WebCore::RenderElement::insertChildInternal):
3938         (WebCore::RenderElement::takeChildInternal):
3939         (WebCore::RenderElement::handleDynamicFloatPositionChange):