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