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