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