Implement new TextMetrics, returned by canvas measureText()
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-07-26  Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
2
3         Implement new TextMetrics, returned by canvas measureText()
4         https://bugs.webkit.org/show_bug.cgi?id=82798
5         <rdar://problem/11159332>
6
7         Reviewed by Dean Jackson.
8
9         The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext
10
11         Add new attributes to TextMetrics.
12
13         Add a new method textOffset() of CanvasRenderingContext2D by
14         extracting from drawTextInternal() to use the same horizontal and
15         vertical offsets of a text in both drawTextInternal() and
16         measureText().
17
18         Test: fast/canvas/canvas-measureText-2.html
19
20         * html/TextMetrics.h:
21         (WebCore::TextMetrics::actualBoundingBoxLeft):
22         (WebCore::TextMetrics::setActualBoundingBoxLeft):
23         (WebCore::TextMetrics::actualBoundingBoxRight):
24         (WebCore::TextMetrics::setActualBoundingBoxRight):
25         (WebCore::TextMetrics::fontBoundingBoxAscent):
26         (WebCore::TextMetrics::setFontBoundingBoxAscent):
27         (WebCore::TextMetrics::fontBoundingBoxDescent):
28         (WebCore::TextMetrics::setFontBoundingBoxDescent):
29         (WebCore::TextMetrics::actualBoundingBoxAscent):
30         (WebCore::TextMetrics::setActualBoundingBoxAscent):
31         (WebCore::TextMetrics::actualBoundingBoxDescent):
32         (WebCore::TextMetrics::setActualBoundingBoxDescent):
33         (WebCore::TextMetrics::emHeightAscent):
34         (WebCore::TextMetrics::setEmHeightAscent):
35         (WebCore::TextMetrics::emHeightDescent):
36         (WebCore::TextMetrics::setEmHeightDescent):
37         (WebCore::TextMetrics::hangingBaseline):
38         (WebCore::TextMetrics::setHangingBaseline):
39         (WebCore::TextMetrics::alphabeticBaseline):
40         (WebCore::TextMetrics::setAlphabeticBaseline):
41         (WebCore::TextMetrics::ideographicBaseline):
42         (WebCore::TextMetrics::setIdeographicBaseline):
43         Added getters and setters.
44         (WebCore::TextMetrics::TextMetrics): Deleted.
45         * html/TextMetrics.idl: Added new attributes.
46         * html/canvas/CanvasRenderingContext2D.cpp:
47         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
48         Changed the return value type to a const reference of FontMetrics
49         not to copy it.
50         (WebCore::CanvasRenderingContext2D::FontProxy::width):
51         Added the second arguemnt of GlyphOverflow type.
52         (WebCore::CanvasRenderingContext2D::measureText): Calculate and
53         set the new attributes of TextMetrics.
54         (WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal.
55         (WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the
56         offset calculation code and call textOffset.
57         * html/canvas/CanvasRenderingContext2D.h: Added the method
58         declaration of textOffset. Change types of fontMetrics and width
59         methods.
60         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
61         (WebCore::FontCascade::floatWidthForComplexText): Added a dummy
62         implementation of calculating GlyphOverflow.
63
64 2017-07-26  Devin Rousso  <drousso@apple.com>
65
66         Web Inspector: create protocol for recording Canvas contexts
67         https://bugs.webkit.org/show_bug.cgi?id=174481
68
69         Reviewed by Joseph Pecoraro.
70
71         Currently, a recording doesn't actually "start" until an action is performed on the context.
72         This change adds the recording logic, but it does not use it anywhere. Additonal tests will
73         be added in the patches that add uses:
74          - <https://webkit.org/b/174482> Web Inspector: Record actions performed on CanvasRenderingContext2D
75          - <https://webkit.org/b/174483> Web Inspector: Record actions performed on WebGLRenderingContext
76
77         Test: inspector/model/recording.html
78
79         * bindings/scripts/IDLAttributes.json:
80         * bindings/scripts/CodeGeneratorJS.pm:
81         (GenerateAttributeGetterBodyDefinition):
82         (GenerateAttributeSetterBodyDefinition):
83         (GenerateImplementationFunctionCall):
84         * WebCore.xcodeproj/project.pbxproj:
85         * bindings/js/CallTracer.h: Added.
86         * bindings/js/CallTracer.cpp: Added.
87         (WebCore::CallTracer::recordCanvasAction):
88         * bindings/js/CallTracerTypes.h: Added.
89         * bindings/scripts/test/TestCallTracer.idl: Added.
90         * bindings/scripts/test/JS/JSTestCallTracer.h: Added.
91         * bindings/scripts/test/JS/JSTestCallTracer.cpp: Added.
92
93         Create new IDL extended attribute called "CallTracingCallback" that will add code to call a
94         static function on CallTracer with the given extended attribute value as the function name,
95         the `impl` object as the first parameter, the name of the attribute/operation as the second,
96         and an optional object that accepts an initializer list of all the parameters as the third.
97
98         This function will not be called, however, unless a `callTracingActive` function on the
99         `impl` object returns true, and this is marked as UNLIKELY.
100
101         "CallTracingCallback" can be added to an Interface, in which case it will apply to all
102         attributes/operations of the generated class, or an individual Attribute/Operation.
103
104         * html/canvas/CanvasRenderingContext.h:
105         (WebCore::CanvasRenderingContext::callTracingActive):
106         (WebCore::CanvasRenderingContext::setCallTracingActive):
107
108         * inspector/InspectorCanvas.h:
109         * inspector/InspectorCanvas.cpp:
110         (WebCore::InspectorCanvas::~InspectorCanvas):
111         (WebCore::InspectorCanvas::resetRecordingData):
112         (WebCore::InspectorCanvas::hasRecordingData):
113         (WebCore::InspectorCanvas::recordAction):
114         (WebCore::InspectorCanvas::releaseInitialState):
115         (WebCore::InspectorCanvas::releaseFrames):
116         (WebCore::InspectorCanvas::releaseData):
117         (WebCore::InspectorCanvas::markNewFrame):
118         (WebCore::InspectorCanvas::markCurrentFrameIncomplete):
119         (WebCore::InspectorCanvas::setBufferLimit):
120         (WebCore::InspectorCanvas::hasBufferSpace):
121         (WebCore::InspectorCanvas::singleFrame):
122         (WebCore::InspectorCanvas::setSingleFrame):
123         (WebCore::InspectorCanvas::indexForData):
124         (WebCore::buildArrayForAffineTransform):
125         (WebCore::buildArrayForVector):
126         (WebCore::InspectorCanvas::buildInitialState):
127         (WebCore::InspectorCanvas::buildAction):
128         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
129         (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
130         (WebCore::InspectorCanvas::buildArrayForImageData):
131
132         Hold the recording data on the corresponding InspectorCanvas. Recording Frames are
133         completed when the HTMLCanvasElement paints or a  0_s timer is fired. A recording is not
134         considered valid until at least one action is performed on the canvas context. Once that
135         condition is satisfied, canceling the recording will flush the data.
136
137         * inspector/InspectorCanvasAgent.h:
138         * inspector/InspectorCanvasAgent.cpp:
139         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
140         (WebCore::InspectorCanvasAgent::disable):
141         (WebCore::InspectorCanvasAgent::requestRecording):
142         (WebCore::InspectorCanvasAgent::cancelRecording):
143         (WebCore::InspectorCanvasAgent::recordCanvasAction):
144         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
145         (WebCore::InspectorCanvasAgent::canvasDestroyed):
146         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
147         (WebCore::InspectorCanvasAgent::clearCanvasData):
148
149         * inspector/InspectorInstrumentation.h:
150         * inspector/InspectorInstrumentation.cpp:
151         (WebCore::InspectorInstrumentation::recordCanvasAction):
152         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
153         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
154
155         * html/canvas/CanvasRenderingContext2D.h:
156         * html/canvas/CanvasRenderingContext2D.cpp:
157         (WebCore::CanvasRenderingContext2D::stringForWindingRule):
158         (WebCore::CanvasRenderingContext2D::stringForImageSmoothingQuality):
159
160         * platform/graphics/Gradient.h:
161         (WebCore::Gradient::stops):
162
163         * svg/SVGPathUtilities.h:
164         * svg/SVGPathUtilities.cpp:
165         (WebCore::buildStringFromPath):
166
167 2017-07-26  Ali Juma  <ajuma@chromium.org>
168
169         Implement document.elementsFromPoint
170         https://bugs.webkit.org/show_bug.cgi?id=153137
171
172         Reviewed by Simon Fraser.
173
174         This ports Blink's implementation of elementsFromPoint, from the
175         following patches by Philip Rogers (pdr@chromium.org):
176         -https://src.chromium.org/viewvc/blink?revision=190686&view=revision
177         -https://src.chromium.org/viewvc/blink?revision=191240&view=revision
178         -https://src.chromium.org/viewvc/blink?revision=199214&view=revision
179
180         Tests: imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-iframes.html
181                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html
182                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html
183                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-simple.html
184                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-svg.html
185                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-table.html
186
187         * dom/DocumentOrShadowRoot.idl:
188         * dom/TreeScope.cpp:
189         (WebCore::absolutePointIfNotClipped):
190         (WebCore::TreeScope::nodeFromPoint):
191         (WebCore::TreeScope::elementFromPoint):
192         (WebCore::TreeScope::elementsFromPoint):
193         * dom/TreeScope.h:
194         * page/EventHandler.cpp:
195         (WebCore::EventHandler::hitTestResultAtPoint):
196         * rendering/EllipsisBox.cpp:
197         (WebCore::EllipsisBox::nodeAtPoint):
198         * rendering/HitTestRequest.h:
199         (WebCore::HitTestRequest::HitTestRequest):
200         (WebCore::HitTestRequest::resultIsElementList):
201         (WebCore::HitTestRequest::includesAllElementsUnderPoint):
202         * rendering/HitTestResult.cpp:
203         (WebCore::HitTestResult::HitTestResult):
204         (WebCore::HitTestResult::operator=):
205         (WebCore::HitTestResult::addNodeToListBasedTestResult):
206         (WebCore::HitTestResult::append):
207         (WebCore::HitTestResult::listBasedTestResult):
208         (WebCore::HitTestResult::mutableListBasedTestResult):
209         (WebCore::HitTestResult::addNodeToRectBasedTestResult): Deleted.
210         (WebCore::HitTestResult::rectBasedTestResult): Deleted.
211         (WebCore::HitTestResult::mutableRectBasedTestResult): Deleted.
212         * rendering/HitTestResult.h:
213         * rendering/InlineFlowBox.cpp:
214         (WebCore::InlineFlowBox::nodeAtPoint):
215         * rendering/InlineTextBox.cpp:
216         (WebCore::InlineTextBox::nodeAtPoint):
217         * rendering/RenderBlock.cpp:
218         (WebCore::RenderBlock::nodeAtPoint):
219         * rendering/RenderBox.cpp:
220         (WebCore::RenderBox::nodeAtPoint):
221         * rendering/RenderImage.cpp:
222         (WebCore::RenderImage::nodeAtPoint):
223         * rendering/RenderInline.cpp:
224         (WebCore::RenderInline::hitTestCulledInline):
225         * rendering/RenderLayer.cpp:
226         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
227         (WebCore::RenderLayer::hitTestLayer):
228         (WebCore::RenderLayer::hitTestContents):
229         (WebCore::RenderLayer::hitTestList):
230         (WebCore::RenderLayer::calculateClipRects):
231         * rendering/RenderTable.cpp:
232         (WebCore::RenderTable::nodeAtPoint):
233         * rendering/RenderTableSection.cpp:
234         (WebCore::RenderTableSection::nodeAtPoint):
235         * rendering/RenderWidget.cpp:
236         (WebCore::RenderWidget::nodeAtPoint):
237         * rendering/SimpleLineLayoutFunctions.cpp:
238         (WebCore::SimpleLineLayout::hitTestFlow):
239         * rendering/svg/RenderSVGContainer.cpp:
240         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
241         * rendering/svg/RenderSVGImage.cpp:
242         (WebCore::RenderSVGImage::nodeAtFloatPoint):
243         * rendering/svg/RenderSVGRoot.cpp:
244         (WebCore::RenderSVGRoot::nodeAtPoint):
245         * rendering/svg/RenderSVGShape.cpp:
246         (WebCore::RenderSVGShape::nodeAtFloatPoint):
247         * rendering/svg/SVGInlineTextBox.cpp:
248         (WebCore::SVGInlineTextBox::nodeAtPoint):
249         * testing/Internals.cpp:
250         (WebCore::Internals::nodesFromRect):
251
252 2017-07-26  Charlie Turner  <cturner@igalia.com>
253
254         [GStreamer] Review WebKitWebSource after r219252.
255         https://bugs.webkit.org/show_bug.cgi?id=174415
256
257         Reviewed by Carlos Garcia Campos.
258
259         Remove ResourceHandleStreamingClient, and flatten the StreamingClient
260         into CachedResourceStreamingClient (the only implemetation left). They
261         are no longer required after r219252.
262
263         Also remove the locking code. It's not needed now, and what existed
264         was heavy-handed and missed several cases it was supposed to protect
265
266         Covered by existing tests.
267
268         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
269         (webkit_web_src_init):
270         (webKitWebSrcDispose):
271         (webKitWebSrcStop):
272         (webKitWebSrcStart):
273         (webKitWebSrcNeedData):
274         (webKitWebSrcEnoughData):
275         (webKitWebSrcSeek):
276         (webKitWebSrcSetMediaPlayer):
277         (CachedResourceStreamingClient::CachedResourceStreamingClient):
278         (CachedResourceStreamingClient::~CachedResourceStreamingClient):
279         (CachedResourceStreamingClient::getOrCreateReadBuffer):
280         (CachedResourceStreamingClient::responseReceived):
281         (CachedResourceStreamingClient::dataReceived):
282         (CachedResourceStreamingClient::loadFinished):
283         (ResourceHandleStreamingClient::create): Deleted.
284         (): Deleted.
285         (StreamingClient::StreamingClient): Deleted.
286         (StreamingClient::~StreamingClient): Deleted.
287         (StreamingClient::createReadBuffer): Deleted.
288         (StreamingClient::handleResponseReceived): Deleted.
289         (StreamingClient::handleDataReceived): Deleted.
290         (StreamingClient::handleNotifyFinished): Deleted.
291         (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Deleted.
292         (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Deleted.
293         (ResourceHandleStreamingClient::cleanupAndStopRunLoop): Deleted.
294         (ResourceHandleStreamingClient::invalidate): Deleted.
295         (ResourceHandleStreamingClient::loadFailed): Deleted.
296         (ResourceHandleStreamingClient::setDefersLoading): Deleted.
297         (ResourceHandleStreamingClient::getOrCreateReadBuffer): Deleted.
298         (ResourceHandleStreamingClient::willSendRequest): Deleted.
299         (ResourceHandleStreamingClient::didReceiveResponse): Deleted.
300         (ResourceHandleStreamingClient::didReceiveData): Deleted.
301         (ResourceHandleStreamingClient::didReceiveBuffer): Deleted.
302         (ResourceHandleStreamingClient::didFinishLoading): Deleted.
303         (ResourceHandleStreamingClient::didFail): Deleted.
304         (ResourceHandleStreamingClient::wasBlocked): Deleted.
305         (ResourceHandleStreamingClient::cannotShowURL): Deleted.
306
307 2017-07-26  Brian Burg  <bburg@apple.com>
308
309         Remove WEB_TIMING feature flag
310         https://bugs.webkit.org/show_bug.cgi?id=174795
311
312         Reviewed by Alex Christensen.
313
314         * Configurations/FeatureDefines.xcconfig:
315         * bindings/js/JSPerformanceEntryCustom.cpp:
316         * dom/Document.cpp:
317         (WebCore::Document::setReadyState):
318         (WebCore::Document::finishedParsing):
319         * dom/Document.h:
320         (WebCore::Document::timing):
321         * dom/DocumentTiming.h:
322         * dom/EventTargetFactory.in:
323         * loader/DocumentThreadableLoader.cpp:
324         (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
325         (WebCore::DocumentThreadableLoader::loadRequest):
326         * loader/DocumentThreadableLoader.h:
327         * loader/ResourceTimingInformation.cpp:
328         * loader/ResourceTimingInformation.h:
329         * loader/SubresourceLoader.cpp:
330         (WebCore::SubresourceLoader::didFinishLoading):
331         (WebCore::SubresourceLoader::reportResourceTiming):
332         * loader/SubresourceLoader.h:
333         * loader/ThreadableLoaderClient.h:
334         (WebCore::ThreadableLoaderClient::didFail):
335         (WebCore::ThreadableLoaderClient::didFinishTiming):
336         * loader/WorkerThreadableLoader.cpp:
337         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
338         * loader/WorkerThreadableLoader.h:
339         * loader/cache/CachedResourceLoader.cpp:
340         (WebCore::CachedResourceLoader::requestResource):
341         (WebCore::CachedResourceLoader::revalidateResource):
342         (WebCore::CachedResourceLoader::loadResource):
343         * loader/cache/CachedResourceLoader.h:
344         (WebCore::CachedResourceLoader::resourceTimingInformation):
345         * page/DOMWindow.cpp:
346         (WebCore::DOMWindow::~DOMWindow):
347         (WebCore::DOMWindow::resetDOMWindowProperties):
348         (WebCore::DOMWindow::nowTimestamp):
349         (WebCore::DOMWindow::removeAllEventListeners):
350         * page/DOMWindow.h:
351         * page/GlobalPerformance.idl:
352         * page/Performance.cpp:
353         * page/Performance.h:
354         * page/Performance.idl:
355         * page/PerformanceEntry.cpp:
356         * page/PerformanceEntry.h:
357         * page/PerformanceEntry.idl:
358         * page/PerformanceMark.h:
359         * page/PerformanceMark.idl:
360         * page/PerformanceMeasure.h:
361         * page/PerformanceMeasure.idl:
362         * page/PerformanceNavigation.cpp:
363         * page/PerformanceNavigation.h:
364         * page/PerformanceNavigation.idl:
365         * page/PerformanceObserver.cpp:
366         * page/PerformanceObserver.h:
367         * page/PerformanceObserver.idl:
368         * page/PerformanceObserverCallback.h:
369         * page/PerformanceObserverCallback.idl:
370         * page/PerformanceObserverEntryList.cpp:
371         * page/PerformanceObserverEntryList.h:
372         * page/PerformanceObserverEntryList.idl:
373         * page/PerformanceResourceTiming.cpp:
374         * page/PerformanceResourceTiming.h:
375         * page/PerformanceResourceTiming.idl:
376         * page/PerformanceTiming.cpp:
377         * page/PerformanceTiming.h:
378         * page/PerformanceTiming.idl:
379         * page/PerformanceUserTiming.cpp:
380         * page/PerformanceUserTiming.h:
381         * platform/network/ResourceHandle.h:
382         * platform/network/ResourceHandleInternal.h:
383         * platform/network/cf/ResourceHandleCFNet.cpp:
384         (WebCore::ResourceHandle::start):
385         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
386         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
387         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
388         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
389         * platform/network/curl/ResourceHandleCurl.cpp:
390         (WebCore::ResourceHandleInternal::didFinish):
391         (WebCore::ResourceHandleInternal::calculateWebTimingInformations):
392         (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
393         * platform/network/mac/ResourceHandleMac.mm:
394         (WebCore::ResourceHandle::createNSURLConnection):
395         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
396         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
397         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
398         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
399         * platform/network/soup/ResourceHandleSoup.cpp:
400         (WebCore::restartedCallback):
401         (WebCore::sendRequestCallback):
402         (WebCore::createSoupMessageForHandleAndRequest):
403         (WebCore::ResourceHandle::sendPendingRequest):
404         * platform/network/soup/SoupNetworkSession.cpp:
405         (WebCore::SoupNetworkSession::SoupNetworkSession):
406         * workers/WorkerGlobalScope.cpp:
407         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
408         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
409         (WebCore::WorkerGlobalScope::removeAllEventListeners):
410         * workers/WorkerGlobalScope.h:
411
412 2017-07-26  Chris Dumez  <cdumez@apple.com>
413
414         Pressing the Escape key should not be a valid user gesture to enter fullscreen
415         https://bugs.webkit.org/show_bug.cgi?id=174864
416         <rdar://problem/33009088>
417
418         Reviewed by Geoffrey Garen.
419
420         Pressing the Escape key should not be a valid user gesture to enter fullscreen since this
421         is the gesture to exit fullscreen already.
422
423         Test: fullscreen/requestFullscreen-escape-key.html
424
425         * dom/Document.cpp:
426         (WebCore::Document::requestFullScreenForElement):
427         * dom/UserGestureIndicator.cpp:
428         (WebCore::UserGestureIndicator::UserGestureIndicator):
429         * dom/UserGestureIndicator.h:
430         (WebCore::UserGestureToken::create):
431         (WebCore::UserGestureToken::gestureType):
432         (WebCore::UserGestureToken::UserGestureToken):
433         * page/EventHandler.cpp:
434         (WebCore::EventHandler::internalKeyEvent):
435
436 2017-07-26  Nan Wang  <n_wang@apple.com>
437
438         AX: Incorrect range from index and length in contenteditable with <p> tags
439         https://bugs.webkit.org/show_bug.cgi?id=174856
440
441         Reviewed by Chris Fleizach.
442
443         When asking for the string inside a text control with a given range, we sometimes get
444         a wrong string at the line boundary due to a bad plain range to text marker conversion.
445         To fix this, we should use the exsisting method on text controls to avoid this issue. 
446
447         Updated the test to test the problematic case.
448
449         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
450         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
451
452 2017-07-26  Daewoong Jang  <daewoong.jang@navercorp.com>
453
454         [Curl] Bug fix after r219606
455         https://bugs.webkit.org/show_bug.cgi?id=174845
456
457         Reviewed by Alex Christensen.
458
459         * platform/network/curl/CurlContext.h:
460         (WebCore::CurlSList::isEmpty):
461         * platform/network/curl/ResourceHandleCurl.cpp:
462         (WebCore::ResourceHandleInternal::didReceiveHeaderLine):
463         (WebCore::ResourceHandleInternal::headerCallback):
464
465 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
466
467         [EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
468         https://bugs.webkit.org/show_bug.cgi?id=174779
469
470         Reviewed by Xabier Rodriguez-Calvar.
471
472         In the CENC decryptor, the key ID value is retrieved from the info structure
473         on the GstProtectionMeta object. GstBuffer for that value is retrieved and
474         passed to the setupCipher() function.
475
476         In the ClearKey decryptor (which extends the CENC decryptor), the single
477         GstBuffer object on the private instance that holds the key value is replaced
478         with a Vector object that holds pairs of key ID and value GstBuffers. In the
479         handleKeyResponse() implementation that Vector is emptied and then refilled
480         with key ID and value pairs that are passed in through the drm-cipher-clearkey
481         structure that's attached to the GstEvent that signalled new key information.
482
483         In the ClearKey decryptor's setupCipher() implementation the passed-in key ID
484         buffer is used to find a matching key ID and value pair stored on the private
485         instance. If not found, an error is thrown. If found, the matching key value
486         is used for decryption.
487
488         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
489         (webKitMediaClearKeyDecryptorHandleKeyResponse):
490         (webKitMediaClearKeyDecryptorSetupCipher):
491         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
492         (webkitMediaCommonEncryptionDecryptTransformInPlace):
493         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
494         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
495
496 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
497
498         [EME][GStreamer] Handle ClearKey as a supported key system
499         https://bugs.webkit.org/show_bug.cgi?id=174778
500
501         Reviewed by Xabier Rodriguez-Calvar.
502
503         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
504         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
505         Return true for the 'org.w3.clearkey' key system when building with
506         ENCRYPTED_MEDIA enabled. The underlying implementation will follow.
507
508 2017-07-26  Claudio Saavedra  <csaavedra@igalia.com>
509
510         [WPE] Fix a potential crash in the platform pasteboard when reading a string
511         https://bugs.webkit.org/show_bug.cgi?id=174859
512
513         Reviewed by Žan Doberšek.
514
515         We shouldn't assume that the wpe_pasteboard_string struct will be
516         filled in, so initialize it.
517
518         * platform/wpe/PlatformPasteboardWPE.cpp:
519         (WebCore::PlatformPasteboard::readString): Initialize the struct
520         before passing it to wpe and early return if it's still empty.
521
522 2017-07-26  Javier Fernandez  <jfernandez@igalia.com>
523
524         InsertOrderedList command applied to table cells inserts an extra BR before the table
525         https://bugs.webkit.org/show_bug.cgi?id=174593
526
527         Reviewed by Darin Adler.
528
529         Don't add BR when pruning empty blocks if it's the start of a paragraph.
530
531         The function MoveParagraph is used for several operations and editing
532         commands, like 'insertOrderedList'. When moving paragraphs we check out
533         whether we should add a 'br' element to avoid undesired block collapse.
534
535         However, we shouldn't do this when destination is the start of a
536         paragraph.
537
538         Tests: editing/inserting/insert-list-in-table-cell-01.html
539                editing/inserting/insert-list-in-table-cell-02.html
540                editing/inserting/insert-list-in-table-cell-03.html
541                editing/inserting/insert-list-in-table-cell-04.html
542                editing/inserting/insert-list-in-table-cell-05.html
543                editing/inserting/insert-list-in-table-cell-06.html
544                editing/inserting/insert-list-in-table-cell-07.html
545                editing/inserting/insert-list-in-table-cell-08.html
546
547         * editing/CompositeEditCommand.cpp:
548         (WebCore::CompositeEditCommand::moveParagraphs):
549
550 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
551
552         [WPE] WebGL2 support
553         https://bugs.webkit.org/show_bug.cgi?id=174249
554
555         Reviewed by Alex Christensen.
556
557         Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep
558         the implementation specific to libepoxy (which WPE leverages by default).
559
560         In the GraphicsContext3D::create() method, we first construct the
561         GraphicsContext3D object that also ensures a current GL context on this thread.
562         Only then can we determine through libepoxy whether the underlying GL library
563         is able to support WebGL2.
564
565         For WebGL2, the GLES3 support is required. The initial libepoxy implementation
566         ensures this only in case of 'non-desktop GL' library of minimum version 3.0.
567         This effectively translates to the only supported configuration being the
568         EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we
569         discard the existing GraphicsContext3D object and return null.
570
571         WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't
572         been tested yet. Implementation will in the future be extended to support that
573         as required.
574
575         In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor
576         has to now receive the second argument, the desired shader specification that's
577         used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1,
578         and SH_WEBGL2_SPEC for WebGL2.
579
580         No new tests -- a small set of existing WebGL2 tests is unskipped and passing.
581
582         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
583         (WebCore::GraphicsContext3D::create):
584         (WebCore::GraphicsContext3D::GraphicsContext3D):
585         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
586         Add WebGL2-specific methods to the build.
587
588 2017-07-26  Nan Wang  <n_wang@apple.com>
589
590         AX: should dispatch accessibilityPerformPressAction async on MacOS
591         https://bugs.webkit.org/show_bug.cgi?id=174849
592
593         Reviewed by Chris Fleizach.
594
595         If performing the accessibility press action results in a modal alert being displayed,
596         it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously.
597
598         Updated tests to adapt to this change.
599
600         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
601         (-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]):
602         (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
603
604 2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
605
606         Icon loader error on startup
607         https://bugs.webkit.org/show_bug.cgi?id=174787
608
609         Reviewed by Brady Eidson.
610
611         This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about
612         pages. IconController::startLoader() did several checks before starting the load that
613         DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have
614         an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the
615         same checks now before starting to load icons.
616
617         * loader/DocumentLoader.cpp:
618         (WebCore::DocumentLoader::startIconLoading):
619
620 2017-07-25  Sam Weinig  <sam@webkit.org>
621
622         [WebIDL] Remove custom bindings for HTMLCanvasElement
623         https://bugs.webkit.org/show_bug.cgi?id=174847
624
625         Reviewed by Darin Adler.
626
627         * CMakeLists.txt:
628         * WebCore.xcodeproj/project.pbxproj:
629         * bindings/js/JSBindingsAllInOne.cpp:
630         * bindings/js/JSHTMLCanvasElementCustom.cpp: Removed.
631         Remove JSHTMLCanvasElementCustom.
632
633         * html/HTMLCanvasElement.cpp:
634         (WebCore::HTMLCanvasElement::getContext):
635         (WebCore::HTMLCanvasElement::getContext2d):
636         (WebCore::HTMLCanvasElement::getContextWebGL):
637         (WebCore::HTMLCanvasElement::getContextWebGPU):
638         * html/HTMLCanvasElement.h:
639         * html/HTMLCanvasElement.idl:
640         Move context picking code to HTMLCanvasElement. Give more
641         exact types to remaining context getters.
642
643 2017-07-25  Chris Dumez  <cdumez@apple.com>
644
645         Clean up ExceptionCode enumeration
646         https://bugs.webkit.org/show_bug.cgi?id=174812
647
648         Reviewed by Darin Adler.
649
650         Clean up ExceptionCode enumeration:
651         - Updated comments to reflect the latest WebIDL specification
652         - Drop special values given to some exception codes. Those legacy codes are already in the
653           table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException
654           table
655         - Drop NoException value in the enumeration and use std::optional<ExceptionCode> when needed
656           instead.
657
658         * Modules/indexeddb/shared/IDBError.cpp:
659         (WebCore::IDBError::IDBError):
660         (WebCore::IDBError::name):
661         (WebCore::IDBError::message):
662         * Modules/indexeddb/shared/IDBError.h:
663         (WebCore::IDBError::code):
664         (WebCore::IDBError::encode):
665         (WebCore::IDBError::decode):
666         * dom/DOMException.cpp:
667         * dom/ExceptionCode.h:
668         * fileapi/FileReaderSync.cpp:
669         (WebCore::errorCodeToException):
670         (WebCore::FileReaderSync::startLoading):
671         * xml/XMLHttpRequest.cpp:
672         (WebCore::XMLHttpRequest::createRequest):
673         * xml/XMLHttpRequest.h:
674
675 2017-07-25  Andy Estes  <aestes@apple.com>
676
677         [Apple Pay] Add "carteBancaire" as a supported payment network
678         https://bugs.webkit.org/show_bug.cgi?id=174841
679         <rdar://problem/31935596>
680
681         Reviewed by Alex Christensen.
682
683         Tests: http/tests/ssl/applepay/ApplePaySession.html
684                http/tests/ssl/applepay/ApplePaySessionV3.html
685
686         * Modules/applepay/PaymentRequest.cpp:
687         (WebCore::PaymentRequest::isValidSupportedNetwork):
688
689 2017-07-25  Daniel Bates  <dabates@apple.com>
690
691         Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions
692         https://bugs.webkit.org/show_bug.cgi?id=174827
693
694         Reviewed by Simon Fraser.
695
696         StyleResolver::isValid{Cue, Region}StyleProperty() access neither instance nor
697         class data. Moreover, they are private member functions and hence cannot be
698         used outside of StyleResolver's implementation. So, make these static, inline,
699         non-member functions.
700
701         * css/StyleResolver.cpp:
702         (WebCore::isValidRegionStyleProperty):
703         (WebCore::isValidCueStyleProperty):
704         (WebCore::StyleResolver::CascadedProperties::addMatch):
705         (WebCore::StyleResolver::isValidRegionStyleProperty): Deleted.
706         (WebCore::StyleResolver::isValidCueStyleProperty): Deleted.
707         * css/StyleResolver.h:
708
709 2017-07-25  Per Arne Vollan  <pvollan@apple.com>
710
711         Dragged links are blurry on 1x displays.
712         https://bugs.webkit.org/show_bug.cgi?id=174831
713         <rdar://problem/33519698>
714
715         Reviewed by Simon Fraser.
716
717         When the width and height of the drag image is a multiple of 2, the drag image is not blurry
718         on a 1x display. This is a workaround which should be removed when <rdar://problem/33059739>
719         is fixed.
720
721         No new tests, since this is not straightforward to test with a layout test.
722
723         * platform/mac/DragImageMac.mm:
724         (WebCore::LinkImageLayout::LinkImageLayout):
725
726 2017-07-25  Matt Baker  <mattbaker@apple.com>
727
728         Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation
729         https://bugs.webkit.org/show_bug.cgi?id=174738
730
731         Reviewed by Brian Burg.
732
733         Relocate AsyncCallType from InspectorInstrumentation to the debugger
734         agent. Plumbing for `requestAnimationFrame` notifications has been added
735         to PageDebuggerAgent, which is responsible for managing async stack traces. 
736
737         * dom/ScriptedAnimationController.cpp:
738         (WebCore::ScriptedAnimationController::registerCallback):
739         (WebCore::ScriptedAnimationController::cancelCallback):
740         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
741
742         * inspector/InspectorInstrumentation.cpp:
743         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
744         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
745         (WebCore::InspectorInstrumentation::willFireTimerImpl):
746         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
747         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
748         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
749         (): Deleted.
750         (WebCore::didScheduleAsyncCall): Deleted.
751
752         * inspector/InspectorInstrumentation.h:
753         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
754         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
755         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
756         Replaced Frame and Document pointers with references and moved
757         pointer validation upstream.
758
759         * inspector/PageDebuggerAgent.cpp:
760         (WebCore::PageDebuggerAgent::didRequestAnimationFrame):
761         (WebCore::PageDebuggerAgent::willFireAnimationFrame):
762         (WebCore::PageDebuggerAgent::didCancelAnimationFrame):
763         * inspector/PageDebuggerAgent.h:
764
765 2017-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
766
767         Async image decoding for large images should be disabled after the first time a tile is painted
768         https://bugs.webkit.org/show_bug.cgi?id=174451
769         <rdar://problem/31246421>
770
771         Reviewed by Simon Fraser.
772
773         Flashing because of DOM mutation can be fixed by disabling the asynchronous
774         image decoding after the first time a tile was painted.
775
776         We can detect this by consulting the tile repaintCount. If it is zero, then
777         it is safe to use asynchronous image decoded. If the tile repaintCount is
778         greater than zero, we are not sure if the renderer rectangle has an image
779         drawn in it already or not. In this case we have to use the synchronous
780         image decoding to avoid causing a flash.
781
782         Tests: fast/images/async-image-background-change.html
783                fast/images/async-image-src-change.html
784                http/tests/multipart/multipart-async-image.html
785
786         * html/shadow/MediaControlElements.cpp:
787         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
788         * page/FrameView.cpp:
789         (WebCore::FrameView::willPaintContents):
790         (WebCore::FrameView::paintContentsForSnapshot):
791         * page/PageOverlayController.cpp:
792         (WebCore::PageOverlayController::paintContents):
793         * page/PageOverlayController.h:
794         * page/linux/ResourceUsageOverlayLinux.cpp:
795         * page/mac/ServicesOverlayController.h:
796         * page/mac/ServicesOverlayController.mm:
797         (WebCore::ServicesOverlayController::Highlight::paintContents):
798         * platform/graphics/BitmapImage.cpp:
799         (WebCore::BitmapImage::draw):
800         * platform/graphics/BitmapImage.h:
801         * platform/graphics/GraphicsLayer.cpp:
802         (WebCore::GraphicsLayer::paintGraphicsLayerContents):
803         * platform/graphics/GraphicsLayer.h:
804         * platform/graphics/GraphicsLayerClient.h:
805         (WebCore::GraphicsLayerClient::paintContents):
806         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
807         (WebCore::LayerClient::platformCALayerPaintContents):
808         * platform/graphics/ca/GraphicsLayerCA.cpp:
809         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
810         * platform/graphics/ca/GraphicsLayerCA.h:
811         * platform/graphics/ca/PlatformCALayer.h:
812         * platform/graphics/ca/PlatformCALayerClient.h:
813         (WebCore::PlatformCALayerClient::platformCALayerRepaintCount):
814         * platform/graphics/ca/TileCoverageMap.cpp:
815         (WebCore::TileCoverageMap::platformCALayerPaintContents):
816         * platform/graphics/ca/TileCoverageMap.h:
817         * platform/graphics/ca/TileGrid.cpp:
818         (WebCore::TileGrid::platformCALayerPaintContents):
819         (WebCore::TileGrid::platformCALayerRepaintCount):
820         * platform/graphics/ca/TileGrid.h:
821         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
822         (PlatformCALayer::drawLayerContents):
823         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
824         (PlatformCALayer::drawLayerContents):
825         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
826         (PlatformCALayerWinInternal::displayCallback):
827         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
828         (WebTiledBackingLayerWin::displayCallback):
829         * platform/graphics/mac/WebLayer.mm:
830         (-[WebLayer drawInContext:]):
831         (-[WebSimpleLayer drawInContext:]):
832         * rendering/PaintPhase.h:
833         * rendering/RenderBoxModelObject.cpp:
834         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
835         * rendering/RenderElement.h:
836         * rendering/RenderLayer.cpp:
837         (WebCore::RenderLayer::paintLayerContents):
838         (WebCore::RenderLayer::paintForegroundForFragments):
839         * rendering/RenderLayerBacking.cpp:
840         (WebCore::RenderLayerBacking::paintContents):
841         * rendering/RenderLayerBacking.h:
842         * rendering/RenderLayerCompositor.cpp:
843         (WebCore::RenderLayerCompositor::paintContents):
844         * rendering/RenderLayerCompositor.h:
845         * rendering/RenderWidget.cpp:
846         (WebCore::RenderWidget::paintContents):
847         * testing/Internals.cpp:
848         (WebCore::imageFromImageElement):
849         (WebCore::bitmapImageFromImageElement):
850         (WebCore::Internals::imageFrameIndex):
851         (WebCore::Internals::setImageFrameDecodingDuration):
852         (WebCore::Internals::resetImageAnimation):
853         (WebCore::Internals::isImageAnimating):
854         (WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
855         (WebCore::Internals::imageDecodeCount):
856         (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting):
857         * testing/Internals.h:
858         * testing/Internals.idl:
859
860 2017-07-23  Sam Weinig  <sam@webkit.org>
861
862         [WebIDL] Add support for generating timer bindings
863         https://bugs.webkit.org/show_bug.cgi?id=174766
864
865         Reviewed by Darin Adler.
866
867         Adds a new non-standard type, ScheduledAction, which stands in for the
868         standard (DOMString or Function). It would be good to move to that in
869         future, but for now, this allows for forward momentum on removing custom
870         bindings.
871
872         * WebCore.xcodeproj/project.pbxproj:
873         Add JSDOMConvertScheduledAction.h.
874
875         * bindings/IDLTypes.h:
876         Add IDLScheduledAction.
877
878         * bindings/js/JSDOMConvertScheduledAction.h: Added.
879         (WebCore::Converter<IDLScheduledAction>::convert):
880         Add conversion from JSValue -> ScheduledAction. This is moved from the old ScheduledAction
881         create function.
882
883         * bindings/js/JSDOMConvertVariadic.h:
884         (WebCore::convertVariadicArguments):
885         (WebCore::Detail::VariadicConverterBase::convert): Deleted.
886         (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert): Deleted.
887         * bindings/js/JSDOMConvertBase.h:
888         * bindings/js/JSDOMConvertAny.h:
889         (WebCore::VariadicConverter<IDLAny>::convert):
890         * bindings/js/JSDOMConvertInterface.h:
891         (WebCore::VariadicConverter<IDLInterface<T>>::convert):
892         Rename VariadicConverter to VariadicConverterDetails, and remove base class. Rename 
893         VariadicConverterBase to VariadicConverter, and move specializations to the file
894         containing the base converter for that IDL type 
895
896         * bindings/js/JSDOMWindowCustom.cpp:
897         (WebCore::JSDOMWindow::setTimeout): Deleted.
898         (WebCore::JSDOMWindow::setInterval): Deleted.
899         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
900         (WebCore::JSWorkerGlobalScope::setTimeout): Deleted.
901         (WebCore::JSWorkerGlobalScope::setInterval): Deleted.
902         Remove custom implementations of setTimeout and setInterval.
903
904         * bindings/js/ScheduledAction.cpp:
905         (WebCore::ScheduledAction::create):
906         (WebCore::ScheduledAction::ScheduledAction):
907         (WebCore::ScheduledAction::~ScheduledAction):
908         (WebCore::ScheduledAction::addArguments):
909         (WebCore::ScheduledAction::executeFunctionInContext):
910         * bindings/js/ScheduledAction.h:
911         (WebCore::ScheduledAction::ScheduledAction): Deleted.
912         Rework ScheduledAction. Now has two create functions, one for the function
913         form, one for the string form. These are now called by the Converter. Also,
914         rather than extracting the arguments directly from the ExecState, allow the
915         bindings to work as designed, and have the arguments come in as variadic 
916         arguments to setTimeout/setInterval and get added to the ScheduledAction if
917         needed. Also, move ContentSecurityPolicy check out of construction, and into
918         setTimeout/setInterval.
919
920         * bindings/scripts/CodeGenerator.pm:
921         (IsBuiltinType):
922         Add ScheduledAction to the builtin list.
923
924         * bindings/scripts/CodeGeneratorJS.pm:
925         (AddToIncludesForIDLType):
926         Add the correct include when ScheduledAction is used.
927
928         (GenerateParametersCheck):
929         Remove rule disallowing optional arguments before variadic arguments. That works
930         just fine.
931
932         (GetBaseIDLType):
933         Add mapping of ScheduledAction -> IDLScheduledAction.
934
935         (JSValueToNativeDOMConvertNeedsGlobalObject):
936         Add ScheduledAction to the list of types that need a global object
937         for conversion.
938
939         * page/WindowOrWorkerGlobalScope.idl:
940         Update interface to match spec and add FIXMEs for moving to TimerHandler.
941
942         * page/DOMWindow.cpp:
943         (WebCore::DOMWindow::setTimeout):
944         (WebCore::DOMWindow::setInterval):
945         * page/DOMWindow.h:
946         * workers/WorkerGlobalScope.cpp:
947         (WebCore::WorkerGlobalScope::setTimeout):
948         (WebCore::WorkerGlobalScope::setInterval):
949         * workers/WorkerGlobalScope.h:
950         Update for new signatures. WorkerGlobalScope now has to return ExceptionOr<int>
951         even though it never throws, due to having one IDL file defining these. This is 
952         unfortunate and something we should look at addressing the future.
953
954 2017-07-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
955
956         [WinCairo] Fix build with AllInOnes disabled
957         https://bugs.webkit.org/show_bug.cgi?id=174784
958         <rdar://problem/33488914>
959
960         Reviewed by Alex Christensen.
961
962         * PlatformWin.cmake:
963         Add RenderThemeWin.cpp to WebCore_SOURCES
964
965         * rendering/RenderingAllInOne.cpp:
966         Remove #include "RenderThemeWin.cpp"
967
968         * testing/MemoryInfo.h:
969         Remove #include "JSDomWindow.h"
970
971         * bindings/js/JSDOMGlobalObject.cpp:
972         * bindings/js/JSDOMPromiseDeferred.cpp:
973         * bindings/js/JSDOMWrapper.cpp:
974         * bindings/js/JSImageDataCustom.cpp:
975         * bindings/scripts/CodeGeneratorJS.pm:
976         (GenerateCallWith):
977         * dom/ScriptExecutionContext.cpp:
978         * inspector/InspectorController.cpp:
979         * inspector/InspectorTimelineAgent.cpp:
980         * rendering/RenderMediaControls.cpp:
981         * rendering/RenderMediaControls.h:
982         * rendering/RenderThemeWin.cpp:
983
984         * bindings/scripts/test/JS/JSTestObj.cpp:
985         Update test results.
986
987 2017-07-25  Konstantin Tokarev  <annulen@yandex.ru>
988
989         Unreviewed, fix Mac CMake build after r219567
990
991         * PlatformMac.cmake:
992
993 2017-07-23  Darin Adler  <darin@apple.com>
994
995         More NeverDestroyed and related cleanup
996         https://bugs.webkit.org/show_bug.cgi?id=174745
997
998         Reviewed by Alex Christensen.
999
1000         * bindings/js/JSCustomElementInterface.cpp:
1001         (WebCore::JSCustomElementInterface::constructElementWithFallback):
1002         Use isNull() rather than comparing against nullAtom() since it's
1003         slightly more efficient.
1004
1005         * css/MediaQueryEvaluator.cpp:
1006         (WebCore::prefersReducedMotionEvaluate): Use a switch statement for the
1007         three states of forcedPrefersReducedMotionAccessibilityValue. Also update
1008         to use Theme::singleton() instead of platformTheme().
1009
1010         * dom/QualifiedName.h: Removed some unneeded includes, minor style tweaks,
1011         and use isNull() rather than comparing against nullAtom() since it's
1012         slightly more efficient.
1013
1014         * html/Autofill.cpp:
1015         (WebCore::AutofillData::createFromHTMLFormControlElement): Use isNull()
1016         rather than comparing against nullAtom() since it's slightly more efficient.
1017
1018         * html/HTMLDocument.cpp:
1019         (WebCore::addLocalNameToSet): Deleted.
1020         (WebCore::createHtmlCaseInsensitiveAttributesSet): Deleted.
1021         (WebCore::HTMLDocument::isCaseSensitiveAttribute): Moved the case-sensitive
1022         attribute set in here and made it use makeNeverDestroyed.
1023
1024         * html/HTMLNameCollection.cpp:
1025         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
1026         Formatted vertically and sorted so it's easier to see what it does.
1027         (WebCore::WindowNameCollection::elementMatches): Use boolean logic instead
1028         of multiple return statements to make this a little more straightforward.
1029         (WebCore::isObjectElementForDocumentNameCollection): Added. Calls the new
1030         isExposed function. The old code called this isDocNamedItem.
1031         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
1032         Use isObjectElementForDocumentNameCollection to clean up logic. Also
1033         sorted classes.
1034         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
1035         Use isObjectElementForDocumentNameCollection to clean up logic. Also
1036         sorted classes and formatted vertically.
1037         (WebCore::DocumentNameCollection::elementMatches): Write in terms of
1038         above functions for clarity. Efficiency is roughly the same.
1039
1040         * html/HTMLObjectElement.cpp:
1041         (WebCore::HTMLObjectElement::HTMLObjectElement): Initialize data members
1042         in class definition instead of here.
1043         (WebCore::HTMLObjectElement::childrenChanged): Update for name change;
1044         function is now called updateExposedState rather than updateDocNamedItem.
1045         Also use m_useFallbackContent directly instead of through a function.
1046         (WebCore::HTMLObjectElement::renderFallbackContent): Ditto.
1047         (WebCore::preventsParentObjectFromExposure): Added. Replaces the old
1048         isRecognizedTagName function, and does almost the same thing, but the
1049         argument type is different and the param tag is now one of the tags
1050         exempted here. Also broke up into two overloads so we can handle the
1051         Element, Text, and other Node cases.
1052         (WebCore::shouldBeExposed): Added. Helper for the updateExposedState
1053         function that handles the logic of when the element should be exposed,
1054         separating it from what to do when the state changes.
1055         (WebCore::HTMLObjectElement::updateExposedState): Renamed from
1056         updateDocNamedItem.
1057
1058         * html/HTMLObjectElement.h: Renamed isDocNamedItem -> isExposed,
1059         m_docNamedItem -> m_isExposed, updateDocNamedItem -> updateExposedState,
1060         stopped using bit fields for the two boolean data members, and
1061         initialized those data members here in the class definition.
1062
1063         * platform/Theme.cpp:
1064         (WebCore::Theme::baselinePositionAdjustment): Moved here from header.
1065         (WebCore::Theme::controlFont): Ditto.
1066         (WebCore::Theme::controlSize): Ditto.
1067         (WebCore::Theme::minimumControlSize): Ditto.
1068         (WebCore::Theme::controlRequiresPreWhiteSpace): Ditto.
1069         (WebCore::Theme::paint): Ditto.
1070         (WebCore::Theme::inflateControlPaintRect): Ditto.
1071         (WebCore::Theme::userPrefersReducedMotion): Ditto.
1072         (WebCore::Theme::controlBorder): Fixed switch statement indentation.
1073         (WebCore::Theme::controlPadding): Ditto.
1074
1075         * platform/Theme.h: Removed the many unnecessary includes. The one
1076         I was really after here was FontCascade.h. Replaced the platformTheme
1077         function with a singleton function, following our normal style. Also
1078         changed the return type to a reference rather than a pointer.
1079         Removed many unused function and data members.
1080
1081         * platform/cocoa/ThemeCocoa.h: Tightened up implementation, removing
1082         unnecessary members and making overrides private.
1083         * platform/cocoa/ThemeCocoa.mm: Moved include in here.
1084
1085         * platform/gamepad/glib/GamepadsGlib.cpp:
1086         (WebCore::sampleGamepads): Use NeverDestroyed instead of
1087         DEPRECATED_DEFINE_STATIC_LOCAL.
1088
1089         * platform/graphics/FontCascade.cpp:
1090         (WebCore::useBackslashAsYenSignForFamily): Build the set in a cleaner
1091         way and use a NeverDestroyed set instead of a heap-allocated one.
1092         (WebCore::FontCascade::FontCascade): Moved initialization of data members
1093         to the class definition.
1094
1095         * platform/graphics/FontCascade.h: Initialize GlyphOverflow and
1096         FonstCascade data members in the class definition. Remove the constructor
1097         for GlyphOverflow entirely. Added FIXME about the peculiar != operator we
1098         defined for GlyphOverflow.
1099
1100         * platform/graphics/NamedImageGeneratedImage.cpp:
1101         (WebCore::NamedImageGeneratedImage::draw): Use Theme::singleton() instead
1102         of platformTheme().
1103         (WebCore::NamedImageGeneratedImage::drawPattern): Ditto.
1104
1105         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1106         (WebCore::CMTimeRangeStartKey): Use CFSTR directly instead of using
1107         DEPRECATED_DEFINE_STATIC_LOCAL.
1108         (WebCore::CMTimeRangeDurationKey): Ditto.
1109         (WebCore::CACFContextNeedsFlushNotification): Ditto.
1110
1111         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
1112         (WebCore::LayerChangesFlusher::singleton): Use NeverDestroyed instead of
1113         DEPRECATED_DEFINE_STATIC_LOCAL.
1114         * platform/graphics/ca/win/LayerChangesFlusher.h: Ditto.
1115
1116         * platform/graphics/cg/ImageSourceCGWin.cpp:
1117         (WebCore::preferredExtensionForImageSourceType): Use HashMap constructor
1118         instead of writing out a lot of add calls.
1119
1120         * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
1121         (WebCore::harfBuzzFaceCache): Use NeverDestroyed instead of
1122         DEPRECATED_DEFINE_STATIC_LOCAL.
1123         * platform/graphics/win/FontCacheWin.cpp:
1124         (WebCore::FontCache::lastResortFallbackFont): Ditto.
1125
1126         * platform/ios/ThemeIOS.h: Tightened up implementation, removing
1127         unnecessary members and making overrides private.
1128         * platform/ios/ThemeIOS.mm:
1129         (WebCore::Theme::singleton): Renamed from platformTheme.
1130
1131         * platform/mac/ThemeMac.h: Tightened up implementation, removing
1132         unnecessary members and making overrides private. Removed unneeded
1133         WTF_MAKE_FAST_ALLOCATED since this is never allocated on the heap.
1134         Removed unused -[NSFont webCoreFamilyName] method.
1135         * platform/mac/ThemeMac.mm:
1136         (-[NSFont webCoreFamilyName]): Deleted.
1137         (WebCore::Theme::singleton): Renamed from platformTheme.
1138
1139         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1140         Removed unneeded include of FontCascade.h.
1141         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1142         Ditto.
1143         * platform/mock/MockRealtimeAudioSource.h: Ditto.
1144
1145         * platform/network/win/DownloadBundleWin.cpp:
1146         (WebCore::DownloadBundle::fileExtension): Use NeverDestroyed
1147         instead of DEPRECATED_DEFINE_STATIC_LOCAL.
1148
1149         * platform/win/ClipboardUtilitiesWin.cpp:
1150         (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use
1151         appendLiteral instead of DEPRECATED_DEFINE_STATIC_LOCAL.
1152
1153         * platform/win/FileSystemWin.cpp:
1154         (WebCore::bundleName): Use NeverDestroyed instead of
1155         DEPRECATED_DEFINE_STATIC_LOCAL, and used a lambda to initialize
1156         rather than a boolean to control one-time code.
1157         (WebCore::storageDirectory): Removed unneeded use of
1158         DEPRECATED_DEFINE_STATIC_LOCAL for a prefix we are appending to
1159         a String. The + operator can handle a literal just as efficiently
1160         without first storing it in a String.
1161
1162         * platform/wpe/ThemeWPE.cpp:
1163         (WebCore::Theme::singleton): Renamed from platformTheme.
1164         * platform/wpe/ThemeWPE.h: Tightened up implementation, removing
1165         unnecessary members and making overrides private.
1166
1167         * rendering/RenderTheme.cpp:
1168         (WebCore::RenderTheme::RenderTheme): No need to initialize m_theme.
1169         (WebCore::RenderTheme::adjustStyle): Use Theme::singleton() instead
1170         of accessing it through m_theme.
1171         (WebCore::RenderTheme::paint): Ditto.
1172         (WebCore::RenderTheme::baselinePosition): Ditto.
1173         (WebCore::RenderTheme::adjustRepaintRect): Ditto.
1174         (WebCore::RenderTheme::setCustomFocusRingColor): Ditto.
1175         (WebCore::RenderTheme::platformTapHighlightColor): Ditto.
1176
1177         * rendering/RenderTheme.h: Removed unneded m_theme and unneeded
1178         inclusion of Theme.h.
1179
1180         * rendering/line/LineBreaker.h: Removed unneeded include of
1181         FontCascade.h.
1182
1183 2017-07-24  Chris Dumez  <cdumez@apple.com>
1184
1185         ExceptionCode enumeration should use modern exception names
1186         https://bugs.webkit.org/show_bug.cgi?id=174794
1187
1188         Reviewed by Geoffrey Garen.
1189
1190         ExceptionCode enumeration should use modern exception names consistently.
1191         This makes the code nicer and closer to the text of the specification.
1192
1193 2017-07-24  Andy Estes  <aestes@apple.com>
1194
1195         Consider implementing W3C Payment Request API
1196         https://bugs.webkit.org/show_bug.cgi?id=174796
1197
1198         Reviewed by Daniel Bates.
1199
1200         Add Payment Request to features.json as "Under Consideration".
1201
1202         * features.json:
1203
1204 2017-07-24  Konstantin Tokarev  <annulen@yandex.ru>
1205
1206         Unreviewed attempt to fix Mac cmake build
1207
1208         * PlatformMac.cmake:
1209
1210 2017-07-24  Chris Dumez  <cdumez@apple.com>
1211
1212         Make ExceptionCode a proper enumeration
1213         https://bugs.webkit.org/show_bug.cgi?id=174771
1214
1215         Reviewed by Sam Weinig.
1216
1217         Make ExceptionCode a proper enumeration instead of a typedef to uint8_t.
1218
1219         * Modules/fetch/FetchBody.h:
1220         (WebCore::FetchBody::formData):
1221         * Modules/indexeddb/shared/IDBError.h:
1222         (WebCore::IDBError::encode):
1223         (WebCore::IDBError::decode):
1224         * bindings/js/JSSubtleCryptoCustom.cpp:
1225         (WebCore::rejectWithException):
1226         * dom/Exception.h:
1227         * dom/ExceptionCode.h:
1228         * fileapi/FileReaderSync.cpp:
1229         (WebCore::errorCodeToExceptionCode):
1230         * html/canvas/WebGLRenderingContextBase.cpp:
1231         (WebCore::WebGLRenderingContextBase::texSubImage2D):
1232         (WebCore::WebGLRenderingContextBase::texImage2D):
1233         * xml/XMLHttpRequest.cpp:
1234         (WebCore::XMLHttpRequest::createRequest):
1235         * xml/XMLHttpRequest.h:
1236
1237 2017-07-24  Simon Fraser  <simon.fraser@apple.com>
1238
1239         Change "client" coordinates back to match scrolling coordinates
1240         https://bugs.webkit.org/show_bug.cgi?id=174734
1241         rdar://problem/33336930
1242
1243         Reviewed by Tim Horton.
1244
1245         Baidu.com (which uses jQuery), and various iOS apps make the assumption that getBoundingClientRect() returns a rectangle
1246         that can be used to set or compare with the scroll position. With visual viewports, that assumption is no longer valid
1247         when the page is zoomed, or when the keyboard has caused the visual viewport to detach from the layout viewport.
1248
1249         At this point the compatibility cost of shipping layout viewport-based client rects seems higher than the gain, so revert
1250         to the shipping behavior. This reverts r216803, and will re-introduce bugs that occurred on zoomed pages on macOS,
1251         many of which are noted in webkit.org/b/170981.
1252
1253         * page/FrameView.cpp:
1254         (WebCore::FrameView::documentToClientOffset):
1255
1256 2017-07-24  Zan Dobersek  <zdobersek@igalia.com>
1257
1258         [WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h
1259         https://bugs.webkit.org/show_bug.cgi?id=174780
1260
1261         Reviewed by Carlos Garcia Campos.
1262
1263         Newer versions of libepoxy provide EGL definitions that already use the EGL_CAST macro.
1264         We'd like to compile on systems where the eglplatform.h header doesn't yet provide
1265         that macro that was added only recently (e.g. it's available in Mesa 17.1, but not
1266         before).
1267
1268         To address that, the EpoxyEGL.h header is added that first includes the libepoxy's EGL
1269         header and then provides the EGL_CAST definition in case the eglplatform.h header doesn't.
1270         This header should be included in place of <epoxy/egl.h> (which is included in this new
1271         header).
1272
1273         The EpoxyEGL.h and EpoxyShims.h headers are also moved under the platform/graphics/epoxy/
1274         directory, with the new directory added to the list of inclusion paths for WPE.
1275
1276         * PlatformWPE.cmake:
1277         * platform/graphics/PlatformDisplay.cpp:
1278         * platform/graphics/cairo/CairoUtilities.cpp:
1279         * platform/graphics/cairo/ImageBufferCairo.cpp:
1280         * platform/graphics/egl/GLContextEGL.cpp:
1281         * platform/graphics/egl/GLContextEGLWPE.cpp:
1282         * platform/graphics/epoxy/EpoxyEGL.h: Added.
1283         * platform/graphics/epoxy/EpoxyShims.h: Renamed from Source/WebCore/platform/graphics/EpoxyShims.h.
1284         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
1285         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
1286
1287 2017-07-24  Zan Dobersek  <zdobersek@igalia.com>
1288
1289         [CoordinatedGraphics] Remove unused GLDefs.h header
1290         https://bugs.webkit.org/show_bug.cgi?id=174712
1291
1292         Reviewed by Michael Catanzaro.
1293
1294         * platform/graphics/opengl/GLDefs.h: Remove this unused header.
1295         As far as my recollection goes it was used in the IPC-based
1296         CoordinatedGraphics subsystem, which has been removed already.
1297
1298 2017-07-11  Frederic Wang  <fwang@igalia.com>
1299
1300         Add attribute allow-top-navigation-by-user-activation to iframe sandbox
1301         https://bugs.webkit.org/show_bug.cgi?id=171327
1302
1303         Reviewed by Chris Dumez.
1304
1305         Tests: http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html
1306                http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2.html
1307                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture-expected.txt
1308                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-3-expected.txt
1309
1310         * dom/Document.cpp:
1311         (WebCore::Document::canNavigate): Case 2 of conformance verification is refined to match the
1312         current specification: Top navigation is allowed when it is triggered by user activation and
1313         when allow-top-navigation-by-user-activation is set. Because we have additional "security
1314         origin" rules with respect to the specification we also add some early return to ensure that
1315         navigation is really allowed for this new case.
1316         * dom/SecurityContext.cpp:
1317         (WebCore::SecurityContext::isSupportedSandboxPolicy): Add allow-top-navigation-by-user-activation flag.
1318         (WebCore::SecurityContext::parseSandboxPolicy): Parse the new flag to allow top user
1319         navigation by user activation. Also, make sure that allow-top-navigation allows such
1320         navigation as defined by the specification.
1321         * dom/SecurityContext.h: Declare new sandboxing flag.
1322
1323 2017-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1324
1325         [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values
1326         https://bugs.webkit.org/show_bug.cgi?id=174769
1327         <rdar://problem/33478864>
1328
1329         Reviewed by Tim Horton.
1330
1331         These tests began failing after r219541, due to a change in behavior of whether or not we call
1332         setIgnoreSelectionChanges(false, RevealSelection::No) or setIgnoreSelectionChanges(false, RevealSelection::Yes)
1333         when performing a text editing drop.
1334
1335         Before r219541, we would not reveal the selection when performing an edit drag operation. This is because in
1336         WebPage::performDragControllerAction, we would begin ignoring selection changes by calling
1337         setIgnoreSelectionChanges(true). However, while taking a text indicator snapshot, we would stop ignoring
1338         selection in TextIndicator::createWithRange due to us calling setIgnoreSelectionChanges(false,
1339         RevealSelection::No) at the end of the function. Then, when we return to the scope of
1340         WebPage::performDragControllerAction and try to setIgnoreSelectionChanges(false), this is a no-op because we've
1341         already stopped ignoring selection changes.
1342
1343         After r219541, switching to using TemporarySelectionChange means that TextIndicator::createWithRange now means
1344         we respect whether or not we were already ignoring selection before taking the snapshot, so we won't always
1345         setIgnoreSelectionChanges(false) at the end. This means that selection changes will now be correctly ignored
1346         when performing a drag operation, but this also means that we'll try to reveal the selection, since
1347         WebPage::performDragControllerAction calls setIgnoreSelectionChanges(false), for which RevealSelection::Yes
1348         is used by default.
1349
1350         Revealing the selection in WebPage::performDragControllerAction was unintended in the first place, so we should
1351         revert to calling setIgnoreSelectionChanges(false, RevealSelection::No). To ensure this, we adopt
1352         TemporarySelectionChange here and pass only TemporarySelectionOptionIgnoreSelectionChanges, so that we won't
1353         additionally try to reveal selection after the drop. This is consistent with behavior prior to macOS 10.13 and
1354         iOS 11. Additionally, this patch also moves the call to ignore selection change from WebKit into WebCore, so
1355         that whether we ignore selection is consistent across both WebKit1 and WebKit2.
1356
1357         * page/DragController.cpp:
1358         (WebCore::DragController::performDragOperation):
1359
1360 2017-07-23  Chris Dumez  <cdumez@apple.com>
1361
1362         Drop ExceptionCodeDescription class
1363         https://bugs.webkit.org/show_bug.cgi?id=174757
1364
1365         Reviewed by Darin Adler.
1366
1367         Drop ExceptionCodeDescription class now that there is only one exception
1368         type: DOMException. Instead, we now have static methods on DOMException
1369         to get the name / message for a given exception code.
1370
1371         * CMakeLists.txt:
1372         * Modules/indexeddb/shared/IDBError.cpp:
1373         (WebCore::IDBError::name):
1374         (WebCore::IDBError::message):
1375         * Modules/quota/StorageErrorCallback.cpp:
1376         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
1377         * WebCore.xcodeproj/project.pbxproj:
1378         * bindings/js/JSDOMExceptionHandling.cpp:
1379         (WebCore::createDOMException):
1380         * dom/DOMAllInOne.cpp:
1381         * dom/DOMException.cpp:
1382         (WebCore::errorCodeFromName):
1383         (WebCore::DOMException::create):
1384         (WebCore::DOMException::DOMException):
1385         (WebCore::DOMException::name):
1386         (WebCore::DOMException::message):
1387         * dom/DOMException.h:
1388         * dom/ExceptionCodeDescription.cpp: Removed.
1389         * dom/ExceptionCodeDescription.h: Removed.
1390         * inspector/DOMEditor.cpp:
1391         (WebCore::populateErrorString):
1392         * inspector/InspectorDOMAgent.cpp:
1393         (WebCore::InspectorDOMAgent::toErrorString):
1394         * inspector/InspectorDOMStorageAgent.cpp:
1395         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
1396
1397 2017-07-22  Dan Bernstein  <mitz@apple.com>
1398
1399         Fixed building for macOS 10.12 with the macOS 10.13 SDK after r219644.
1400
1401         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1402         (WebCore::CDMSessionAVStreamSession::update): Suppress the objc-literal-conversion warning
1403           in one place where we are calling a class method on a Class and the compiler can’t tell
1404           which class it is, so it chooses wrong and emits a warning.
1405
1406 2017-07-22  Chris Dumez  <cdumez@apple.com>
1407
1408         Merge ExceptionBase into DOMException and drop custom toString
1409         https://bugs.webkit.org/show_bug.cgi?id=174755
1410
1411         Reviewed by Sam Weinig.
1412
1413         Merge ExceptionBase into DOMException and drop custom toString, now that DOMException
1414         is the only remaining exception type.
1415
1416         * CMakeLists.txt:
1417         * Modules/mediastream/MediaStream.h:
1418         * WebCore.xcodeproj/project.pbxproj:
1419         * bindings/js/JSDOMExceptionHandling.cpp:
1420         (WebCore::retrieveErrorMessage):
1421         * dom/DOMAllInOne.cpp:
1422         * dom/DOMException.cpp:
1423         (WebCore::DOMException::DOMException):
1424         (WebCore::DOMException::initializeDescription):
1425         * dom/DOMException.h:
1426         (WebCore::DOMException::code):
1427         (WebCore::DOMException::name):
1428         (WebCore::DOMException::message):
1429         * dom/ExceptionBase.cpp: Removed.
1430         * dom/ExceptionBase.h: Removed.
1431
1432 2017-07-14  Filip Pizlo  <fpizlo@apple.com>
1433
1434         It should be easy to decide how WebKit yields
1435         https://bugs.webkit.org/show_bug.cgi?id=174298
1436
1437         Reviewed by Saam Barati.
1438
1439         No new tests because the WebCore change is just a change to how we #include things.
1440
1441         * inspector/InspectorPageAgent.h:
1442         * inspector/TimelineRecordFactory.h:
1443         * workers/Worker.h:
1444         * workers/WorkerGlobalScopeProxy.h:
1445         * workers/WorkerMessagingProxy.h:
1446
1447 2017-07-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
1448
1449         REGRESSION(r219045): A partially loaded image may not be repainted when its complete frame finishes decoding
1450         https://bugs.webkit.org/show_bug.cgi?id=174230
1451
1452         Reviewed by Simon Fraser.
1453
1454         Because of r219045, we now only repaint the CachedImageClinets which tried
1455         to draw the image but they could not because they have to wait for the image
1456         decoding to finish. This was done by keeping a HashSet of these clients 
1457         and make CachedImage own it. This HashSet is cleared once the image frame
1458         finishes decoding and all the waited clients are repainted.
1459
1460         But Multiple asynchronous image decoding requests are allowed for the same
1461         frame if new data is added to the image source. If we tried to draw the 
1462         same image twice before it finishes decoding the first request, we will
1463         not be to record this second request since the HashSet will not add the
1464         same client twice. When he second request finishes decoding, CachedImage
1465         will not repaint any client since its HashSet is empty.
1466
1467         To fix this problem we can do the following. When an image frame finishes
1468         decoding, CachedImage will keep its HashSet of pending drawing clients as
1469         long as the image frame is a partially loaded frame.
1470
1471         * loader/cache/CachedImage.cpp:
1472         (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
1473         (WebCore::CachedImage::imageFrameAvailable):
1474         * loader/cache/CachedImage.h:
1475         * platform/graphics/BitmapImage.cpp:
1476         (WebCore::BitmapImage::destroyDecodedData):
1477         (WebCore::BitmapImage::dataChanged):
1478         (WebCore::BitmapImage::setCurrentFrameDecodingStatusIfNecessary):
1479         (WebCore::BitmapImage::draw):
1480         (WebCore::BitmapImage::internalStartAnimation):
1481         (WebCore::BitmapImage::internalAdvanceAnimation):
1482         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
1483         * platform/graphics/BitmapImage.h:
1484         * platform/graphics/ImageFrame.cpp:
1485         (WebCore::ImageFrame::decodingStatus):
1486         * platform/graphics/ImageFrame.h: Move DecodingStatus out of this class
1487         to ImageTypes.h to avoid adding other header files to ImageObvsever.h
1488         * platform/graphics/ImageFrameCache.cpp:
1489         (WebCore::ImageFrameCache::setNativeImage):
1490         (WebCore::ImageFrameCache::cacheMetadataAtIndex):
1491         (WebCore::ImageFrameCache::cacheNativeImageAtIndex):
1492         (WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync):
1493         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
1494         (WebCore::ImageFrameCache::frameDecodingStatusAtIndex):
1495         * platform/graphics/ImageFrameCache.h:
1496         * platform/graphics/ImageObserver.h:
1497         * platform/graphics/ImageSource.h:
1498         (WebCore::ImageSource::frameDecodingStatusAtIndex):
1499         * platform/graphics/ImageTypes.h:
1500         * platform/image-decoders/bmp/BMPImageReader.cpp:
1501         (WebCore::BMPImageReader::decodeBMP):
1502         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1503         (WebCore::GIFImageDecoder::frameComplete):
1504         (WebCore::GIFImageDecoder::initFrameBuffer):
1505         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1506         (WebCore::JPEGImageDecoder::outputScanlines):
1507         (WebCore::JPEGImageDecoder::jpegComplete):
1508         * platform/image-decoders/png/PNGImageDecoder.cpp:
1509         (WebCore::PNGImageDecoder::rowAvailable):
1510         (WebCore::PNGImageDecoder::pngComplete):
1511         (WebCore::PNGImageDecoder::frameComplete):
1512         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1513         (WebCore::WEBPImageDecoder::decode):
1514         * rendering/RenderBoxModelObject.cpp:
1515         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
1516
1517 2017-07-22  Timothy Horton  <timothy_horton@apple.com>
1518
1519         Drag and Drop preview image for Twitter link is the wrong shape
1520         ​https://bugs.webkit.org/show_bug.cgi?id=174731
1521         <rdar://problem/33335616>
1522
1523         * dom/Range.cpp:
1524         (WebCore::Range::absoluteRectsForRangeInText):
1525         * page/TextIndicator.cpp:
1526         (WebCore::initializeIndicator):
1527         Apply some post-landing review feedback for r219756.
1528
1529 2017-07-21  Chris Dumez  <cdumez@apple.com>
1530
1531         Drop IDBDatabaseException class
1532         https://bugs.webkit.org/show_bug.cgi?id=174743
1533
1534         Reviewed by Darin Adler.
1535
1536         Drop IDBDatabaseException class and use DOMException directly. IDBDatabaseException was
1537         only an internal concept and was already exposed to the Web as a DOMException. This
1538         simplifies the code a bit and will allow for further simplification in a follow-up patch.
1539
1540         No new tests, no Web-facing behavior change, except for some exception messages
1541         being slightly different.
1542
1543         * CMakeLists.txt:
1544         * Modules/indexeddb/IDBCursor.cpp:
1545         (WebCore::IDBCursor::update):
1546         (WebCore::IDBCursor::advance):
1547         (WebCore::IDBCursor::continuePrimaryKey):
1548         (WebCore::IDBCursor::continueFunction):
1549         (WebCore::IDBCursor::deleteFunction):
1550         * Modules/indexeddb/IDBDatabase.cpp:
1551         (WebCore::IDBDatabase::createObjectStore):
1552         (WebCore::IDBDatabase::transaction):
1553         (WebCore::IDBDatabase::deleteObjectStore):
1554         * Modules/indexeddb/IDBDatabaseError.h: Removed.
1555         * Modules/indexeddb/IDBDatabaseException.cpp: Removed.
1556         * Modules/indexeddb/IDBDatabaseException.h: Removed.
1557         * Modules/indexeddb/IDBFactory.cpp:
1558         (WebCore::IDBFactory::cmp):
1559         * Modules/indexeddb/IDBIndex.cpp:
1560         (WebCore::IDBIndex::setName):
1561         (WebCore::IDBIndex::openCursor):
1562         (WebCore::IDBIndex::openKeyCursor):
1563         (WebCore::IDBIndex::count):
1564         (WebCore::IDBIndex::doCount):
1565         (WebCore::IDBIndex::get):
1566         (WebCore::IDBIndex::doGet):
1567         (WebCore::IDBIndex::getKey):
1568         (WebCore::IDBIndex::doGetKey):
1569         (WebCore::IDBIndex::getAll):
1570         (WebCore::IDBIndex::getAllKeys):
1571         * Modules/indexeddb/IDBKeyRange.cpp:
1572         (WebCore::IDBKeyRange::only):
1573         (WebCore::IDBKeyRange::lowerBound):
1574         (WebCore::IDBKeyRange::upperBound):
1575         (WebCore::IDBKeyRange::bound):
1576         (WebCore::IDBKeyRange::includes):
1577         * Modules/indexeddb/IDBObjectStore.cpp:
1578         (WebCore::IDBObjectStore::setName):
1579         (WebCore::IDBObjectStore::openCursor):
1580         (WebCore::IDBObjectStore::openKeyCursor):
1581         (WebCore::IDBObjectStore::get):
1582         (WebCore::IDBObjectStore::getKey):
1583         (WebCore::IDBObjectStore::putOrAdd):
1584         (WebCore::IDBObjectStore::doDelete):
1585         (WebCore::IDBObjectStore::deleteFunction):
1586         (WebCore::IDBObjectStore::clear):
1587         (WebCore::IDBObjectStore::createIndex):
1588         (WebCore::IDBObjectStore::index):
1589         (WebCore::IDBObjectStore::deleteIndex):
1590         (WebCore::IDBObjectStore::count):
1591         (WebCore::IDBObjectStore::doCount):
1592         (WebCore::IDBObjectStore::getAll):
1593         (WebCore::IDBObjectStore::getAllKeys):
1594         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1595         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
1596         * Modules/indexeddb/IDBRequest.cpp:
1597         (WebCore::IDBRequest::result):
1598         (WebCore::IDBRequest::error):
1599         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
1600         * Modules/indexeddb/IDBTransaction.cpp:
1601         (WebCore::IDBTransaction::objectStore):
1602         (WebCore::IDBTransaction::abort):
1603         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
1604         (WebCore::IDBTransaction::didCreateIndexOnServer):
1605         (WebCore::IDBTransaction::putOrAddOnServer):
1606         * Modules/indexeddb/server/IndexValueStore.cpp:
1607         (WebCore::IDBServer::IndexValueStore::addRecord):
1608         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1609         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
1610         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
1611         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
1612         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
1613         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
1614         (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
1615         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
1616         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
1617         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
1618         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
1619         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
1620         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
1621         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
1622         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
1623         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
1624         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
1625         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
1626         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
1627         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
1628         * Modules/indexeddb/server/MemoryIndex.cpp:
1629         (WebCore::IDBServer::MemoryIndex::putIndexKey):
1630         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1631         (WebCore::IDBServer::MemoryObjectStore::createIndex):
1632         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
1633         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1634         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1635         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
1636         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
1637         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
1638         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1639         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
1640         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
1641         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
1642         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1643         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
1644         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
1645         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1646         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
1647         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
1648         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
1649         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
1650         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
1651         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
1652         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
1653         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1654         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
1655         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1656         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
1657         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
1658         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1659         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
1660         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
1661         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
1662         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
1663         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
1664         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
1665         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
1666         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
1667         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1668         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1669         (WebCore::IDBServer::SQLiteIDBTransaction::begin):
1670         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
1671         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
1672         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1673         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1674         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
1675         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
1676         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
1677         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
1678         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
1679         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1680         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
1681         * Modules/indexeddb/shared/IDBError.cpp:
1682         (WebCore::IDBError::name):
1683         (WebCore::IDBError::message):
1684         (WebCore::IDBError::toDOMError):
1685         * Modules/indexeddb/shared/IDBError.h:
1686         (WebCore::IDBError::userDeleteError):
1687         (WebCore::IDBError::isNull):
1688         * WebCore.xcodeproj/project.pbxproj:
1689         * bindings/js/JSDOMExceptionHandling.cpp:
1690         (WebCore::createDOMException):
1691
1692         * dom/DOMException.cpp:
1693         (WebCore::DOMException::initializeDescription):
1694         Initialize description->code from using the actual error codes in the
1695         coreExceptions table, instead of initializing it using |ec|. |ec| is
1696         the index in the ExceptionCode enumeration and it matches the error
1697         code only for legacy exceptions. New exceptions such as DataError
1698         should have a code of 0. Without this change, w3c for IDB would start
1699         failing.
1700
1701         * dom/ExceptionCodeDescription.cpp:
1702         (WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
1703         * dom/ExceptionCodeDescription.h:
1704
1705 2017-07-21  Sam Weinig  <sam@webkit.org>
1706
1707         [WebIDL] Simplify XMLHttpRequest bindings by removing built-ins
1708         https://bugs.webkit.org/show_bug.cgi?id=174740
1709
1710         Reviewed by Chris Dumez.
1711
1712         The behavior we were getting from XMLHttpRequest.js can be implemented
1713         with the [CachedAttribute] extended attribute. This reduces the number
1714         of JS -> C++ jumps required and makes the code more similar to other
1715         bindings that need caching of an IDL any value.
1716
1717         * CMakeLists.txt:
1718         * DerivedSources.make:
1719         * xml/XMLHttpRequest.js: Removed.
1720         Remove XMLHttpRequest.js.
1721
1722         * bindings/js/JSXMLHttpRequestCustom.cpp:
1723         (WebCore::JSXMLHttpRequest::response):
1724         (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
1725         * xml/XMLHttpRequest.idl:
1726         Replace builtin with a [CachedAttribute] and [CustomGetter]
1727         for the response property.
1728
1729 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
1730
1731         Drag and Drop preview image for Twitter link is the wrong shape
1732         https://bugs.webkit.org/show_bug.cgi?id=174731
1733         <rdar://problem/33335616>
1734
1735         Reviewed by Zalan Bujtas.
1736
1737         TextIndicator uses Range::borderAndTextQuads and ::absoluteTextRects
1738         in order to get the rects of the indicated text. Currently, these
1739         functions do not respect clipping, so clipped-out text (e.g. as seen
1740         inside links on Twitter) generates lots of meaningless indicated rects.
1741
1742         * page/TextIndicator.cpp:
1743         (WebCore::estimatedBackgroundColorForRange):
1744         (WebCore::hasAnyIllegibleColors):
1745         Change adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary
1746         to instead be hasAnyIllegibleColors, and referred to in the same place
1747         as hasNonInlineOrReplacedElements, so that it follows the same
1748         upgrade path (leaving textRects empty, so that it is later filled in
1749         with the absoluteBoundingRect). This was a mistake in r219033, which
1750         instead would end up painting all content, but filling in textRects
1751         with the actual individual text rects.
1752
1753         This alone changes the behavior on Twitter from lots of jagged misplaced
1754         rects to a too-large bounding rect. Combined with the following changes,
1755         the bounding rect is reduced to the right size:
1756
1757         (WebCore::initializeIndicator):
1758         Adopt the new Range::borderAndTextQuads and ::absoluteTextRects parameter
1759         and opt-in to respecting clipping for text rects.
1760
1761         * dom/DOMRectList.cpp:
1762         (WebCore::DOMRectList::DOMRectList):
1763         * dom/DOMRectList.h:
1764         (WebCore::DOMRectList::create):
1765         Add a DOMRectList constructor and create() that take FloatRects, similar
1766         to the one that takes FloatQuads, but without the boundingRect() calls.
1767
1768         * dom/Document.h:
1769         * dom/Document.cpp:
1770         (WebCore::Document::convertAbsoluteToClientRects):
1771         Add convertAbsoluteToClientRects, similar to covertAbsoluteToClientQuads,
1772         except acting on rects instead of quads.
1773
1774         * dom/Range.cpp:
1775         (WebCore::Range::absoluteRectsForRangeInText):
1776         (WebCore::Range::absoluteTextRects):
1777         (WebCore::Range::getClientRects):
1778         (WebCore::Range::borderAndTextRects):
1779         (WebCore::Range::boundingRect):
1780         (WebCore::Range::absoluteBoundingRect):
1781         (WebCore::Range::borderAndTextQuads): Deleted.
1782         * dom/Range.h:
1783         Replace borderAndTextQuads with borderAndTextRects, because all callers
1784         just ended up calling boundingBox() on the quads.
1785
1786         Factor absoluteRectsForRangeInText out of absoluteTextRects and
1787         borderAndTextQuads, and teach it to optionally intersect the text rects
1788         with their renderer's absoluteClippedOverflowRect.
1789
1790 2017-07-21  Per Arne Vollan  <pvollan@apple.com>
1791
1792         Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke.
1793         https://bugs.webkit.org/show_bug.cgi?id=174701
1794         <rdar://problem/32903679>
1795
1796         Reviewed by Simon Fraser.
1797
1798         The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color.
1799         Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible.
1800
1801         Test: fast/css/round-trip-stroke-width-using-computed-style.html
1802
1803         * rendering/TextPaintStyle.cpp:
1804         (WebCore::updateGraphicsContext):
1805         * rendering/style/RenderStyle.h:
1806         (WebCore::RenderStyle::initialStrokeWidth):
1807         (WebCore::RenderStyle::initialStrokeColor):
1808         * rendering/style/StyleRareInheritedData.cpp:
1809         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1810
1811 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
1812
1813         Remove an inaccurate comment from RenderTextLineBoxes
1814
1815         * rendering/RenderTextLineBoxes.cpp:
1816         (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
1817         This comment has been wrong for at least 4 years.
1818
1819 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
1820
1821         TextIndicator::estimatedTextColorsForRange asserts inside HashSet code (inserting reserved value)
1822         https://bugs.webkit.org/show_bug.cgi?id=174733
1823
1824         Reviewed by Wenson Hsieh.
1825
1826         * page/TextIndicator.cpp:
1827         (WebCore::estimatedTextColorsForRange):
1828         (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
1829         RGBA32 isn't a valid hash key, because we have no traits that define the
1830         empty or deleted values, nor do we have any bits we could feasibly
1831         use -- the full range of RGBA32 is easy to reach with various colors.
1832
1833         Instead, hash Color directly.
1834
1835 2017-07-21  Nan Wang  <n_wang@apple.com>
1836
1837         AX: Expose form validation on iOS as hint
1838         https://bugs.webkit.org/show_bug.cgi?id=174722
1839         <rdar://problem/33459761>
1840
1841         Reviewed by Chris Fleizach.
1842
1843         Adding the validation message to the hint of the form control element.
1844
1845         Test: accessibility/ios-simulator/form-control-validation-message.html
1846
1847         * accessibility/AccessibilityObject.cpp:
1848         (WebCore::AccessibilityObject::isShowingValidationMessage):
1849         (WebCore::AccessibilityObject::validationMessage):
1850         * accessibility/AccessibilityObject.h:
1851         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1852         (-[WebAccessibilityObjectWrapper accessibilityHint]):
1853         (-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]):
1854         * html/HTMLFormControlElement.cpp:
1855         (WebCore::HTMLFormControlElement::isShowingValidationMessage):
1856         * html/HTMLFormControlElement.h:
1857
1858 2017-07-21  Konstantin Tokarev  <annulen@yandex.ru>
1859
1860         [cmake][Mac] Unreviewed, fix linking WebKitSystemInterface
1861
1862         After r219560 link_directories() in PlatformXXX.cmake files does not
1863         affect corresponding targets.
1864
1865         * PlatformMac.cmake:
1866
1867 2017-07-21  Sam Weinig  <sam@webkit.org>
1868
1869         [WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots
1870         https://bugs.webkit.org/show_bug.cgi?id=174713
1871
1872         Reviewed by Andreas Kling.
1873
1874         We used to not want to bloat the size of CSSValues with a pointer to the
1875         owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of
1876         them on DOMWrapperWorld that only got set if a wrapper was made. Now that
1877         we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created
1878         for the bindings, we no longer need the side table, and simply have the
1879         DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration.
1880
1881         * bindings/js/DOMWrapperWorld.h:
1882         (WebCore::DOMWrapperWorld::wrappers):
1883         Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter.
1884
1885         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1886         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted.
1887         Remove custom implementation of getPropertyCSSValue, now that it no longer
1888         needs to update m_deprecatedCSSOMValueRoots.
1889
1890         * bindings/js/JSDOMWindowBase.cpp:
1891         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
1892         * bindings/js/JSDOMWrapperCache.h:
1893         (WebCore::getCachedWrapper):
1894         (WebCore::cacheWrapper):
1895         (WebCore::uncacheWrapper):
1896         * bindings/js/JSNodeCustom.cpp:
1897         (WebCore::getOutOfLineCachedWrapper):
1898         Use wrappers getter rather than direct member variable.
1899
1900         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
1901         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
1902         Rather than checking the side table for roots, now get the root
1903         via the reference CSSStyleDeclaration.
1904
1905         (WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted.
1906         Remove custom finalize now that we don't have to remove ourself
1907         from m_deprecatedCSSOMValueRoots.
1908
1909         * css/CSSStyleDeclaration.idl:
1910         Remove [Custom] from getPropertyCSSValue.
1911
1912         * css/DeprecatedCSSOMValue.idl:
1913         Remove [JSCustomFinalize].
1914
1915         * css/CSSComputedStyleDeclaration.cpp:
1916         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1917         * css/CSSImageValue.cpp:
1918         (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
1919         * css/CSSImageValue.h:
1920         * css/CSSPrimitiveValue.cpp:
1921         (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
1922         * css/CSSPrimitiveValue.h:
1923         * css/CSSStyleDeclaration.h:
1924         * css/CSSValue.cpp:
1925         (WebCore::CSSValue::createDeprecatedCSSOMWrapper):
1926         * css/CSSValue.h:
1927         * css/DeprecatedCSSOMCounter.h:
1928         * css/DeprecatedCSSOMPrimitiveValue.cpp:
1929         (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
1930         (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
1931         (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
1932         * css/DeprecatedCSSOMPrimitiveValue.h:
1933         (WebCore::DeprecatedCSSOMPrimitiveValue::create):
1934         (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
1935         * css/DeprecatedCSSOMRGBColor.h:
1936         * css/DeprecatedCSSOMRect.h:
1937         * css/DeprecatedCSSOMValue.h:
1938         (WebCore::DeprecatedCSSOMValue::owner):
1939         (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
1940         (WebCore::DeprecatedCSSOMComplexValue::create):
1941         (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
1942         * css/DeprecatedCSSOMValueList.h:
1943         (WebCore::DeprecatedCSSOMValueList::create):
1944         (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
1945         * css/PropertySetCSSStyleDeclaration.cpp:
1946         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
1947         * css/PropertySetCSSStyleDeclaration.h:
1948         * svg/SVGElement.cpp:
1949         (WebCore::SVGElement::getPresentationAttribute):
1950         Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes.
1951
1952 2017-07-21  Andreas Kling  <akling@apple.com>
1953
1954         Use more references in event dispatch code
1955         https://bugs.webkit.org/show_bug.cgi?id=174681
1956
1957         Reviewed by Geoffrey Garen.
1958
1959         Make EventListener::handleEvent() take a ScriptExecutionContext&, Event&.
1960         Then make everything build again. Various null checks and assertions
1961         disappear in the process.
1962
1963         * bindings/js/JSErrorHandler.cpp:
1964         (WebCore::JSErrorHandler::handleEvent):
1965         * bindings/js/JSErrorHandler.h:
1966         * bindings/js/JSEventListener.cpp:
1967         (WebCore::JSEventListener::initializeJSFunction):
1968         (WebCore::JSEventListener::handleEvent):
1969         (WebCore::eventHandlerAttribute):
1970         * bindings/js/JSEventListener.h:
1971         (WebCore::JSEventListener::jsFunction):
1972         * bindings/js/JSLazyEventListener.cpp:
1973         (WebCore::JSLazyEventListener::initializeJSFunction):
1974         * bindings/js/JSLazyEventListener.h:
1975         * dom/EventListener.h:
1976         * dom/EventTarget.cpp:
1977         (WebCore::EventTarget::fireEventListeners):
1978         * html/HTMLPlugInElement.cpp:
1979         (WebCore::HTMLPlugInElement::defaultEventHandler):
1980         * html/ImageDocument.cpp:
1981         (WebCore::ImageEventListener::handleEvent):
1982         * inspector/CommandLineAPIHost.cpp:
1983         (WebCore::listenerEntriesFromListenerInfo):
1984         * inspector/InspectorDOMAgent.cpp:
1985         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1986         * inspector/InspectorIndexedDBAgent.cpp:
1987         * platform/Widget.h:
1988         (WebCore::Widget::handleEvent):
1989         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
1990         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1991         (WebCore::WebPlaybackSessionModelMediaElement::handleEvent):
1992         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
1993         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
1994         (WebVideoFullscreenModelVideoElement::handleEvent):
1995         * svg/SVGTRefElement.cpp:
1996         (WebCore::SVGTRefTargetEventListener::handleEvent):
1997         * svg/animation/SVGSMILElement.cpp:
1998         (WebCore::ConditionEventListener::handleEvent):
1999         (WebCore::SVGSMILElement::handleConditionEvent):
2000         * svg/animation/SVGSMILElement.h:
2001
2002 2017-07-21  Zalan Bujtas  <zalan@apple.com>
2003
2004         iBooks: Overlapping/missing content at beginning/end of paragraph.
2005         https://bugs.webkit.org/show_bug.cgi?id=174717
2006         <rdar://problem/33117912>
2007
2008         Reviewed by Simon Fraser.
2009
2010         By definiton simple and normal line layout should always produce the exact same lineboxes. It enables us not
2011         to force repaint while swapping between these 2 line layouts.
2012         However in certain cases (font size pixel rounding as an example) they don't agree on how much content fits the line and
2013         that could result in missing/overlapping content due to the lack of repaint. 
2014
2015         Unable to test.
2016
2017         * rendering/RenderBlockFlow.cpp:
2018         (WebCore::RenderBlockFlow::ensureLineBoxes):
2019
2020 2017-07-21  Chris Dumez  <cdumez@apple.com>
2021
2022         Drop make_dom_exceptions.pl script that we only have DOMException
2023         https://bugs.webkit.org/show_bug.cgi?id=174699
2024
2025         Reviewed by Darin Adler.
2026
2027         Drop make_dom_exceptions.pl script that we only have DOMException.
2028
2029         * CMakeLists.txt:
2030         * DerivedSources.make:
2031         * WebCore.xcodeproj/project.pbxproj:
2032         * WebCoreMacros.cmake:
2033         * bindings/js/JSDOMExceptionHandling.cpp:
2034         * css/FontFaceSet.cpp:
2035         * dom/DOMAllInOne.cpp:
2036         * dom/DOMExceptions.in: Removed.
2037         * dom/ExceptionCodeDescription.cpp: Added.
2038         (WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
2039         * dom/ExceptionCodeDescription.h: Added.
2040         * dom/make_dom_exceptions.pl: Removed.
2041         * inspector/WebInjectedScriptHost.cpp:
2042         (WebCore::WebInjectedScriptHost::subtype):
2043
2044 2017-07-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
2045
2046         [CG] An image should not invoke many system calls before confirming its format is supported
2047         https://bugs.webkit.org/show_bug.cgi?id=174692
2048
2049         Reviewed by Tim Horton.
2050
2051         We should be careful when invoking system calls before confirming that the
2052         image type is available and it is one of the whitelist formats. Otherwise
2053         we will be calling the parsers of the unsupported formats.
2054
2055         * loader/cache/CachedImage.cpp:
2056         (WebCore::CachedImage::setImageDataBuffer): The check isAllowedImageUTI()
2057         is now done in ImageDecoder::encodedDataStatus() which will return Error
2058         if there is an error in the data or "isAllowedImageUTI() returns false."
2059
2060         * platform/graphics/BitmapImage.cpp:
2061         (WebCore::BitmapImage::dataChanged): Avoid calling canUseAsyncDecodingForLargeImages()
2062         before confirming the image type is available and it's supported by WebKit.
2063         canUseAsyncDecodingForLargeImages() tries to cache the first frame of the
2064         image to know its size. Asking the ImageFrameCache to destroy its decoded
2065         frames is not needed unless ImageFrameCache::decodedSize() is not zero.
2066
2067         * platform/graphics/cg/ImageDecoderCG.cpp:
2068         (WebCore::ImageDecoder::encodedDataStatus): Avoid calling CGImageSourceGetStatus()
2069         before knowing the UTI of the image. When knowing it, we call CGImageSourceGetStatus()
2070         and if it returns kCGImageStatusIncomplete or kCGImageStatusComplete, we
2071         check whether isAllowedImageUTI() or not. If isAllowedImageUTI() returns
2072         false, return Error which will make the CachedImage cancel loading the 
2073         rest of the image.
2074
2075 2017-07-21  Jeremy Jones  <jeremyj@apple.com>
2076
2077         AudioTrackPrivateMediaStreamCocoa shouldn't set AudioSession::setPreferredBufferSize
2078         https://bugs.webkit.org/show_bug.cgi?id=174707
2079         rdar://problem/33446809
2080
2081         Reviewed by Eric Carlson.
2082
2083         Manually tested for audio side effects.
2084
2085         AudioChannel::copyFrom fails when AudioChannel lengths don't match.
2086
2087         This happens because PlatformMediaSessionManager::updateSessionState() owns and sets
2088         AudioSession::setPreferredBufferSize().
2089
2090         However, AudioTrackPrivateMediaStreamCocoa::createAudioUnit, when it creates an input
2091         audio unit is setting AudioSession::setPreferredBufferSize() directly to its own arbitrary value.
2092
2093         AudioSession::setPreferredBufferSize() should be managed by the higher level 
2094         PlatformMediaSessionManager, and not modified by audio unit creation, in order to keep harmony
2095         within the audio pipeline.
2096
2097         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2098         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
2099
2100 2017-07-21  Jeremy Jones  <jeremyj@apple.com>
2101
2102         Noise when AudioChannel lengths don't match.
2103         https://bugs.webkit.org/show_bug.cgi?id=174706
2104         rdar://problem/33389856
2105
2106         Reviewed by Eric Carlson.
2107
2108         When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer.
2109         This change zeros out the data, so there isn't objectionable noise sent to the speaker.
2110
2111         * platform/audio/AudioChannel.cpp:
2112         (WebCore::AudioChannel::copyFrom):
2113
2114 2017-07-21  Sam Weinig  <sam@webkit.org>
2115
2116         [WebIDL] Make a few parameters non-nullable in inspector IDL files
2117         https://bugs.webkit.org/show_bug.cgi?id=174719
2118
2119         Reviewed by Joseph Pecoraro.
2120
2121         * inspector/CommandLineAPIHost.cpp:
2122         (WebCore::CommandLineAPIHost::databaseId):
2123         (WebCore::CommandLineAPIHost::storageId):
2124         * inspector/CommandLineAPIHost.h:
2125         * inspector/CommandLineAPIHost.idl:
2126         * inspector/InspectorDOMStorageAgent.cpp:
2127         (WebCore::InspectorDOMStorageAgent::storageId):
2128         * inspector/InspectorDOMStorageAgent.h:
2129         * inspector/InspectorDatabaseAgent.cpp:
2130         (WebCore::InspectorDatabaseAgent::databaseId):
2131         * inspector/InspectorDatabaseAgent.h:
2132         * inspector/InspectorFrontendHost.cpp:
2133         (WebCore::InspectorFrontendHost::showContextMenu):
2134         (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
2135         * inspector/InspectorFrontendHost.h:
2136         * inspector/InspectorFrontendHost.idl:
2137         Remove nullability from arguments that should never be null.
2138
2139 2017-07-21  Brady Eidson  <beidson@apple.com>
2140
2141         Get rid of WebCore IconDatabase code.
2142         https://bugs.webkit.org/show_bug.cgi?id=174700
2143
2144         Reviewed by Tim Horton.
2145
2146         No new tests (No behavior change).
2147         
2148         Tons of red.
2149         Very little green.
2150         No further explanation.
2151
2152         * CMakeLists.txt:
2153         * WebCore.xcodeproj/project.pbxproj:
2154         * dom/Document.cpp:
2155         (WebCore::Document::implicitClose):
2156         * history/HistoryItem.cpp:
2157         (WebCore::HistoryItem::HistoryItem):
2158         (WebCore::HistoryItem::~HistoryItem):
2159         (WebCore::HistoryItem::reset):
2160         (WebCore::HistoryItem::setURLString):
2161         * inspector/InspectorNetworkAgent.cpp:
2162         (WebCore::InspectorNetworkAgent::willSendRequest):
2163         * loader/DocumentLoader.cpp:
2164         (WebCore::DocumentLoader::~DocumentLoader):
2165         (WebCore::DocumentLoader::startIconLoading):
2166         (WebCore::DocumentLoader::iconLoadDecisionAvailable): Deleted.
2167         (WebCore::iconLoadDecisionCallback): Deleted.
2168         (WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Deleted.
2169         (WebCore::DocumentLoader::continueIconLoadWithDecision): Deleted.
2170         (WebCore::iconDataCallback): Deleted.
2171         (WebCore::DocumentLoader::getIconDataForIconURL): Deleted.
2172         * loader/DocumentLoader.h:
2173         (WebCore::DocumentLoader::linkIcons):
2174         * loader/FrameLoader.cpp:
2175         (WebCore::FrameLoader::FrameLoader):
2176         (WebCore::FrameLoader::stop):
2177         * loader/FrameLoader.h:
2178         (WebCore::FrameLoader::subframeLoader):
2179         (WebCore::FrameLoader::icon): Deleted.
2180         * loader/FrameLoaderClient.h:
2181         * loader/archive/cf/LegacyWebArchive.cpp:
2182         (WebCore::LegacyWebArchive::create):
2183         * loader/icon/IconController.cpp: Removed.
2184         * loader/icon/IconController.h: Removed.
2185         * loader/icon/IconDatabase.cpp: Removed.
2186         * loader/icon/IconDatabase.h: Removed.
2187         * loader/icon/IconDatabaseBase.cpp: Removed.
2188         * loader/icon/IconDatabaseBase.h: Removed.
2189         * loader/icon/IconDatabaseClient.h: Removed.
2190         * loader/icon/IconLoader.cpp:
2191         (WebCore::IconLoader::IconLoader):
2192         (WebCore::IconLoader::startLoading):
2193         (WebCore::IconLoader::notifyFinished):
2194         * loader/icon/IconLoader.h:
2195         * loader/icon/IconRecord.cpp: Removed.
2196         * loader/icon/IconRecord.h: Removed.
2197         * loader/icon/PageURLRecord.cpp: Removed.
2198         * loader/icon/PageURLRecord.h: Removed.
2199         * testing/Internals.cpp:
2200         (WebCore::Internals::shortcutIconURLs):
2201
2202 2017-07-21  Chris Dumez  <cdumez@apple.com>
2203
2204         Rename DOMCoreException class to DOMException
2205         https://bugs.webkit.org/show_bug.cgi?id=174698
2206
2207         Reviewed by Darin Adler.
2208
2209         Rename DOMCoreException class to DOMException to match its Web-exposed name.
2210
2211         * CMakeLists.txt:
2212         * DerivedSources.cpp:
2213         * DerivedSources.make:
2214         * Modules/quota/StorageErrorCallback.cpp:
2215         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
2216         * Modules/quota/StorageErrorCallback.h:
2217         * Modules/quota/StorageErrorCallback.idl:
2218         * WebCore.xcodeproj/project.pbxproj:
2219         * bindings/js/JSDOMExceptionHandling.cpp:
2220         (WebCore::retrieveErrorMessage):
2221         (WebCore::createDOMException):
2222         * bindings/scripts/CodeGeneratorJS.pm:
2223         (GenerateOverloadDispatcher):
2224         * css/FontFaceSet.cpp:
2225         * css/FontFaceSet.h:
2226         * dom/DOMAllInOne.cpp:
2227         * dom/DOMException.cpp: Renamed from Source/WebCore/dom/DOMCoreException.cpp.
2228         (WebCore::DOMException::create):
2229         (WebCore::DOMException::DOMException):
2230         (WebCore::DOMException::initializeDescription):
2231         * dom/DOMException.h: Renamed from Source/WebCore/dom/DOMCoreException.h.
2232         (WebCore::DOMException::create):
2233         (WebCore::DOMException::DOMException):
2234         * dom/DOMException.idl: Renamed from Source/WebCore/dom/DOMCoreException.idl.
2235         * dom/DOMExceptions.in:
2236         * dom/make_dom_exceptions.pl:
2237         (generateImplementation):
2238
2239 2017-07-21  Sam Weinig  <sam@webkit.org>
2240
2241         Follow up to https://bugs.webkit.org/show_bug.cgi?id=174659.
2242
2243         * inspector/InspectorFrontendHost.idl:
2244         Remove unnecessary JSGenerateToJSObject noticed in review.
2245
2246 2017-07-20  Chris Dumez  <cdumez@apple.com>
2247
2248         Drop legacy SVGException type
2249         https://bugs.webkit.org/show_bug.cgi?id=174695
2250
2251         Reviewed by Darin Adler.
2252
2253         Drop legacy SVGException type and use DOMException instead, as per the latest
2254         SVG specification. Both Chrome and Firefox no longer expose the SVGException
2255         type.
2256
2257         * CMakeLists.txt:
2258         * DerivedSources.cpp:
2259         * DerivedSources.make:
2260         * WebCore.xcodeproj/project.pbxproj:
2261         * bindings/js/JSDOMExceptionHandling.cpp:
2262         (WebCore::createDOMException):
2263         * bindings/js/JSExceptionBase.cpp:
2264         (WebCore::toExceptionBase):
2265         * dom/DOMExceptions.in:
2266         * svg/SVGAllInOne.cpp:
2267         * svg/SVGCircleElement.cpp:
2268         * svg/SVGException.cpp: Removed.
2269         * svg/SVGException.h: Removed.
2270         * svg/SVGException.idl: Removed.
2271         * svg/SVGGraphicsElement.idl:
2272         * svg/SVGLocatable.cpp:
2273         (WebCore::SVGLocatable::getTransformToElement):
2274         * svg/SVGMatrixValue.h:
2275         * svg/SVGPathSegList.cpp:
2276         (WebCore::SVGPathSegList::getItem):
2277         (WebCore::SVGPathSegList::replaceItem):
2278         (WebCore::SVGPathSegList::removeItem):
2279         * svg/SVGPathSegList.h:
2280         * svg/SVGPathSegList.idl:
2281         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
2282         * svg/properties/SVGListProperty.h:
2283
2284 2017-07-20  Chris Dumez  <cdumez@apple.com>
2285
2286         Hook up ITP quirks to the needsSiteSpecificQuirks setting
2287         https://bugs.webkit.org/show_bug.cgi?id=174691
2288
2289         Reviewed by Darin Adler.
2290
2291         Hook up ITP quirks to the needsSiteSpecificQuirks setting to make it easier for
2292         Web-developers to test their fixes.
2293
2294         * loader/ResourceLoadObserver.cpp:
2295         (WebCore::shouldEnableSiteSpecificQuirks):
2296         (WebCore::areDomainsAssociated):
2297         (WebCore::ResourceLoadObserver::logFrameNavigation):
2298         (WebCore::resourceNeedsSSOQuirk):
2299         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2300         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2301
2302 2017-07-20  Matt Lewis  <jlewis3@apple.com>
2303
2304         Unreviewed, rolling out r219700.
2305
2306         This revision caused consistent timouts on iOS.
2307
2308         Reverted changeset:
2309
2310         "Turn tests at media/modern-media-controls/start-support back
2311         on"
2312         https://bugs.webkit.org/show_bug.cgi?id=174683
2313         http://trac.webkit.org/changeset/219700
2314
2315 2017-07-20  David Quesada  <david_quesada@apple.com>
2316
2317         Add SPI to notify WKNavigationDelegate about client redirects
2318         https://bugs.webkit.org/show_bug.cgi?id=174680
2319         rdar://problem/33184886
2320
2321         Reviewed by Brady Eidson.
2322
2323         * loader/FrameLoader.cpp:
2324         (WebCore::FrameLoader::performClientRedirect):
2325         * loader/FrameLoader.h:
2326         Add a convenience method for NavigationScheduler that handles a FrameLoadRequest
2327         as a client redirect. Currently this means loading the request and informing the
2328         client about it.
2329
2330         * loader/FrameLoaderClient.h:
2331         Add FrameLoaderClient::dispatchDidPerformClientRedirect() to inform the client when
2332         a client redirect occurs.
2333
2334         * loader/NavigationScheduler.cpp:
2335         Removed ScheduledURLNavigation::fire(). This class was never instantiated directly,
2336         and all subclasses override fire(), so this was unused code.
2337         For ScheduledRedirects and ScheduledLocationChange, use FrameLoader's new method to
2338         load the request as a client redirect.
2339
2340 2017-07-20  Chris Dumez  <cdumez@apple.com>
2341
2342         Drop legacy XPathException type
2343         https://bugs.webkit.org/show_bug.cgi?id=174679
2344
2345         Reviewed by Sam Weinig.
2346
2347         Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
2348         no longer expose XPathException.
2349
2350         Test: fast/dom/DOMException/XPathException-obsolete.html
2351
2352         * CMakeLists.txt:
2353         * DerivedSources.cpp:
2354         * DerivedSources.make:
2355         * WebCore.xcodeproj/project.pbxproj:
2356         * bindings/js/JSDOMExceptionHandling.cpp:
2357         (WebCore::createDOMException):
2358         * bindings/js/JSExceptionBase.cpp:
2359         (WebCore::toExceptionBase):
2360         * dom/DOMExceptions.in:
2361         * xml/XPathException.cpp: Removed.
2362         * xml/XPathException.h: Removed.
2363         * xml/XPathException.idl: Removed.
2364         * xml/XPathExpression.cpp:
2365         (WebCore::XPathExpression::evaluate):
2366         * xml/XPathParser.cpp:
2367         (WebCore::XPath::Parser::parseStatement):
2368         * xml/XPathResult.cpp:
2369         (WebCore::XPathResult::convertTo):
2370         (WebCore::XPathResult::numberValue):
2371         (WebCore::XPathResult::stringValue):
2372         (WebCore::XPathResult::booleanValue):
2373         (WebCore::XPathResult::singleNodeValue):
2374         (WebCore::XPathResult::snapshotLength):
2375         (WebCore::XPathResult::iterateNext):
2376         (WebCore::XPathResult::snapshotItem):
2377
2378 2017-07-20  Chris Dumez  <cdumez@apple.com>
2379
2380         Unreviewed, rolling out r219706.
2381
2382         Broke iOS build
2383
2384         Reverted changeset:
2385
2386         "Drop legacy XPathException type"
2387         https://bugs.webkit.org/show_bug.cgi?id=174679
2388         http://trac.webkit.org/changeset/219706
2389
2390 2017-07-20  Chris Dumez  <cdumez@apple.com>
2391
2392         Drop legacy XPathException type
2393         https://bugs.webkit.org/show_bug.cgi?id=174679
2394
2395         Reviewed by Sam Weinig.
2396
2397         Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
2398         no longer expose XPathException.
2399
2400         Test: fast/dom/DOMException/XPathException-obsolete.html
2401
2402         * CMakeLists.txt:
2403         * DerivedSources.cpp:
2404         * DerivedSources.make:
2405         * WebCore.xcodeproj/project.pbxproj:
2406         * bindings/js/JSDOMExceptionHandling.cpp:
2407         (WebCore::createDOMException):
2408         * bindings/js/JSExceptionBase.cpp:
2409         (WebCore::toExceptionBase):
2410         * dom/DOMExceptions.in:
2411         * xml/XPathException.cpp: Removed.
2412         * xml/XPathException.h: Removed.
2413         * xml/XPathException.idl: Removed.
2414         * xml/XPathExpression.cpp:
2415         (WebCore::XPathExpression::evaluate):
2416         * xml/XPathParser.cpp:
2417         (WebCore::XPath::Parser::parseStatement):
2418         * xml/XPathResult.cpp:
2419         (WebCore::XPathResult::convertTo):
2420         (WebCore::XPathResult::numberValue):
2421         (WebCore::XPathResult::stringValue):
2422         (WebCore::XPathResult::booleanValue):
2423         (WebCore::XPathResult::singleNodeValue):
2424         (WebCore::XPathResult::snapshotLength):
2425         (WebCore::XPathResult::iterateNext):
2426         (WebCore::XPathResult::snapshotItem):
2427
2428 2017-07-20  Chris Dumez  <cdumez@apple.com>
2429
2430         Regression(ITP): May get frequently logged out of wsj.com
2431         https://bugs.webkit.org/show_bug.cgi?id=174661
2432         <rdar://problem/32343256>
2433
2434         Reviewed by Geoffrey Garen.
2435
2436         Add the concept of associated domains in the ResourceLoadObserver. We
2437         previously ignore loads to and from the same domains. We now do the same
2438         if the to and from domains are associated (i.e. owned by the same entity).
2439
2440         For now, only add domains owned by Dow Jones & Company, Inc. to the list,
2441         to address login issues on wsj.com.
2442
2443         No new tests, verified manually on wsj.com.
2444
2445         * loader/ResourceLoadObserver.cpp:
2446         (WebCore::areDomainsAssociated):
2447         (WebCore::ResourceLoadObserver::logFrameNavigation):
2448         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2449         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2450
2451 2017-07-20  Chris Dumez  <cdumez@apple.com>
2452
2453         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
2454         https://bugs.webkit.org/show_bug.cgi?id=174660
2455
2456         Reviewed by Geoffrey Garen.
2457
2458         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
2459         This essentially replaces a branch to figure out if the new size is less or greater than the
2460         current size by an assertion.
2461
2462         * Modules/gamepad/Gamepad.cpp:
2463         (WebCore::Gamepad::Gamepad):
2464         * Modules/webaudio/AudioContext.cpp:
2465         (WebCore::AudioContext::addReaction):
2466         * Modules/websockets/WebSocketChannel.cpp:
2467         (WebCore::WebSocketChannel::skipBuffer):
2468         * Modules/websockets/WebSocketDeflater.cpp:
2469         (WebCore::WebSocketDeflater::finish):
2470         * contentextensions/ContentExtensionCompiler.cpp:
2471         (WebCore::ContentExtensions::serializeSelector):
2472         * contentextensions/DFABytecodeCompiler.cpp:
2473         (WebCore::ContentExtensions::append):
2474         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2475         (WebCore::gcryptEncrypt):
2476         (WebCore::gcryptDecrypt):
2477         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
2478         (WebCore::gcryptDerive):
2479         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
2480         (WebCore::GameControllerGamepadProvider::controllerDidConnect):
2481         * platform/gamepad/mac/HIDGamepadProvider.cpp:
2482         (WebCore::HIDGamepadProvider::deviceAdded):
2483         * platform/graphics/ImageBackingStore.h:
2484         (WebCore::ImageBackingStore::setSize):
2485         * platform/graphics/WOFFFileFormat.cpp:
2486         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
2487         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
2488         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
2489         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2490         (WebCore::InbandTextTrackPrivateAVF::resetCueValues):
2491         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
2492         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
2493         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer):
2494         * platform/graphics/cg/ImageBufferCG.cpp:
2495         (WebCore::cfData):
2496         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
2497         (WebCore::BMPImageDecoder::frameBufferAtIndex):
2498         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2499         (WebCore::ICOImageDecoder::decode):
2500         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2501         (WebCore::JPEGImageDecoder::frameBufferAtIndex):
2502         * platform/image-decoders/png/PNGImageDecoder.cpp:
2503         (WebCore::PNGImageDecoder::frameBufferAtIndex):
2504         (WebCore::PNGImageDecoder::readChunks):
2505         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2506         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
2507         * platform/image-encoders/JPEGImageEncoder.cpp:
2508         (WebCore::compressRGBABigEndianToJPEG):
2509         * platform/text/DecodeEscapeSequences.h:
2510         (WebCore::URLEscapeSequence::decodeRun):
2511         * platform/text/SuffixTree.h:
2512         (WebCore::SuffixTree::Node::Node):
2513         * rendering/Grid.cpp:
2514         (WebCore::Grid::setNeedsItemsPlacement):
2515         * rendering/RenderTable.cpp:
2516         (WebCore::RenderTable::invalidateCachedColumns):
2517
2518 2017-07-20  Chris Dumez  <cdumez@apple.com>
2519
2520         Regression(ITP): Can no longer log in on abc.go.com
2521         https://bugs.webkit.org/show_bug.cgi?id=174533
2522         <rdar://problem/33325881>
2523
2524         Reviewed by Geoffrey Garen.
2525
2526         Add quirk for sp.auth.adobe.com which is used for SSO by web sites such as
2527         abc.go.com. This would otherwise cause adobe.com to be identified as a
2528         tracker and log in on abc.go.com would break.
2529
2530         No new tests, tested manually on abc.go.com.
2531
2532         * loader/ResourceLoadObserver.cpp:
2533         (WebCore::resourceNeedsSSOQuirk):
2534         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2535
2536 2017-07-20  Antoine Quint  <graouts@apple.com>
2537
2538         Turn tests at media/modern-media-controls/start-support back on
2539         https://bugs.webkit.org/show_bug.cgi?id=174683
2540
2541         Reviewed by Dean Jackson.
2542
2543         Turning those tests back on revealed a small bug that is unlikely to really affect content
2544         on the Web. In the case where the size of the video is known right away, without the need
2545         for loading its metadata, as is the case in the start-support-click-to-start.html test with
2546         a local media resource, all queued layouts are flushed at once and we may call the layout()
2547         method of the left ButtonsContainer which originally is set to contain the play/pause button,
2548         which would remove the play/pause button from the center of the media. So before we potentially
2549         set the play/pause button as the central button, we first assign the default button set for
2550         the two ButtonsContainer instances and only add the play/pause button when we're not showing
2551         the prominent play/pause button.
2552
2553         * Modules/modern-media-controls/controls/inline-media-controls.js:
2554         (InlineMediaControls.prototype.layout):
2555         (InlineMediaControls.prototype._leftContainerButtons):
2556
2557 2017-07-20  Chris Dumez  <cdumez@apple.com>
2558
2559         Drop legacy FileException type
2560         https://bugs.webkit.org/show_bug.cgi?id=174676
2561
2562         Reviewed by Alex Christensen.
2563
2564         Drop legacy FileException type and use DOMException instead, as per the latest
2565         File API specification:
2566         - https://w3c.github.io/FileAPI/#ErrorAndException
2567
2568         Both Firefox and Chrome no longer expose FileException.
2569
2570         * CMakeLists.txt:
2571         * DerivedSources.cpp:
2572         * DerivedSources.make:
2573         * WebCore.xcodeproj/project.pbxproj:
2574         * bindings/js/JSDOMExceptionHandling.cpp:
2575         (WebCore::createDOMException):
2576         * dom/DOMExceptions.in:
2577         * fileapi/FileException.cpp: Removed.
2578         * fileapi/FileException.h: Removed.
2579         * fileapi/FileException.idl: Removed.
2580         * fileapi/FileReaderLoader.cpp:
2581         (WebCore::FileReaderLoader::FileReaderLoader):
2582         (WebCore::FileReaderLoader::failed):
2583         * fileapi/FileReaderLoader.h:
2584         (WebCore::FileReaderLoader::errorCode):
2585         * fileapi/FileReaderSync.cpp:
2586         (WebCore::errorCodeToExceptionCode):
2587         (WebCore::FileReaderSync::startLoading):
2588
2589 2017-07-20  Sam Weinig  <sam@webkit.org>
2590
2591         [WebIDL] Remove custom bindings for InspectorFrontendHost
2592         https://bugs.webkit.org/show_bug.cgi?id=174659
2593
2594         Reviewed by Chris Dumez.
2595
2596         * CMakeLists.txt:
2597         * WebCore.xcodeproj/project.pbxproj:
2598         * bindings/js/JSBindingsAllInOne.cpp:
2599         * bindings/js/JSInspectorFrontendHostCustom.cpp: Removed.
2600         Remove JSInspectorFrontendHostCustom.cpp.
2601
2602         * inspector/InspectorFrontendHost.cpp:
2603         (WebCore::populateContextMenu):
2604         (WebCore::InspectorFrontendHost::showContextMenu):
2605         * inspector/InspectorFrontendHost.h:
2606         * inspector/InspectorFrontendHost.idl:
2607         Re-implement showContextMenu by using an IDL defined ContextMenuItem dictionary
2608         and converting from that to a WebCore::ContextMenu in the implementation.
2609
2610 2017-07-20  Charlie Turner  <cturner@igalia.com>
2611
2612         [GTK] Layout Test http/tests/media/hls/hls-progress.html is failing
2613         https://bugs.webkit.org/show_bug.cgi?id=141469
2614
2615         Reviewed by Xabier Rodriguez-Calvar.
2616
2617         A work-around for getting progress information in a timely manner from
2618         live pipelines. We cannot rely on getting BUFFERING messages within
2619         the stalled time window (3s), so we have to poll for progress
2620         information somehow.
2621
2622         Makes the following pass reliably
2623          http/tests/media/hls/hls-audio-tracks-has-audio.html passed unexpectedly
2624          http/tests/media/hls/hls-audio-tracks.html passed unexpectedly
2625          http/tests/media/hls/hls-progress.html passed unexpectedly
2626
2627         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2628         (WebCore::findHLSQueue):
2629         (WebCore::isHLSProgressing):
2630         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
2631
2632 2017-07-20  Andreas Kling  <akling@apple.com>
2633
2634         Minor Node->Element type tightening fixes
2635         https://bugs.webkit.org/show_bug.cgi?id=174651
2636
2637         Reviewed by Sam Weinig.
2638
2639         Tighten up some Node* into Element* or even better, Element&.
2640
2641         * dom/Document.cpp:
2642         (WebCore::acceptsEditingFocus): Take a const Element&.
2643         (WebCore::Document::setFocusedElement):
2644         * editing/Editor.cpp:
2645         (WebCore::Editor::findEventTargetFrom): Return an Element*.
2646         (WebCore::Editor::findEventTargetFromSelection): Ditto.
2647         (WebCore::Editor::pasteAsPlainText):
2648         (WebCore::Editor::pasteAsFragment):
2649         (WebCore::Editor::dispatchCPPEvent):
2650         * editing/Editor.h:
2651         * page/DragController.cpp:
2652         (WebCore::DragController::dispatchTextInputEventFor):
2653
2654 2017-07-20  Brady Eidson  <beidson@apple.com>
2655
2656         WKHTTPCookieStore API tests fail on High Sierra.
2657         <rdar://problem/33410271> and https://bugs.webkit.org/show_bug.cgi?id=174666
2658
2659         Reviewed by Andy Estes.
2660
2661         Covered by existing API tests.
2662
2663         In r219567 I'd moved cookie storage observation off of NSHTTPCookieStorage and NSNotificationCenter
2664         to CFHTTPCookieStorage observation callbacks.
2665         
2666         This is because notifications were only sent for the default [NSHTTPCookieStorage sharedHTTPCookieStorage]
2667         and not any of the other ones we keep in flight.
2668         
2669         Unfortunately that SPI has been disabled in High Sierra.
2670         Fortunately we found a way we can get non-shared NSHTTPCookieStorages to send notifications that works everywhere.
2671         
2672         * platform/network/cocoa/CookieStorageObserver.h:
2673         * platform/network/cocoa/CookieStorageObserver.mm:
2674         (-[WebCookieObserverAdapter initWithObserver:]):
2675         (-[WebCookieObserverAdapter cookiesChangedNotificationHandler:]):
2676         (WebCore::CookieStorageObserver::create):
2677         (WebCore::CookieStorageObserver::CookieStorageObserver):
2678         (WebCore::CookieStorageObserver::~CookieStorageObserver):
2679         (WebCore::CookieStorageObserver::startObserving): Use a trick to call some SPI on non-shared NSHTTPCookieStorages
2680           to get them to send notifications.
2681         (WebCore::CookieStorageObserver::stopObserving):
2682         (WebCore::cookiesChanged): Deleted.
2683
2684         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2685         (WebCore::NetworkStorageSession::cookieStorageObserver):
2686
2687 2017-07-20  Miguel Gomez  <magomez@igalia.com>
2688
2689         [GStreamer] Some layout tests issue "g_mutex_clear() called on uninitialised or locked mutex" and flaky crash in ~MediaPlayerPrivateGStreamerBase
2690         https://bugs.webkit.org/show_bug.cgi?id=173952
2691
2692         Reviewed by Carlos Garcia Campos.
2693
2694         Adjust MediaPlayerPrivateGStreamerBase to avoid concurrence problems with the GStreamer thread when
2695         destroying the object.
2696
2697         Covered by existent tests.
2698
2699         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2700         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2701         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2702         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
2703
2704 2017-07-19  Zan Dobersek  <zdobersek@igalia.com>
2705
2706         [EME] Push CDMInstance, CDMPrivate and associated types into the Platform layer
2707         https://bugs.webkit.org/show_bug.cgi?id=174496
2708
2709         Reviewed by Xabier Rodriguez-Calvar.
2710
2711         Move the CDMInstance and CDMPrivate interfaces into the platform layer, enabling
2712         implementations of specific key systems at that level, as well as integration with
2713         the MediaPlayerPrivate stack without any layering violations.
2714
2715         While the platform layer still uses the WebCore namespace, the two interface files
2716         have now been moved under the platform/encryptedmedia/ directory and out of the
2717         Modules/encryptedmedia/ directory where the Web-facing API implementation resides.
2718
2719         The two interfaces integrated closely with the Web-facing enumerations and
2720         dictionaries: MediaKeyMessageType, MediaKeySessionType, MediaKeyStatus,
2721         MediaKeySystemConfiguration, MediaKeySystemCapability, MediaKeysRequirement
2722         and MediaKeysRestrictions. Definitions of these types are also moved to the
2723         platform layer without any changes (apart from renaming), and the previous
2724         types now alias against the types now located in the platform layer.
2725
2726         No new tests -- no change in behavior.
2727
2728         * CMakeLists.txt:
2729         * Modules/encryptedmedia/CDM.cpp:
2730         * Modules/encryptedmedia/CDM.h:
2731         * Modules/encryptedmedia/MediaKeyMessageType.h:
2732         * Modules/encryptedmedia/MediaKeySessionType.h:
2733         * Modules/encryptedmedia/MediaKeyStatus.h:
2734         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
2735         * Modules/encryptedmedia/MediaKeySystemAccess.h:
2736         * Modules/encryptedmedia/MediaKeySystemConfiguration.h:
2737         * Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
2738         * Modules/encryptedmedia/MediaKeysRequirement.h:
2739         * Modules/encryptedmedia/MediaKeysRestrictions.h:
2740         * platform/encryptedmedia/CDMInstance.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMInstance.h.
2741         * platform/encryptedmedia/CDMKeyStatus.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h.
2742         * platform/encryptedmedia/CDMKeySystemConfiguration.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h.
2743         * platform/encryptedmedia/CDMMediaCapability.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h.
2744         * platform/encryptedmedia/CDMMessageType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h.
2745         * platform/encryptedmedia/CDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
2746         * platform/encryptedmedia/CDMRequirement.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h.
2747         * platform/encryptedmedia/CDMRestrictions.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h.
2748         * platform/encryptedmedia/CDMSessionType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h.
2749
2750 2017-07-19  Zan Dobersek  <zdobersek@igalia.com>
2751
2752         Unreviewed follow-up to r219674.
2753
2754         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2755         Remove the AsyncScrollingCoordinator.h header include that was added by accident.
2756
2757 2017-07-19  Zan Dobersek  <zdobersek@igalia.com>
2758
2759         [CMake] Clean up Web Crypto build targets
2760         https://bugs.webkit.org/show_bug.cgi?id=174253
2761
2762         Reviewed by Alex Christensen.
2763
2764         Gather the common WebCrypto source files in CMakeLists.txt, including them
2765         in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
2766         build guards to exclude the code from compilation if the feature is disabled.
2767
2768         PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
2769         duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
2770         Web Crypto build targets.
2771
2772         PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the
2773         USE_GCRYPT variable is enabled. Both ports at the moment enable that variable
2774         though as they by default leverage a libgcrypt-based CrpytoDigest implementation
2775         in the PAL library.
2776
2777         The new GCrypt.cmake file adds the libgcrypt-specific Web Crypto build targets to
2778         the build and also sets up libgcrypt include directiories and libraries.
2779
2780         No new tests -- no change in behavior.
2781
2782         * CMakeLists.txt:
2783         * PlatformGTK.cmake:
2784         * PlatformMac.cmake:
2785         * PlatformWPE.cmake:
2786         * platform/GCrypt.cmake: Added.
2787
2788 2017-07-19  Sam Weinig  <sam@webkit.org>
2789
2790         [WebIDL] Remove custom bindings for CommandLineAPIHost
2791         https://bugs.webkit.org/show_bug.cgi?id=174642
2792
2793         Reviewed by Joseph Pecoraro.
2794
2795         * CMakeLists.txt:
2796         * WebCore.xcodeproj/project.pbxproj:
2797         * bindings/js/JSBindingsAllInOne.cpp:
2798         * bindings/js/JSCommandLineAPIHostCustom.cpp: Removed.
2799         Remove JSCommandLineAPIHostCustom.cpp.
2800
2801         * bindings/js/JSDOMConvertObject.h:
2802         (WebCore::JSConverter<IDLObject>::convert):
2803         Add missing JSConverter specialization for IDLObject.
2804
2805         * inspector/CommandLineAPIHost.cpp:
2806         (WebCore::CommandLineAPIHost::inspect):
2807         (WebCore::listenerEntriesFromListenerInfo):
2808         (WebCore::CommandLineAPIHost::inspectedObject):
2809         (WebCore::CommandLineAPIHost::databaseId):
2810         (WebCore::CommandLineAPIHost::storageId):
2811         (WebCore::CommandLineAPIHost::inspectImpl): Deleted.
2812         (WebCore::CommandLineAPIHost::getEventListenersImpl): Deleted.
2813         (WebCore::CommandLineAPIHost::databaseIdImpl): Deleted.
2814         (WebCore::CommandLineAPIHost::storageIdImpl): Deleted.
2815         * inspector/CommandLineAPIHost.h:
2816         * inspector/CommandLineAPIHost.idl:
2817         Replace custom bindings with modern bindings affordances: dictionaries, records and sequences.
2818
2819 2017-07-19  Zan Dobersek  <zdobersek@igalia.com>
2820
2821         Unreviewed CoordGraphics build fix.
2822
2823         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2824         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
2825         This should be defined for the ScrollingCoordinatorCoordinatedGraphics class.
2826         Also fix the setFixedToViewport() call, fishing out the GraphicsLayer object from
2827         the ScrollingStateNode's LayerRepresentation.
2828         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
2829
2830 2017-07-19  Chris Dumez  <cdumez@apple.com>
2831
2832         Drop SQLException type
2833         https://bugs.webkit.org/show_bug.cgi?id=174665
2834
2835         Reviewed by Sam Weinig.
2836
2837         Drop SQLException type. We never throw such exception. Also, Firefox
2838         and Chrome no longer expose this type.
2839
2840         * CMakeLists.txt:
2841         * DerivedSources.cpp:
2842         * DerivedSources.make:
2843         * Modules/webdatabase/SQLException.cpp: Removed.
2844         * Modules/webdatabase/SQLException.h: Removed.
2845         * Modules/webdatabase/SQLException.idl: Removed.
2846         * WebCore.xcodeproj/project.pbxproj:
2847         * bindings/js/JSDOMExceptionHandling.cpp:
2848         (WebCore::createDOMException):
2849         * bindings/js/JSExceptionBase.cpp:
2850         (WebCore::toExceptionBase):
2851         * dom/DOMExceptions.in:
2852
2853 2017-07-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2854
2855         Unreviewed, tweak a comment above TemporarySelectionOptionIgnoreSelectionChanges in Editor.cpp.
2856
2857         The comment references the UI process, but it describes an entity in WebCore. This should have been generalized
2858         to instead refer to the client layer in general (i.e. WebKit1 or WebKit2).
2859
2860         * editing/Editor.h:
2861
2862 2017-07-19  Simon Fraser  <simon.fraser@apple.com>
2863
2864         getBoundingClientRects not updated for programmatic scrolls
2865         https://bugs.webkit.org/show_bug.cgi?id=174538
2866         rdar://problem/33049012
2867
2868         Reviewed by Tim Horton.
2869
2870         Baidu.com has two event handlers on its <input>, and both query the input location with getBoundingClientRect()
2871         and the current pageYOffset (via jQuery), then try to scroll the input to the top of the screen. The bug is that
2872         programmatic scrolls did not immediately update the layout viewport rect, so the second call to
2873         getBoundingClientRect() would return stale coordinates, triggering an extra scroll.
2874
2875         To fix this, undo the fix for r219320 which tried to keep getBoundingClientRect() current during unstable scroll
2876         updates by adding a shadow layout viewport rect. Instead, almost always update the layout viewport rect on
2877         FrameView, even during unstable visible rect updates, but not if content insets are being changed interactively,
2878         since changing viewport heights cause problems with bottom-fixed elements. Also, we need to compute a new layout
2879         viewport rect in FrameView::updateLayoutViewport() for programmatic scrolls.
2880
2881         However, always updating the layout viewport triggered issues with the scrolling tree. The scrolling state tree
2882         fossilizes layer positions relative to a specific viewport rect, and that relationship has to be maintained.
2883         There are code paths that recompute fixed/sticky viewport constraints when the layout viewport has changed but
2884         we haven't done layout or recomputed layer positions (e.g. updating viewport-constrained layers via
2885         updateScrollCoordinatedLayersAfterFlush()) and in these cases using a new layout viewport for those computations
2886         results in an inconsistent scrolling tree.
2887
2888         Fix this by not updating scrolling constraints every time we have to re-register scrolling nodes.
2889         updateScrollCoordinatedLayersAfterFlush() only needs to update the layer on the scrolling node (to handle
2890         tiled/non-tiled switches), so make updateScrollCoordinatedLayer() a little more fine-grained, and only update
2891         constraints when we've just computed layer geometry. This allows for different scrolling nodes to have
2892         constraints computed at different times, with different layout viewports, which happens.
2893
2894         Two additional fixes were required to make bottom-fixed bars behave correctly.
2895
2896         First, FrameView::computeLayoutViewportOrigin() had a bug where rounding of half-pixel values would cause it to
2897         fall into the if (visualViewport.height() > layoutViewport.height()) clause, but then fail to clamp for
2898         rubber-banding.
2899         
2900         Second, the FrameView::unscaledMaximumScrollPosition() was wrong after zooming on iOS, since it uses visibleSize()
2901         which is affected by page scale on iOS only (and the function wants scale-independent values). Fix with a hack that
2902         should be cleaned up via webkit.org/b/174648.
2903
2904         Tested by existing tests.
2905
2906         * page/FrameView.cpp:
2907         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
2908         (WebCore::FrameView::computeLayoutViewportOrigin):
2909         (WebCore::FrameView::setLayoutViewportOverrideRect):
2910         (WebCore::FrameView::updateLayoutViewport):
2911         (WebCore::FrameView::unscaledMaximumScrollPosition):
2912         (WebCore::FrameView::documentToClientOffset):
2913         (WebCore::FrameView::setUnstableLayoutViewportRect): Deleted.
2914         * page/FrameView.h:
2915         * page/scrolling/AsyncScrollingCoordinator.cpp:
2916         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2917         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2918         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
2919         (WebCore::AsyncScrollingCoordinator::updateNodeLayer):
2920         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
2921         (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode): Deleted.
2922         * page/scrolling/AsyncScrollingCoordinator.h:
2923         * page/scrolling/ScrollingCoordinator.cpp:
2924         (WebCore::operator<<):
2925         * page/scrolling/ScrollingCoordinator.h:
2926         (WebCore::ScrollingCoordinator::reconcileScrollingState):
2927         (WebCore::ScrollingCoordinator::updateNodeLayer):
2928         (WebCore::ScrollingCoordinator::updateNodeViewportConstraints):
2929         (WebCore::ScrollingCoordinator::updateViewportConstrainedNode): Deleted.
2930         * page/scrolling/ScrollingStateFixedNode.cpp:
2931         (WebCore::ScrollingStateFixedNode::updateConstraints):
2932         * page/scrolling/ScrollingStateStickyNode.cpp:
2933         (WebCore::ScrollingStateStickyNode::updateConstraints):
2934         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
2935         * page/scrolling/ScrollingTree.cpp:
2936         (WebCore::ScrollingTree::commitTreeState):
2937         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2938         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
2939         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2940         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
2941         * rendering/RenderLayerBacking.cpp:
2942         (WebCore::RenderLayerBacking::updateGeometry):
2943         * rendering/RenderLayerCompositor.cpp:
2944         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
2945         (WebCore::RenderLayerCompositor::updateBacking):
2946         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged):
2947         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
2948         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
2949         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
2950         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints):
2951         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2952         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2953         * rendering/RenderLayerCompositor.h:
2954
2955 2017-07-19  Megan Gardner  <megan_gardner@apple.com>
2956
2957         Don't write file URLs to iOS Pasteboard
2958         https://bugs.webkit.org/show_bug.cgi?id=174647
2959         <rdar://problem/33199730>
2960
2961         Reviewed by Wenson Hsieh.
2962
2963         Tests updated to reflect the changes. We are no longer vending file URLs in Drag & Drop and Copy/Paste.
2964
2965         * editing/ios/EditorIOS.mm:
2966         (WebCore::Editor::writeImageToPasteboard):
2967         * platform/ios/PlatformPasteboardIOS.mm:
2968         (WebCore::PlatformPasteboard::write):
2969
2970 2017-07-19  Myles C. Maxfield  <mmaxfield@apple.com>
2971
2972         Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
2973         https://bugs.webkit.org/show_bug.cgi?id=174406
2974
2975         Reviewed by Simon Fraser.
2976         <rdar://problem/10139227>
2977
2978         Reviewed by NOBODY.
2979
2980         When the minimumFontSize API preference is set, we will increase the font size without increasing
2981         the line height. If the content specifies line-height as an absolute value, there can be two
2982         unfortunate results:
2983
2984         - Adjacent lines in a paragraph can overlap
2985         - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
2986         can be cut off and potentially indecipherable.
2987
2988         Instead, we should use the minimum font size preference as a signal that we should increase the
2989         line-height as well as the font-size. Eventually, we will want to increase it by an amount
2990         proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
2991         text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
2992         a behavior change on many webpages which use small text, so such a change would be too risky right now.
2993         Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
2994         only signal to boost the corresponding line-height.
2995
2996         Tests: fast/text/line-height-minimumFontSize-text-zoom.html
2997                fast/text/line-height-minimumFontSize-visual.html
2998                fast/text/line-height-minimumFontSize-zoom.html
2999                fast/text/line-height-minimumFontSize.html
3000                fast/text/line-height-minimumFontSize-autosize.html
3001
3002         * css/StyleBuilderCustom.h:
3003         (WebCore::computeBaseSpecifiedFontSize):
3004         (WebCore::computeLineHeightMultiplierDueToFontSize):
3005         (WebCore::StyleBuilderCustom::applyValueLineHeight):
3006         (WebCore::StyleBuilderCustom::applyValueFill):
3007         (WebCore::StyleBuilderCustom::applyValueStroke):
3008         (WebCore::StyleBuilderCustom::applyValueContent):
3009         * rendering/TextAutoSizing.cpp:
3010
3011 2017-07-18  Myles C. Maxfield  <mmaxfield@apple.com>
3012
3013         Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
3014         https://bugs.webkit.org/show_bug.cgi?id=174406
3015         <rdar://problem/10139227>
3016
3017         Reviewed by Simon Fraser.
3018
3019         When the minimumFontSize API preference is set, we will increase the font size without increasing
3020         the line height. If the content specifies line-height as an absolute value, there can be two
3021         unfortunate results:
3022
3023         - Adjacent lines in a paragraph can overlap
3024         - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
3025         can be cut off and potentially indecipherable.
3026
3027         Instead, we should use the minimum font size preference as a signal that we should increase the
3028         line-height as well as the font-size. Eventually, we will want to increase it by an amount
3029         proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
3030         text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
3031         a behavior change on many webpages which use small text, so such a change would be too risky right now.
3032         Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
3033         only signal to boost the corresponding line-height.
3034
3035         Tests: fast/text/line-height-minimumFontSize-text-zoom.html
3036                fast/text/line-height-minimumFontSize-visual.html
3037                fast/text/line-height-minimumFontSize-zoom.html
3038                fast/text/line-height-minimumFontSize.html
3039                fast/text/line-height-minimumFontSize-autosize.html
3040
3041         * css/StyleBuilderCustom.h:
3042         (WebCore::computeBaseSpecifiedFontSize):
3043         (WebCore::computeLineHeightMultiplierDueToFontSize):
3044         (WebCore::StyleBuilderCustom::applyValueLineHeight):
3045         (WebCore::StyleBuilderCustom::applyValueFill):
3046         (WebCore::StyleBuilderCustom::applyValueStroke):
3047         (WebCore::StyleBuilderCustom::applyValueContent):
3048         * rendering/TextAutoSizing.cpp:
3049
3050 2017-07-19  Chris Dumez  <cdumez@apple.com>
3051
3052         DOMException should not have its own toString()
3053         https://bugs.webkit.org/show_bug.cgi?id=174630
3054
3055         Reviewed by Sam Weinig.
3056
3057         DOMException should not have its own toString() and should use the one from Error.prototype.toString()
3058         instead:
3059         - https://heycam.github.io/webidl/#idl-DOMException
3060
3061         No new tests, rebaselined existing tests.
3062
3063         * dom/DOMCoreException.idl:
3064
3065 2017-07-19  Antoine Quint  <graouts@apple.com>
3066
3067         [iOS] REGRESSION: Scrubbing media using built-in controls does not pause media
3068         https://bugs.webkit.org/show_bug.cgi?id=174650
3069         <rdar://problem/33401877>
3070
3071         Reviewed by Dean Jackson.
3072
3073         We would only pause when scrubbing on macOS because we only listened to "mousedown" events on the
3074         scrubber's backing <input> element to identify that the user had started interacting with the
3075         scrubber.
3076
3077         Implementing the same technique on iOS required a little more work than just listening to "touchstart"
3078         events on the same element. On top of that, we needed to make sure that we would only respond to
3079         "touchstart" events on the slider's thumb, and not on the track, since only on macOS should the user
3080         be able to click anywhere on the track to scrub. So we turn off pointer-events for the <input> on iOS
3081         only, and turn them back on specifically for the thumb.
3082
3083         There is also some finessing when dealing with touch events where we need to track the identifier of
3084         the touch that started the user interaction. So we keep track of it in an ivar and wait until we get
3085         a "touchend" event where the changedTouches list contains a touch with that same identifier to ensure
3086         the same touch that initiates and ends the scrubbing interaction.
3087
3088         Finally, we fix another issue that was uncovered while turning back on the ScrubbingSupport tests
3089         where we would not trash the cached _value ivar when we initiated scrubbing, which was important since
3090         we would mistakenly use the pre-srubbing value during a scrub.
3091
3092         * Modules/modern-media-controls/controls/slider.css:
3093         (.ios .slider > input):
3094         (.slider > input::-webkit-slider-thumb):
3095         * Modules/modern-media-controls/controls/slider.js:
3096         (Slider.prototype.handleEvent):
3097         (Slider.prototype._handleMousedownEvent):
3098         (Slider.prototype._interactionEndTarget):
3099         (Slider.prototype._handleTouchstartEvent):
3100         (Slider.prototype._valueWillStartChanging):
3101         (Slider.prototype._valueDidStopChanging):
3102         (Slider.prototype._handleMouseupEvent):
3103         (Slider.prototype._handleTouchendEvent):
3104
3105 2017-07-19  Nan Wang  <n_wang@apple.com>
3106
3107         AX: Web page reloaded when a node is labelling multiple childnodes
3108         https://bugs.webkit.org/show_bug.cgi?id=174655
3109
3110         Reviewed by Chris Fleizach.
3111
3112         When we are asking for the aria-labelledby attribute of a node and its
3113         sibling is also labelled by the same node, we get into an infinite loop
3114         in textUnderElement since we only ignore one child. Added checks for 
3115         siblings to avoid such loop.
3116
3117         Test: accessibility/mac/aria-labelledby-multiple-child-crash.html
3118
3119         * accessibility/AccessibilityNodeObject.cpp:
3120         (WebCore::AccessibilityNodeObject::textUnderElement):
3121
3122 2017-07-19  Andy Estes  <aestes@apple.com>
3123
3124         Use a cast to work around clang's false -Wobjc-literal-conversion warnings
3125         https://bugs.webkit.org/show_bug.cgi?id=174631
3126
3127         Reviewed by Dan Bernstein.
3128
3129         Instead of ignoring -Wobjc-literal-conversion, use a cast to work around rdar://problem/33383354.
3130
3131         * platform/ios/PlatformPasteboardIOS.mm:
3132         (WebCore::PlatformPasteboard::write):
3133
3134 2017-07-19  Chris Dumez  <cdumez@apple.com>
3135
3136         Make cross-origin properties enumerable
3137         https://bugs.webkit.org/show_bug.cgi?id=174576
3138
3139         Reviewed by Darin Adler.
3140
3141         Makes cross-origin properties enumerable on Window and Location objects
3142         as per:
3143         - https://github.com/whatwg/html/pull/2777
3144
3145         This simplifies our code quite a bit.
3146
3147         No new tests, updated existing tests.
3148
3149         * bindings/js/JSDOMWindowCustom.cpp:
3150         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3151         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3152         (WebCore::JSDOMWindow::getOwnPropertyNames):
3153         * bindings/js/JSLocationCustom.cpp:
3154         (WebCore::getOwnPropertySlotCommon):
3155         (WebCore::JSLocation::getOwnPropertyNames):
3156         * bindings/scripts/CodeGeneratorJS.pm:
3157         (GenerateHeader):
3158
3159 2017-07-18  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3160
3161         [EME] Build failure with Clang-3.8 on InitDataRegistry.cpp
3162         https://bugs.webkit.org/show_bug.cgi?id=174628
3163
3164         Reviewed by Žan Doberšek.
3165
3166         * Modules/encryptedmedia/InitDataRegistry.cpp:
3167         (WebCore::extractKeyIDsKeyids): Add an explicit cast to unsigned.
3168
3169 2017-07-19  Matt Lewis  <jlewis3@apple.com>
3170
3171         Unreviewed, rolling out r219646.
3172
3173         The test added are failing on all platforms
3174
3175         Reverted changeset:
3176
3177         "Setting the minimum font size preference doesn’t affect
3178         absolute line-height values, so lines overlap"
3179         https://bugs.webkit.org/show_bug.cgi?id=174406
3180         http://trac.webkit.org/changeset/219646
3181
3182 2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>
3183
3184         [WTF] Implement WTF::ThreadGroup
3185         https://bugs.webkit.org/show_bug.cgi?id=174081
3186
3187         Reviewed by Mark Lam.
3188
3189         * page/ResourceUsageThread.h:
3190
3191 2017-07-18  Andy Estes  <aestes@apple.com>
3192
3193         [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
3194         https://bugs.webkit.org/show_bug.cgi?id=174631
3195
3196         Reviewed by Tim Horton.
3197
3198         * Configurations/Base.xcconfig:
3199         * rendering/Grid.cpp:
3200         (WebCore::Grid::insert):
3201         * rendering/RenderTreeAsText.cpp:
3202         (WebCore::write):
3203         * rendering/SimpleLineLayoutCoverage.cpp:
3204         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
3205
3206 2017-07-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3207
3208         WTF::Thread should have the threads stack bounds.
3209         https://bugs.webkit.org/show_bug.cgi?id=173975
3210
3211         Reviewed by Mark Lam.
3212
3213         When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread
3214         and share it with WebThread.
3215         The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators.
3216         It allocates AtomicString, which requires WTFThreadData.
3217
3218         In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData.
3219         And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since
3220         WebCore::ThreadGlobalData allocates AtomicString.
3221
3222         * platform/ios/wak/WebCoreThread.mm:
3223         (StartWebThread):
3224
3225 2017-07-18  Myles C. Maxfield  <mmaxfield@apple.com>
3226
3227         Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
3228         https://bugs.webkit.org/show_bug.cgi?id=174406
3229         <rdar://problem/10139227>
3230
3231         Reviewed by Simon Fraser.
3232
3233         When the minimumFontSize API preference is set, we will increase the font size without increasing
3234         the line height. If the content specifies line-height as an absolute value, there can be two
3235         unfortunate results:
3236
3237         - Adjacent lines in a paragraph can overlap
3238         - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
3239         can be cut off and potentially indecipherable.
3240
3241         Instead, we should use the minimum font size preference as a signal that we should increase the
3242         line-height as well as the font-size. Eventually, we will want to increase it by an amount
3243         proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
3244         text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
3245         a behavior change on many webpages which use small text, so such a change would be too risky right now.
3246         Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
3247         only signal to boost the corresponding line-height.
3248
3249         Tests: fast/text/line-height-minimumFontSize-text-zoom.html
3250                fast/text/line-height-minimumFontSize-visual.html
3251                fast/text/line-height-minimumFontSize-zoom.html
3252                fast/text/line-height-minimumFontSize.html
3253                fast/text/line-height-minimumFontSize-autosize.html
3254
3255         * css/StyleBuilderCustom.h:
3256         (WebCore::computeBaseSpecifiedFontSize):
3257         (WebCore::computeLineHeightMultiplierDueToFontSize):
3258         (WebCore::StyleBuilderCustom::applyValueLineHeight):
3259         (WebCore::StyleBuilderCustom::applyValueFill):
3260         (WebCore::StyleBuilderCustom::applyValueStroke):
3261         (WebCore::StyleBuilderCustom::applyValueContent):
3262         * rendering/TextAutoSizing.cpp:
3263
3264 2017-07-18  Zalan Bujtas  <zalan@apple.com>
3265
3266         Media controls are missing content in fullscreen when document has scroll offset.
3267         https://bugs.webkit.org/show_bug.cgi?id=174644
3268         <rdar://problem/32415323>
3269
3270         Reviewed by Simon Fraser.
3271
3272         If a non-user initiated scrolling (result of resize for example) is processed asynchronously, it might
3273         leapfrog other, programatic scrollings and trigger unintentional scroll offsets (and turn into unwanted clippings). 
3274         This patch ensures that both resize and top content inset change are translated into programatic scrolling. 
3275
3276         Unable to test full screen video.
3277
3278         * page/FrameView.cpp:
3279         (WebCore::FrameView::setFrameRect):
3280         (WebCore::FrameView::topContentInsetDidChange):
3281
3282 2017-07-18  Andy Estes  <aestes@apple.com>
3283
3284         [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
3285         https://bugs.webkit.org/show_bug.cgi?id=174631
3286
3287         Reviewed by Sam Weinig.
3288
3289         * Configurations/Base.xcconfig:
3290         * platform/ios/PlatformPasteboardIOS.mm:
3291         (WebCore::PlatformPasteboard::write):
3292
3293 2017-07-18  Ali Juma  <ajuma@chromium.org>
3294
3295         Align quirky number parsing with other browsers
3296         https://bugs.webkit.org/show_bug.cgi?id=155874
3297
3298         Reviewed by Simon Fraser.
3299
3300         Parse unit-less non-zero values for animation-duration and transition-duration
3301         as invalid time values in quirks mode.
3302
3303         Test: fast/css/animation-transition-duration-quirksmode.html
3304
3305         * css/parser/CSSPropertyParser.cpp:
3306         (WebCore::consumeAnimationValue):
3307
3308 2017-07-18  Chris Dumez  <cdumez@apple.com>
3309
3310         HysteresisActivity cannot be used in the UIProcess
3311         https://bugs.webkit.org/show_bug.cgi?id=174643
3312         <rdar://problem/33086442>
3313
3314         Reviewed by Tim Horton.
3315
3316         Port HysteresisActivity to RunLoop::Timer so that it can safely be used in
3317         the UIProcess as well.
3318
3319         * platform/HysteresisActivity.h:
3320
3321 2017-07-18  Joseph Pecoraro  <pecoraro@apple.com>
3322
3323         Web Inspector: Modernize InjectedScriptSource
3324         https://bugs.webkit.org/show_bug.cgi?id=173890
3325
3326         Reviewed by Brian Burg.
3327
3328         Covered by existing tests.
3329
3330         * inspector/CommandLineAPIModuleSource.js:
3331         (CommandLineAPIImpl.prototype.copy):
3332         (CommandLineAPIImpl.prototype._inspect):
3333         Use RemoteObject, a new parameter.
3334
3335 2017-07-18  Ryosuke Niwa  <rniwa@webkit.org>
3336
3337         REGRESSION(r218910): Crash when password field changes to text field
3338         https://bugs.webkit.org/show_bug.cgi?id=174560
3339
3340         Reviewed by Zalan Bujtas.
3341
3342         The crash was caused by textMarkerDataForFirstPositionInTextControl accessing a nullptr returned by getOrCreate.
3343         Unfortunately, in order to this fix bug while preserving the exact behavior would require synchronously creating
3344         a renderer for the editing host when the input type changed since we can't create an accessbility object out of
3345         a renderer-less node.
3346
3347         Instead, revert back to pre-r218910 behavior of always using the text control element's axID when notifying
3348         the value change. While this is inconsistent with the way editing commands report content changes, I've since
3349         learned that VoiceOver has code to deal with this exact situation.
3350
3351         Test: accessibility/mac/input-type-change-crash-2.html
3352
3353         * accessibility/AXObjectCache.cpp:
3354         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
3355
3356 2017-07-18  Matt Baker  <mattbaker@apple.com>
3357
3358         Web Inspector: Refactoring: replace InspectorCanvasAgent::CanvasEntry with a helper class
3359         https://bugs.webkit.org/show_bug.cgi?id=174311
3360
3361         Reviewed by Devin Rousso.
3362
3363         This patch adds a helper class for tracking canvases and their data. The
3364         current approach of defining a helper structure in the agent's header is
3365         awkward to use and maintain, and won't scale well as more canvas instrumentation
3366         points and data are added.
3367
3368         * CMakeLists.txt:
3369         * WebCore.xcodeproj/project.pbxproj:
3370         New file.
3371
3372         * inspector/InspectorCanvas.cpp: Added.
3373         (WebCore::InspectorCanvas::create):
3374         (WebCore::InspectorCanvas::InspectorCanvas):
3375         (WebCore::InspectorCanvas::buildObjectForCanvas):
3376         * inspector/InspectorCanvas.h: Added.
3377
3378         * inspector/InspectorCanvasAgent.cpp:
3379         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3380         (WebCore::InspectorCanvasAgent::enable):
3381         (WebCore::InspectorCanvasAgent::requestNode):
3382         (WebCore::InspectorCanvasAgent::requestContent):
3383         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
3384         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
3385         (WebCore::InspectorCanvasAgent::frameNavigated):
3386         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
3387         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
3388         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3389         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
3390         (WebCore::InspectorCanvasAgent::canvasDestroyed):
3391         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
3392         (WebCore::InspectorCanvasAgent::clearCanvasData):
3393         (WebCore::InspectorCanvasAgent::unbindCanvas):
3394         (WebCore::InspectorCanvasAgent::assertInspectorCanvas):
3395         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
3396         (WebCore::InspectorCanvasAgent::getCanvasEntry): Deleted.
3397         (WebCore::InspectorCanvasAgent::buildObjectForCanvas): Deleted.
3398         * inspector/InspectorCanvasAgent.h:
3399
3400         * inspector/InspectorController.cpp:
3401         (WebCore::InspectorController::InspectorController):
3402         Remove unused constructor argument.
3403
3404 2017-07-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3405
3406         [Curl] Move detail implementation from ResourceHandle to ResourceHandleInternal
3407         https://bugs.webkit.org/show_bug.cgi?id=174641
3408
3409         After moving stuff from ResourceHandleManager to ResourceHandle on 
3410         https://bugs.webkit.org/show_bug.cgi?id=173630, still there're many violation
3411         remains between ResourceHandle and ResourceHandleInternal classes.
3412         Many of implementation detail should be move to ResourceHandleInternal