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